twenty/packages/twenty-server
Ana Sofia Marin Alexandre 11d244194f
Add billing tables (#8772)
Beforehand, the name of the branch is not representative of the work
that has been done in this PR

**TLDR:**

Solves https://github.com/twentyhq/private-issues/issues/192
Add 3 tables BillingCustomer, BillingProduct and BillingPrice and
BillingMeter to core, inspired by the Stripe implementation. Separates
migration, between common and billing on order to not populate the db of
the self-hosting instances with unused tables.

**In order to test:**

Run the command:
npx nx typeorm -- migration:run -d
src/database/typeorm/core/core.datasource.ts


**Considerations:**

I only put the information we should use right now in the Billing
module, for instance columns like meter or agreggation formula where
omitted in the creation of the tables.
These columns and other ones who fall on the same spectrum will be added
as we need them.

If you want to add more information to the table, I'll leave some
utility links down bellow:

- BillingPrices: https://docs.stripe.com/api/prices/object
- BillingCustomer: https://docs.stripe.com/api/customers/object
- BillingProduct:  https://docs.stripe.com/api/products/object

**Next Steps**

Use the Stripe Webhook in order to update the tables accordingly

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2024-12-05 16:17:35 +01:00
..
@types feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
patches Improve demo seed (#7125) 2024-09-18 17:35:08 +02:00
scripts Updated website docs and /twenty-server/.env (#8801) 2024-11-29 14:12:09 +01:00
src Add billing tables (#8772) 2024-12-05 16:17:35 +01:00
test/integration Add integration tests for /metadata + fix relation deletion (#8706) 2024-11-26 10:00:36 +01:00
.env.example feat(*): allow to select auth providers + add multiworkspace with subdomain management (#8656) 2024-12-03 19:06:28 +01:00
.env.test Updated website docs and /twenty-server/.env (#8801) 2024-11-29 14:12:09 +01:00
.eslintrc.cjs feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
.gitignore feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
.prettierignore Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.prettierrc Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.swcrc feat: twenty orm for standard and custom objects (#6178) 2024-07-19 18:23:52 +02:00
jest-integration.config.ts Integration test : Sync mode + db reset option + cleaning (#8376) 2024-11-07 17:22:47 +01:00
jest.config.ts Fix all broken CIs (#7439) 2024-10-05 00:23:23 +02:00
nest-cli.json 6653 serverless functions store and use environment variables in serverless function scripts (#7390) 2024-10-03 13:56:17 +02:00
package.json Bump 0.34.0-canary (#8675) 2024-11-22 11:53:33 +01:00
project.json Integration test : Sync mode + db reset option + cleaning (#8376) 2024-11-07 17:22:47 +01:00
tsconfig.build.json chore: set up twenty-emails config so build isn't needed in development (#3619) 2024-01-29 06:17:12 -03:00
tsconfig.json feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
tsconfig.scripts.json feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00