feat(contracts): add weekly and bi-weekly billing cycles (PMS-404) #308
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-404-weekly-biweekly-billing-cycles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
weeklyandbi_weeklyto the contractbilling_cycleclosed set end to end (PMS-404). Migration 061 drops and re-adds thecontracts_billing_cycle_checkconstraint to the six-value set;BILLING_CYCLESis widened so the request layer returns a clean 422 for a bad cycle instead of a 500. Both start_date-anchored period calculators (period_forfor hour-balance windows andcurrent_billing_periodfor recurring-invoice anchors) now share aCycleStepenum that steps sub-month cycles by whole days (7/14 via chrono::Days) and longer cycles by months (chrono::Months, keeping end-of-month clamping); the recurring sweep already excludes onlyone_timeso weekly/bi_weekly contracts are swept automatically. New contracts integration tests confirm the DB constraint accepts the cycles and hour balances bucket into contiguous 7-day and 14-day windows.#PMS-404