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>
This commit is contained in:
committed by
GitHub
parent
c993f2de0b
commit
11d244194f
@ -24,11 +24,11 @@ import { LLMTracingDriver } from 'src/engine/core-modules/llm-tracing/interfaces
|
||||
|
||||
import { CacheStorageType } from 'src/engine/core-modules/cache-storage/types/cache-storage-type.enum';
|
||||
import { CaptchaDriverType } from 'src/engine/core-modules/captcha/interfaces';
|
||||
import { AssertOrWarn } from 'src/engine/core-modules/environment/decorators/assert-or-warn.decorator';
|
||||
import { CastToBoolean } from 'src/engine/core-modules/environment/decorators/cast-to-boolean.decorator';
|
||||
import { CastToLogLevelArray } from 'src/engine/core-modules/environment/decorators/cast-to-log-level-array.decorator';
|
||||
import { CastToPositiveNumber } from 'src/engine/core-modules/environment/decorators/cast-to-positive-number.decorator';
|
||||
import { CastToStringArray } from 'src/engine/core-modules/environment/decorators/cast-to-string-array.decorator';
|
||||
import { AssertOrWarn } from 'src/engine/core-modules/environment/decorators/assert-or-warn.decorator';
|
||||
import { IsAWSRegion } from 'src/engine/core-modules/environment/decorators/is-aws-region.decorator';
|
||||
import { IsDuration } from 'src/engine/core-modules/environment/decorators/is-duration.decorator';
|
||||
import { IsStrictlyLowerThan } from 'src/engine/core-modules/environment/decorators/is-strictly-lower-than.decorator';
|
||||
|
||||
Reference in New Issue
Block a user