feat(pricing/ai): improve billing metered pricing + add pricing on ai chat (#14092)

## TODO:

- [x] display "yearly" or "monthly" wording everywhere it's needed
- [ ] Add button with "downgrade" or "upgrade" to save the change of
credits price + modal to validate
- [x] Add renewal date 
- [ ] Implement
https://docs.stripe.com/billing/subscriptions/subscription-schedules for
`switchFromYearlyToMonthly` and decrease number of credits
This commit is contained in:
Antoine Moreaux
2025-08-29 18:23:07 +02:00
committed by GitHub
parent 7df9094939
commit 1c4568c8b1
45 changed files with 2048 additions and 327 deletions
@@ -21,10 +21,9 @@ export const getDeletedStripeSubscriptionItemIdsFromStripeSubscriptionEvent = (
const subscriptionItemIds =
event.data.object.items.data.map((item) => item.id) ?? [];
const deletedSubscriptionItemIds =
return (
event.data.previous_attributes?.items?.data
.filter((item) => !subscriptionItemIds.includes(item.id))
.map((item) => item.id) ?? [];
return deletedSubscriptionItemIds;
.map((item) => item.id) ?? []
);
};