hcb
hcb copied to clipboard
Invoice: Fix state management
We're currently using AASM, a status enum, and a handful of timestamp columns (e.g. archived_at) to manage the state of an invoice. This is too much!
Here's what we need to do.
- Fully build out the AASM states for Invoice so that it can handle all states
- Write a migration script that will update
aasm_statewith the correct state. It will become the one source of truth - Remove the
statusenum and clean up unused or old scopes and state-related methods
warning: this is a fairly difficult ticket! take it on if you're looking for a challenge
A couple of notes:
- Let's drop support for
draftinvoices and delete them from the database. StuTech no longer operates and SacHacks seems to - Let's add a
archived_v2state to AASM - We also need to handle a
deposited_v2state to AASM
I'm going to take a crack at this
happy to report that after doing some research it looks like there are not any draft invoices.
just gonna turn gary's list of things into a task list for my adhd:
- [x] Fully build out the AASM states for Invoice so that it can handle all states (#11254)
- [ ] Write a migration script that will update aasm_state with the correct state. It will become the one source of truth (#11847)
- [ ] Remove the status enum and clean up unused or old scopes and state-related methods