- Shipped
- 12 Agosti 2026, 02:25 UTC
- Author
- Kamo
- Commit
- cdda464
Cancel no longer takes an "immediate" flag, and no customer-facing route can ask for one. Passing it true ended the subscription the same day while asking Stripe for no proration, so the organization lost the remainder of a period it had already paid for and was refunded nothing. Somebody who cancels on day two of a month has bought that month; the software is theirs until it ends. cancel(UUID) now only sets cancel_at_period_end. Status stays ACTIVE, so every "is this live" check in the platform keeps saying yes and licences are deliberately NOT rebalanced — Stripe fires customer.subscription.deleted when the period actually ends and StripeWebhookService lapses them then, which is the correct moment rather than this one. terminateNow(UUID) keeps the immediate path under its own name for the one place it belongs: DunningSweep, after thirty days delinquent, where there is no paid period left to honour. Naming it separately is what stops it being reached by a caller who meant "stop billing me". Its ordering bug is fixed. Licences are now lapsed BEFORE the fall back to Free, while the row still says CANCELED. It used to happen the other way round: fallbackToFree rewrote the row to ACTIVE / FREE / seatCount 1, and the rebalance then took the over-capacity branch instead of the lapsed one — a 25-seat organization ended with exactly one person still working and 24 told their seat was cut because "Seat count reduced below assigned count", a reduction nobody made. If the market had no active FREE plan, fallbackToFree returned early and every licence lapsed instead: one path, two completely different outcomes depending on catalogue data. Lapsing first makes them identical and the recorded reason true. Group cancellation follows the same promise — the roster is left alone, so its people keep their seats until the period ends. Deleting a group now accepts a subscription that is merely winding down; requiring a fully CANCELED status meant "cancel, then delete" was refused for up to a month with nothing explaining the wait.