diff --git a/src/Yavsc.Org/Views/Project/Delete.cshtml b/src/Yavsc.Org/Views/Project/Delete.cshtml
index f2f25646..6a9a3f20 100644
--- a/src/Yavsc.Org/Views/Project/Delete.cshtml
+++ b/src/Yavsc.Org/Views/Project/Delete.cshtml
@@ -48,10 +48,10 @@
@Html.DisplayFor(model => model.OwnerId)
- @Html.DisplayNameFor(model => model.Previsional)
+ @Html.DisplayNameFor(model => model.Provisional)
- @Html.DisplayFor(model => model.Previsional)
+ @Html.DisplayFor(model => model.Provisional)
@Html.DisplayNameFor(model => model.DateModified)
diff --git a/src/Yavsc.Org/Views/Project/Details.cshtml b/src/Yavsc.Org/Views/Project/Details.cshtml
index 48c97e8e..da6d6287 100644
--- a/src/Yavsc.Org/Views/Project/Details.cshtml
+++ b/src/Yavsc.Org/Views/Project/Details.cshtml
@@ -53,10 +53,10 @@
@Html.DisplayFor(model => model.OwnerId)
- @Html.DisplayNameFor(model => model.Previsional)
+ @Html.DisplayNameFor(model => model.Provisional)
- @Html.DisplayFor(model => model.Previsional)
+ @Html.DisplayFor(model => model.Provisional)
@Html.DisplayNameFor(model => model.DateModified)
diff --git a/src/Yavsc.Org/Views/Project/Edit.cshtml b/src/Yavsc.Org/Views/Project/Edit.cshtml
index 8c41c6e3..4cc6d3de 100644
--- a/src/Yavsc.Org/Views/Project/Edit.cshtml
+++ b/src/Yavsc.Org/Views/Project/Edit.cshtml
@@ -36,10 +36,10 @@
diff --git a/src/Yavsc.Org/Views/Project/Index.cshtml b/src/Yavsc.Org/Views/Project/Index.cshtml
index 49f8fce6..e444a082 100644
--- a/src/Yavsc.Org/Views/Project/Index.cshtml
+++ b/src/Yavsc.Org/Views/Project/Index.cshtml
@@ -30,7 +30,7 @@
@Html.DisplayNameFor(model => model.OwnerId)
- @Html.DisplayNameFor(model => model.Previsional)
+ @Html.DisplayNameFor(model => model.Provisional)
|
@Html.DisplayNameFor(model => model.DateModified)
@@ -74,7 +74,7 @@
@Html.DisplayFor(modelItem => item.OwnerId)
|
- @Html.DisplayFor(modelItem => item.Previsional)
+ @Html.DisplayFor(modelItem => item.Provisional)
|
@Html.DisplayFor(modelItem => item.DateModified)
diff --git a/src/Yavsc.Org/Views/Shared/Components/PayPalButton/Default.cshtml b/src/Yavsc.Org/Views/Shared/Components/PayPalButton/Default.cshtml
index 9fc4d80b..954b4eba 100644
--- a/src/Yavsc.Org/Views/Shared/Components/PayPalButton/Default.cshtml
+++ b/src/Yavsc.Org/Views/Shared/Components/PayPalButton/Default.cshtml
@@ -1,25 +1,25 @@
@model NominativeServiceCommand
@if (Model!=null && Model.PaymentId!=null) {
-
- @if (Model.Regularisation.Executor.Id == User.GetUserId()) {
+
+ @if (Model.Regularization.Executor.Id == User.GetUserId()) {
Votre paiment
} else {
- Le paiment de @Html.DisplayFor(m=>m.Regularisation.Executor.UserName)
+ Le paiment de @Html.DisplayFor(m=>m.Regularization.Executor.UserName)
}
- :
+ :
-}
+}
@if (!Model.GetIsAcquitted()) {
diff --git a/src/Yavsc.Org/Views/Shared/DisplayTemplates/HairCutQuery.cshtml b/src/Yavsc.Org/Views/Shared/DisplayTemplates/HairCutQuery.cshtml
index 5af91dd1..6dfb1e54 100644
--- a/src/Yavsc.Org/Views/Shared/DisplayTemplates/HairCutQuery.cshtml
+++ b/src/Yavsc.Org/Views/Shared/DisplayTemplates/HairCutQuery.cshtml
@@ -24,8 +24,8 @@
@await Component.InvokeAsync("Bill", Model)
-@Html.DisplayNameFor(m=>m.Regularisation)
-
+@Html.DisplayNameFor(m=>m.Regularization)
+
@await Component.InvokeAsync("PayPalButton", Model)
diff --git a/src/Yavsc.Server/Helpers/WorkflowHelpers.cs b/src/Yavsc.Server/Helpers/WorkflowHelpers.cs
index 1e435d3f..9caba856 100644
--- a/src/Yavsc.Server/Helpers/WorkflowHelpers.cs
+++ b/src/Yavsc.Server/Helpers/WorkflowHelpers.cs
@@ -76,15 +76,21 @@ namespace Yavsc.Helpers
{
Config.ProfileTypes.Add(c);
}
+ if (c.IsClass && !c.IsAbstract &&
+ c.GetInterface(nameof(IBillable)) != null)
+ {
+ BillingService.GlobalBillingMap.Add(c.Name, c.AssemblyQualifiedName);
+ }
}
}
foreach (var propertyInfo in typeof(ApplicationDbContext).GetProperties())
{
- foreach (var attr in propertyInfo.CustomAttributes)
+ if (propertyInfo.PropertyType.IsGenericType &&
+ propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(DbSet<>))
{
- // something like a DbSet?
- if (typeof(Yavsc.Attributes.ActivitySettingsAttribute).IsAssignableFrom(attr.AttributeType))
+ var entityType = propertyInfo.PropertyType.GetGenericArguments()[0];
+ if (typeof(IUserSettings).IsAssignableFrom(entityType))
{
BillingService.UserSettings.Add(propertyInfo);
}
@@ -94,16 +100,16 @@ namespace Yavsc.Helpers
RegisterBilling(BillingCodes.Brush, new Func
((db, id) =>
{
- var query = db.HairCutQueries.Include(q => q.Prestation).Include(q => q.Regularisation).Single(q => q.Id == id);
+ var query = db.HairCutQueries.Include(q => q.Prestation).Include(q => q.Regularization).Single(q => q.Id == id);
query.SelectedProfile = db.BrusherProfile.Single(b => b.UserId == query.PerformerId);
return query;
}));
RegisterBilling(BillingCodes.MBrush, new Func
- ((db, id) => db.HairMultiCutQueries.Include(q => q.Regularisation).Single(q => q.Id == id)));
+ ((db, id) => db.HairMultiCutQueries.Include(q => q.Regularization).Single(q => q.Id == id)));
RegisterBilling(BillingCodes.Rdv, new Func
- ((db, id) => db.RdvQueries.Include(q => q.Regularisation).Single(q => q.Id == id)));
+ ((db, id) => db.RdvQueries.Include(q => q.Regularization).Single(q => q.Id == id)));
}
}
diff --git a/src/Yavsc.Server/Models/ApplicationDbContext.cs b/src/Yavsc.Server/Models/ApplicationDbContext.cs
index cbdb6895..94076715 100644
--- a/src/Yavsc.Server/Models/ApplicationDbContext.cs
+++ b/src/Yavsc.Server/Models/ApplicationDbContext.cs
@@ -290,22 +290,17 @@ namespace Yavsc.Models
public DbSet Instrument { get; set; }
- [ActivitySettings]
public DbSet DjSettings { get; set; }
- [ActivitySettings]
public DbSet Instrumentation { get; set; }
- [ActivitySettings]
public DbSet FormationSettings { get; set; }
- [ActivitySettings]
- public DbSet GeneralSettings { get; set; }
+ public DbSet MusicLoverSettings { get; set; }
public DbSet CoWorking { get; set; }
- private void AddTimestamps(string userId)
- {
- var entities =
+ private void AddTimestamps(string userId)
+ { var entities =
ChangeTracker.Entries()
.Where(x => x.Entity.GetType().GetInterface(nameof(ITrackedEntity)) != null
&& (x.State == EntityState.Added || x.State == EntityState.Modified));
@@ -360,7 +355,6 @@ namespace Yavsc.Models
public DbSet DismissClicked { get; set; }
- [ActivitySettings]
public DbSet BrusherProfile { get; set; }
public DbSet BankIdentity { get; set; }
diff --git a/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs b/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs
index 798313a8..b2af663b 100644
--- a/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs
+++ b/src/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs
@@ -59,14 +59,14 @@ namespace Yavsc.Models.Billing
///
/// The performer identifier
///
- [ForeignKey("PerformerId"),Display(Name="Préstataire")]
+ [ForeignKey("PerformerId"),Display(Name="PerformerProfile")]
public PerformerProfile PerformerProfile { get; set; }
public DateTime? ValidationDate {get; set;}
- [Display(Name="Previsional")]
- public decimal? Previsional { get; set; }
+ [Display(Name="Provisional")]
+ public decimal? Provisional { get; set; }
///
/// The bill
///
@@ -82,7 +82,7 @@ namespace Yavsc.Models.Billing
public bool GetIsAcquitted()
{
- return Regularisation?.IsOk() ?? false;
+ return Regularization?.IsOk() ?? false;
}
public string GetFileBaseName(IBillingService billingService)
@@ -93,11 +93,11 @@ namespace Yavsc.Models.Billing
return $"facture-{bcode}-{Id}{ack}";
}
- [ForeignKey("Regularisation")]
+ [ForeignKey("Regularization")]
public string? PaymentId { get; set; }
[Display(Name = "Acquittement de la facture")]
- public virtual PayPalPayment Regularisation { get; set; }
+ public virtual PayPalPayment Regularization { get; set; }
}
}
diff --git a/src/Yavsc.Server/Models/HairCut/HairCutQuery.cs b/src/Yavsc.Server/Models/HairCut/HairCutQuery.cs
index c70afdf5..5aab5258 100644
--- a/src/Yavsc.Server/Models/HairCut/HairCutQuery.cs
+++ b/src/Yavsc.Server/Models/HairCut/HairCutQuery.cs
@@ -400,7 +400,7 @@ Prestation.Gender == HairCutGenders.Women ?
UserId = ClientId,
Avatar = Client.Avatar
},
- Previsional = Previsional,
+ Previsional = Provisional,
EventDate = EventDate,
Location = Location,
Id = Id,
diff --git a/src/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs b/src/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs
index 24714ee4..b68ed38b 100644
--- a/src/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs
+++ b/src/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs
@@ -8,33 +8,20 @@ using Yavsc.Billing;
namespace Yavsc.Models.Haircut
{
- public class HairPrestationCollectionItem {
-
- [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
- public long Id { get; set; }
- public long PrestationId { get; set; }
- [ForeignKeyAttribute("PrestationId")]
- public virtual HairPrestation Prestation { get; set; }
-
- public long QueryId { get; set; }
-
- [ForeignKeyAttribute("QueryId")]
- public virtual HairMultiCutQuery Query { get; set; }
- }
public class HairMultiCutQuery : NominativeServiceCommand
{
// Bill description
- string _customDescription = null;
- public override string Description
+ string _customDescription = null;
+ public override string Description
{
- get {
+ get {
return _customDescription ?? "Prestation en coiffure à domicile [commande groupée]" ;
}
set {
_customDescription = value;
}
- }
+ }
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
override public long Id { get; set; }
diff --git a/src/Yavsc.Server/Models/HairCut/HairPrestationCollectionItem.cs b/src/Yavsc.Server/Models/HairCut/HairPrestationCollectionItem.cs
new file mode 100644
index 00000000..0ce57278
--- /dev/null
+++ b/src/Yavsc.Server/Models/HairCut/HairPrestationCollectionItem.cs
@@ -0,0 +1,19 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Yavsc.Models.Haircut
+{
+ public class HairPrestationCollectionItem {
+
+ [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+ public long PrestationId { get; set; }
+ [ForeignKeyAttribute("PrestationId")]
+ public virtual HairPrestation Prestation { get; set; }
+
+ public long QueryId { get; set; }
+
+ [ForeignKeyAttribute("QueryId")]
+ public virtual HairMultiCutQuery Query { get; set; }
+ }
+}
diff --git a/src/Yavsc.Server/Services/BillingService.cs b/src/Yavsc.Server/Services/BillingService.cs
index 0738c57d..ad936176 100644
--- a/src/Yavsc.Server/Services/BillingService.cs
+++ b/src/Yavsc.Server/Services/BillingService.cs
@@ -12,6 +12,9 @@ namespace Yavsc.Services
new Dictionary>();
public static List UserSettings = new List();
+ ///
+ /// Mapping from activity codes to IUserSettings
+ ///
public static Dictionary GlobalBillingMap =
new Dictionary();
@@ -30,7 +33,12 @@ namespace Yavsc.Services
return Task.FromResult(GetBillable(DbContext, billingCode, queryId));
}
- public static IQuery GetBillable(ApplicationDbContext context, string billingCode, long queryId) => Billing[billingCode](context, queryId);
+ public static IQuery GetBillable(ApplicationDbContext context, string billingCode, long queryId)
+ {
+ throw new NotImplementedException();
+ }
+
+
public async Task GetPerformersSettingsAsync(string activityCode, string userId)
{
var activity = await DbContext.Activities.SingleAsync(a => a.Code == activityCode);
|