Models: Remove DeliveryPartAttr

This commit is contained in:
2023-10-31 22:21:24 +01:00
parent b1dad261d1
commit ad9f4d3a9a
12 changed files with 172 additions and 104 deletions

View File

@ -11,14 +11,14 @@ namespace Elwig.Helpers.Billing {
protected readonly AppDbContext Context;
protected readonly Dictionary<string, string> Attributes;
protected readonly Dictionary<string, (decimal?, decimal?)> Modifiers;
protected readonly Dictionary<string, (string, string?, string?, string?, int?, int?, decimal?)> AreaComTypes;
protected readonly Dictionary<string, (string, string?, string?, int?, int?, decimal?)> AreaComTypes;
public Billing(int year) {
Year = year;
Context = new AppDbContext();
Attributes = Context.WineAttributes.ToDictionary(a => a.AttrId, a => a.Name);
Modifiers = Context.Modifiers.Where(m => m.Year == Year).ToDictionary(m => m.ModId, m => (m.Abs, m.Rel));
AreaComTypes = Context.AreaCommitmentTypes.ToDictionary(v => v.VtrgId, v => (v.SortId, v.AttrId1, v.AttrId2, v.Discriminator, v.MinKgPerHa, v.MaxKgPerHa, v.PenaltyAmount));
AreaComTypes = Context.AreaCommitmentTypes.ToDictionary(v => v.VtrgId, v => (v.SortId, v.AttrId, v.Discriminator, v.MinKgPerHa, v.MaxKgPerHa, v.PenaltyAmount));
}
public async Task FinishSeason() {