diff --git a/src/Yavsc.Abstract/Interfaces/IBillingService.cs b/src/Yavsc.Abstract/Interfaces/IBillingService.cs index 5c99212a..3ba7fc59 100644 --- a/src/Yavsc.Abstract/Interfaces/IBillingService.cs +++ b/src/Yavsc.Abstract/Interfaces/IBillingService.cs @@ -17,8 +17,8 @@ namespace Yavsc.Services /// /// Renvoye la facture associée à une clé de facturation, /// à partir du couple suivant : - /// - /// * un code de facturation + /// + /// * un code de facturation /// (identifiant associé à un type de demande du client) /// * un entier long identifiant la demande du client /// (à une demande, on associe au maximum une seule facture) @@ -26,10 +26,10 @@ namespace Yavsc.Services /// Identifiant du type de facturation /// Identifiant de la demande du client /// La facture - Task GetBillAsync(string billingCode, long queryId); - + Task GetBillAsync(string billingCode, long queryId); + /// - /// Perfomer settings for the specified performer in the activity + /// Perfomer settings for the specified performer in the activity /// /// activityCode /// performer uid diff --git a/src/Yavsc.Abstract/Workflow/INominativeQuery.cs b/src/Yavsc.Abstract/Workflow/INominativeQuery.cs index 7e0b5983..d498e28d 100644 --- a/src/Yavsc.Abstract/Workflow/INominativeQuery.cs +++ b/src/Yavsc.Abstract/Workflow/INominativeQuery.cs @@ -4,8 +4,6 @@ namespace Yavsc.Abstract.Workflow { public interface IDecidableQuery: ITrackedEntity, IQuery { - bool Reviewed { get; set; } - bool Accepted { get; set; } } } diff --git a/src/Yavsc.Api/Controllers/Business/FrontOfficeApiController.cs b/src/Yavsc.Api/Controllers/Business/FrontOfficeApiController.cs index 75813c4e..b91cba51 100644 --- a/src/Yavsc.Api/Controllers/Business/FrontOfficeApiController.cs +++ b/src/Yavsc.Api/Controllers/Business/FrontOfficeApiController.cs @@ -34,8 +34,8 @@ namespace Yavsc.ApiControllers if (queryId == 0) return BadRequest("queryId"); var billing = BillingService.GetBillable(dbContext, billingCode, queryId); if (billing == null) return BadRequest(); - billing.Reviewed = true; - billing.Accepted = false; + + billing.Status = QueryStatus.Rejected; dbContext.SaveChanges(); return Ok(); } @@ -47,8 +47,7 @@ namespace Yavsc.ApiControllers if (queryId == 0) return BadRequest("queryId"); var billing = BillingService.GetBillable(dbContext, billingCode, queryId); if (billing == null) return BadRequest(); - billing.Accepted = true; - billing.Reviewed = true; + billing.Status = QueryStatus.Accepted; dbContext.SaveChanges(); return Ok(); } diff --git a/src/Yavsc.Org.Tests/NonRegression/BillingServiceTests.cs b/src/Yavsc.Org.Tests/NonRegression/BillingServiceTests.cs index 0309ba8e..8d15d26c 100644 --- a/src/Yavsc.Org.Tests/NonRegression/BillingServiceTests.cs +++ b/src/Yavsc.Org.Tests/NonRegression/BillingServiceTests.cs @@ -36,11 +36,11 @@ namespace Yavsc { WorkflowHelpers.ConfigureBillingService(); - var firstRegistrar = new Func((db, id) => + var firstRegistrar = new Func((db, id) => db.HairCutQueries.Include(q => q.Prestation).Include(q => q.Regularisation).Single(q => q.Id == id)); const string testCode = "Brush"; - + Assert.Throws(() => WorkflowHelpers.RegisterBilling(testCode, firstRegistrar)); } diff --git a/src/Yavsc.Org/Views/Project/Delete.cshtml b/src/Yavsc.Org/Views/Project/Delete.cshtml index 57a48603..f2f25646 100644 --- a/src/Yavsc.Org/Views/Project/Delete.cshtml +++ b/src/Yavsc.Org/Views/Project/Delete.cshtml @@ -53,12 +53,6 @@
@Html.DisplayFor(model => model.Previsional)
-
- @Html.DisplayNameFor(model => model.Reviewed) -
-
- @Html.DisplayFor(model => model.Reviewed) -
@Html.DisplayNameFor(model => model.DateModified)
diff --git a/src/Yavsc.Org/Views/Project/Details.cshtml b/src/Yavsc.Org/Views/Project/Details.cshtml index af716bbd..48c97e8e 100644 --- a/src/Yavsc.Org/Views/Project/Details.cshtml +++ b/src/Yavsc.Org/Views/Project/Details.cshtml @@ -58,12 +58,6 @@
@Html.DisplayFor(model => model.Previsional)
-
- @Html.DisplayNameFor(model => model.Reviewed) -
-
- @Html.DisplayFor(model => model.Reviewed) -
@Html.DisplayNameFor(model => model.DateModified)
diff --git a/src/Yavsc.Org/Views/Project/Edit.cshtml b/src/Yavsc.Org/Views/Project/Edit.cshtml index b07859ac..8c41c6e3 100644 --- a/src/Yavsc.Org/Views/Project/Edit.cshtml +++ b/src/Yavsc.Org/Views/Project/Edit.cshtml @@ -42,14 +42,6 @@ -
-
-
- - -
-
-
diff --git a/src/Yavsc.Org/Views/Project/Index.cshtml b/src/Yavsc.Org/Views/Project/Index.cshtml index e428fd07..49f8fce6 100644 --- a/src/Yavsc.Org/Views/Project/Index.cshtml +++ b/src/Yavsc.Org/Views/Project/Index.cshtml @@ -32,9 +32,6 @@ @Html.DisplayNameFor(model => model.Previsional) - - @Html.DisplayNameFor(model => model.Reviewed) - @Html.DisplayNameFor(model => model.DateModified) @@ -79,9 +76,6 @@ @Html.DisplayFor(modelItem => item.Previsional) - - @Html.DisplayFor(modelItem => item.Reviewed) - @Html.DisplayFor(modelItem => item.DateModified) diff --git a/src/Yavsc.Server/Helpers/WorkflowHelpers.cs b/src/Yavsc.Server/Helpers/WorkflowHelpers.cs index 55e8dc88..1e435d3f 100644 --- a/src/Yavsc.Server/Helpers/WorkflowHelpers.cs +++ b/src/Yavsc.Server/Helpers/WorkflowHelpers.cs @@ -41,7 +41,7 @@ namespace Yavsc.Helpers } public static void RegisterBilling(string code, Func getter) where T : IBillable + IQuery> getter) where T : IBillable { lock (_billingLock) { @@ -91,7 +91,7 @@ namespace Yavsc.Helpers } } - RegisterBilling(BillingCodes.Brush, new Func + RegisterBilling(BillingCodes.Brush, new Func ((db, id) => { var query = db.HairCutQueries.Include(q => q.Prestation).Include(q => q.Regularisation).Single(q => q.Id == id); @@ -99,10 +99,10 @@ namespace Yavsc.Helpers return query; })); - RegisterBilling(BillingCodes.MBrush, new Func + RegisterBilling(BillingCodes.MBrush, new Func ((db, id) => db.HairMultiCutQueries.Include(q => q.Regularisation).Single(q => q.Id == id))); - RegisterBilling(BillingCodes.Rdv, new Func + RegisterBilling(BillingCodes.Rdv, new Func ((db, id) => db.RdvQueries.Include(q => q.Regularisation).Single(q => q.Id == id))); } } diff --git a/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs b/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs index ff1a1dca..798313a8 100644 --- a/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs +++ b/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs @@ -13,7 +13,7 @@ namespace Yavsc.Models.Billing using Yavsc.Abstract.Workflow; using Yavsc.Services; - public abstract class NominativeServiceCommand : IDecidableQuery, IIdentified, IBillable + public abstract class NominativeServiceCommand : IQuery, IIdentified, IBillable { public string GetInvoiceId() { return GetType().Name + "/" + Id; } @@ -78,9 +78,6 @@ namespace Yavsc.Models.Billing [ForeignKey("ActivityCode"),JsonIgnore,Display(Name="Domaine d'activité")] public virtual Activity Context  { get; set ; } - public bool Reviewed { get; set; } - - public abstract System.Collections.Generic.List GetBillItems(); public bool GetIsAcquitted() @@ -102,6 +99,5 @@ namespace Yavsc.Models.Billing [Display(Name = "Acquittement de la facture")] public virtual PayPalPayment Regularisation { get; set; } - public bool Accepted { get; set; } } } diff --git a/src/Yavsc.Server/Services/BillingService.cs b/src/Yavsc.Server/Services/BillingService.cs index 214e336f..0738c57d 100644 --- a/src/Yavsc.Server/Services/BillingService.cs +++ b/src/Yavsc.Server/Services/BillingService.cs @@ -8,8 +8,8 @@ namespace Yavsc.Services public class BillingService : IBillingService { public ApplicationDbContext DbContext { get; private set; } - public static Dictionary> Billing = - new Dictionary>(); + public static Dictionary> Billing = + new Dictionary>(); public static List UserSettings = new List(); public static Dictionary GlobalBillingMap = @@ -25,12 +25,12 @@ namespace Yavsc.Services DbContext = dbContext; } - public Task GetBillAsync(string billingCode, long queryId) + public Task GetBillAsync(string billingCode, long queryId) { return Task.FromResult(GetBillable(DbContext, billingCode, queryId)); } - public static IDecidableQuery GetBillable(ApplicationDbContext context, string billingCode, long queryId) => Billing[billingCode](context, queryId); + public static IQuery GetBillable(ApplicationDbContext context, string billingCode, long queryId) => Billing[billingCode](context, queryId); public async Task GetPerformersSettingsAsync(string activityCode, string userId) { var activity = await DbContext.Activities.SingleAsync(a => a.Code == activityCode); @@ -39,7 +39,7 @@ namespace Yavsc.Services var dbSetGetter = UserSettings.SingleOrDefault(s => s.Name == activity.SettingsClassName); - + if (dbSetGetter==null) return null; var dbSet = dbSetGetter.GetValue(DbContext);