Solves: https://github.com/twentyhq/core-team-issues/issues/527 **TLDR:** Basically the title. Fetches the product and prices from the database instead of the environment variables. **What this means:** - new subscriptions in twenty will be hybrid (per seat subscription plus an usage base product) - right now the price for the usage base product is 0$ per unit - The existing subscription will work normally, however we will need to update their subscription items in order to contain the usage base product (remember that the pricing intervals like monthly or yearly should match in all the subscription items) - The previous point can be done using Stripe Postman **In order to test:** - Have the environment variable IS_BILLING_ENABLED set to true and add the other required environment variables for Billing to work - Do a database reset (to ensure that the new feature flag is deleted and that the billing tables are created) - Run the command: npx nx run twenty-server:command billing:sync-plans-data (if you don't do that the products and prices will not be present in the database) - Run the server , the frontend, the worker, and the stripe listen command (stripe listen --forward-to http://localhost:3000/billing/webhooks) - Buy a subscription for acme workspace - Update the quantity of members in a workspace (add or delete) - Change the subscription interval --------- Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
Run yarn dev while server running on port 3000