Billing: Rename attributeVariants and contracts to vaributes
This commit is contained in:
@ -362,7 +362,7 @@ namespace Elwig.Helpers {
|
||||
return output.OrderByDescending(l => l.Count());
|
||||
}
|
||||
|
||||
public static List<string> GetAttributeVarieties(AppDbContext ctx, int year, bool withSlash = false, bool onlyDelivered = true) {
|
||||
public static List<string> GetVaributes(AppDbContext ctx, int year, bool withSlash = false, bool onlyDelivered = true) {
|
||||
var varieties = ctx.WineVarieties.Select(v => v.SortId).ToList();
|
||||
var delivered = ctx.DeliveryParts
|
||||
.Where(d => d.Year == year)
|
||||
@ -372,11 +372,11 @@ namespace Elwig.Helpers {
|
||||
return [.. (onlyDelivered ? delivered : delivered.Union(varieties)).Order()];
|
||||
}
|
||||
|
||||
public static List<ContractSelection> GetContractsForYear(AppDbContext ctx, int year, bool onlyDelivered = true) {
|
||||
public static List<Varibute> GetVaributesForYear(AppDbContext ctx, int year, bool onlyDelivered = true) {
|
||||
var varieties = ctx.WineVarieties.ToDictionary(v => v.SortId, v => v);
|
||||
var attributes = ctx.WineAttributes.ToDictionary(a => a.AttrId, a => a);
|
||||
return GetAttributeVarieties(ctx, year, false, onlyDelivered)
|
||||
.Select(s => new ContractSelection(varieties[s[..2]], s.Length > 2 ? attributes[s[2..]] : null))
|
||||
return GetVaributes(ctx, year, false, onlyDelivered)
|
||||
.Select(s => new Varibute(varieties[s[..2]], s.Length > 2 ? attributes[s[2..]] : null))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user