savoirfairelinux / sous-chef

Sous-Chef is a web application to help organizations to plan and deliver meals, and to manage clients files.
GNU Affero General Public License v3.0
67 stars 45 forks source link

Get rid of the batch jobs #831

Open kousu opened 6 years ago

kousu commented 6 years ago

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.