Sous-Chef's reliance on batch-jobs for proper functioning makes it fragile. I propose that a lot of the core logic needs to be rethought in a functional programming style, and the batch jobs done away with.
Instead of having a bunch of states that orders flow through, there should be; especially, billing should not be done based on "delivered" orders (especially since we don't actually know what orders got delivered on any particular day), billing should be calculated by summing --- functionally --- all orders from the requested month not marked cancelled or no-charge.
For that matter, order.state should dropped and replaced with bool order.cancelled and bool order.no_charge -- separately flags, only ever set manually.
Instead of scheduled client status changes that need to be flipped overnight, there should be regions of client status -- the way iCal works -- and these statuses should be viewable on a calendar. Actually, can we just use a calendar directly? Is CalDAV exposable to django somehow?
probably a bunch of other things.
This would be a pretty sharp rewrite, so I'm recording it here for planning purposes.
Sous-Chef's reliance on batch-jobs for proper functioning makes it fragile. I propose that a lot of the core logic needs to be rethought in a functional programming style, and the batch jobs done away with.
Instead of having a bunch of states that orders flow through, there should be; especially, billing should not be done based on "delivered" orders (especially since we don't actually know what orders got delivered on any particular day), billing should be calculated by summing --- functionally --- all orders from the requested month not marked cancelled or no-charge. For that matter,
order.state
should dropped and replaced withbool order.cancelled
andbool order.no_charge
-- separately flags, only ever set manually. Instead of scheduled client status changes that need to be flipped overnight, there should be regions of client status -- the way iCal works -- and these statuses should be viewable on a calendar. Actually, can we just use a calendar directly? Is CalDAV exposable to django somehow? probably a bunch of other things.This would be a pretty sharp rewrite, so I'm recording it here for planning purposes.