ZIm/crates/collab/src/db
Marshall Bowers a4dd92fe06
collab: Prevent users from creating a new subscription when they have overdue subscriptions (#22870)
This PR adjusts the create billing subscription endpoint to prevent
initiating a checkout flow when a user has existing subscriptions that
are overdue.

A subscription is considered "overdue" when either:

- The status is `past_due`
- The status is `canceled` and the cancellation reason is
`payment_failed`

In Stripe, when a subscription has failed payment a certain number of
times, it is canceled with a reason of `payment_failed`. However, today
there is nothing stopping someone from simply creating a new
subscription without paying the outstanding invoices. With this change a
user will need to reconcile their outstanding invoices before they can
sign up for a new subscription.

Release Notes:

- N/A
2025-01-08 22:50:48 +00:00
..
queries collab: Prevent users from creating a new subscription when they have overdue subscriptions (#22870) 2025-01-08 22:50:48 +00:00
tables collab: Record cancellation reason on billing subscriptions (#22853) 2025-01-08 19:38:10 +00:00
tests collab: Prevent users from creating a new subscription when they have overdue subscriptions (#22870) 2025-01-08 22:50:48 +00:00
ids.rs Remove dev servers (#19638) 2024-10-24 12:14:03 -06:00
queries.rs Remove hosted projects (#19754) 2024-10-27 19:44:21 -07:00
tables.rs Remove hosted projects (#19754) 2024-10-27 19:44:21 -07:00
tests.rs assistant: Require user to accept TOS for cloud provider (#16111) 2024-08-12 17:43:35 +02:00