DeliveryService: Add modifiers when splitting delivery parts
All checks were successful
Test / Run tests (push) Successful in 2m31s

This commit is contained in:
2025-12-18 18:12:14 +01:00
parent 5cec5b3556
commit da05a49e10

View File

@@ -595,6 +595,13 @@ namespace Elwig.Services {
s.DPNr = dpnr++; s.DPNr = dpnr++;
s.Weight = w; s.Weight = w;
ctx.Add(s); ctx.Add(s);
ctx.AddRange(p.PartModifiers.Select(m => new DeliveryPartModifier() {
Year = s.Year,
DId = s.DId,
DPNr = s.DPNr,
ModId = m.ModId,
}));
} }
} }
@@ -632,6 +639,13 @@ namespace Elwig.Services {
s.DPNr = dpnr++; s.DPNr = dpnr++;
s.Weight = w; s.Weight = w;
ctx.Add(s); ctx.Add(s);
ctx.AddRange(p.PartModifiers.Select(m => new DeliveryPartModifier() {
Year = s.Year,
DId = s.DId,
DPNr = s.DPNr,
ModId = m.ModId,
}));
} }
} }
@@ -666,6 +680,13 @@ namespace Elwig.Services {
n.QualId = "WEI"; n.QualId = "WEI";
n.HkId = "OEST"; n.HkId = "OEST";
ctx.Add(n); ctx.Add(n);
ctx.AddRange(p.PartModifiers.Select(m => new DeliveryPartModifier() {
Year = n.Year,
DId = n.DId,
DPNr = n.DPNr,
ModId = m.ModId,
}));
} }
} }
await ctx.SaveChangesAsync(); await ctx.SaveChangesAsync();