add metered products usage (#11452)

- add metered products usage module on settings/billing page
- add new resolver + logic with meter event data fetching from Stripe

<img width="590" alt="Screenshot 2025-04-08 at 16 34 07"
src="https://github.com/user-attachments/assets/34327af1-3482-4d61-91a6-e2dbaeb017ab"
/>
<img width="570" alt="Screenshot 2025-04-08 at 16 31 58"
src="https://github.com/user-attachments/assets/55aa221a-925f-48bf-88c4-f20713c79962"
/>

- bonus : disable subscription switch from yearly to monthly

closes https://github.com/twentyhq/core-team-issues/issues/681
This commit is contained in:
Etienne
2025-04-09 11:26:49 +02:00
committed by GitHub
parent b25ee28c12
commit 11fb8e0284
23 changed files with 570 additions and 139 deletions

View File

@ -337,12 +337,12 @@ describe('workspace permissions', () => {
});
describe('billing', () => {
describe('updateBillingSubscription', () => {
describe('switchToYearlyInterval', () => {
it('should throw a permission error when user does not have permission (member role)', async () => {
const queryData = {
query: `
mutation UpdateBillingSubscription {
updateBillingSubscription {
mutation SwitchToYearlyInterval {
switchToYearlyInterval {
success
}
}