2 ms·
> If there can be orderItems without invoice (why would that happen?) Because people mess up... In this case they'd then fix the missing invoice references pos
by magicalhippo 5y ago
> If there can be orderItems without invoice (why would that happen?)
Because people mess up... In this case they'd then fix the missing invoice references post-consolidation.
Stuff like this usually happens either due to stress, lack of experience or training (summer temps are a menace) or just negligence.
In addition to our consolidation procedure, I've naturally had to write a procedure to undo the consolidation.
> then I'd just add another field "plainOrderItems: List[OrderItem]" next to the bundles.
That could work, would be more tedious when you want to operate over all items (we do this fairly often), but not terribly so.
- valenterry 5y agoOkay, interesting. > That could work, would be more tedious when you want to operate over all items (we do this fairly often), but not terribly so. Hm, not really. I've updated the code with a convenience method to see how it feels and I don't think it impacts the ergonomics at all: https://scastie.scala-lang.org/QG1VYuFBQ4qRwfJSjq7bjA https://scastie.scala-lang.org/QG1VYuFBQ4qRwfJSjq7bjA