add billing threshold + specific trial free credits (#11533)
In this PR : - set billing thresholds after subscription creation (not possible during billing checkout) - add specific free trial workflow credit quantities + set them in subscription item + check them when receiving stripe alert event closes : https://github.com/twentyhq/core-team-issues/issues/682
This commit is contained in:
@ -509,6 +509,33 @@ export class ConfigVariables {
|
||||
@ValidateIf((env) => env.IS_BILLING_ENABLED === true)
|
||||
BILLING_FREE_TRIAL_WITHOUT_CREDIT_CARD_DURATION_IN_DAYS = 7;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.BillingConfig,
|
||||
description: 'Amount of money in cents to trigger a billing threshold',
|
||||
})
|
||||
@IsNumber()
|
||||
@CastToPositiveNumber()
|
||||
@ValidateIf((env) => env.IS_BILLING_ENABLED === true)
|
||||
BILLING_SUBSCRIPTION_THRESHOLD_AMOUNT = 10000;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.BillingConfig,
|
||||
description: 'Amount of credits for the free trial without credit card',
|
||||
})
|
||||
@IsNumber()
|
||||
@CastToPositiveNumber()
|
||||
@ValidateIf((env) => env.IS_BILLING_ENABLED === true)
|
||||
BILLING_FREE_WORKFLOW_CREDITS_FOR_TRIAL_PERIOD_WITHOUT_CREDIT_CARD = 5000;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.BillingConfig,
|
||||
description: 'Amount of credits for the free trial with credit card',
|
||||
})
|
||||
@IsNumber()
|
||||
@CastToPositiveNumber()
|
||||
@ValidateIf((env) => env.IS_BILLING_ENABLED === true)
|
||||
BILLING_FREE_WORKFLOW_CREDITS_FOR_TRIAL_PERIOD_WITH_CREDIT_CARD = 10000;
|
||||
|
||||
@ConfigVariablesMetadata({
|
||||
group: ConfigVariablesGroup.BillingConfig,
|
||||
isSensitive: true,
|
||||
|
||||
Reference in New Issue
Block a user