Update billing to EE (#10060)
Doesn't make sense to have billing under GPL since it's only used for our cloud and not by self-hosters
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Controller,
|
Controller,
|
||||||
Headers,
|
Headers,
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { UseGuards } from '@nestjs/common';
|
import { UseGuards } from '@nestjs/common';
|
||||||
import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
|
import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
import { Command } from 'nest-commander';
|
import { Command } from 'nest-commander';
|
||||||
|
|||||||
@ -1 +1,3 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export const BILLING_FEATURE_USED = 'BILLING_FEATURE_USED';
|
export const BILLING_FEATURE_USED = 'BILLING_FEATURE_USED';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
|
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { BillingPriceTierDTO } from 'src/engine/core-modules/billing/dtos/billing-price-tier.dto';
|
import { BillingPriceTierDTO } from 'src/engine/core-modules/billing/dtos/billing-price-tier.dto';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { createUnionType } from '@nestjs/graphql';
|
import { createUnionType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { BillingPriceLicensedDTO } from 'src/engine/core-modules/billing/dtos/billing-price-licensed.dto';
|
import { BillingPriceLicensedDTO } from 'src/engine/core-modules/billing/dtos/billing-price-licensed.dto';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { BillingPriceLicensedDTO } from 'src/engine/core-modules/billing/dtos/billing-price-licensed.dto';
|
import { BillingPriceLicensedDTO } from 'src/engine/core-modules/billing/dtos/billing-price-licensed.dto';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { Min } from 'class-validator';
|
import { Min } from 'class-validator';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { ArgsType, Field } from '@nestjs/graphql';
|
import { ArgsType, Field } from '@nestjs/graphql';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { ArgsType, Field } from '@nestjs/graphql';
|
import { ArgsType, Field } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { IsNotEmpty, IsString } from 'class-validator';
|
import { IsNotEmpty, IsString } from 'class-validator';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { ArgsType, Field } from '@nestjs/graphql';
|
import { ArgsType, Field } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { IsOptional, IsString } from 'class-validator';
|
import { IsOptional, IsString } from 'class-validator';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { BillingProductDTO } from 'src/engine/core-modules/billing/dtos/billing-product.dto';
|
import { BillingProductDTO } from 'src/engine/core-modules/billing/dtos/billing-product.dto';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, Int, ObjectType } from '@nestjs/graphql';
|
import { Field, Int, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { BillingProductPriceDTO } from 'src/engine/core-modules/billing/dtos/billing-product-price.dto';
|
import { BillingProductPriceDTO } from 'src/engine/core-modules/billing/dtos/billing-product-price.dto';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { ObjectType } from '@nestjs/graphql';
|
import { ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
import {
|
import {
|
||||||
Column,
|
Column,
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field } from '@nestjs/graphql';
|
import { Field } from '@nestjs/graphql';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { registerEnumType } from '@nestjs/graphql';
|
import { registerEnumType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
import {
|
import {
|
||||||
Column,
|
Column,
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
|
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
import { IDField } from '@ptc-org/nestjs-query-graphql';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum AvailableProduct {
|
export enum AvailableProduct {
|
||||||
BasePlan = 'base-plan',
|
BasePlan = 'base-plan',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingEntitlementKey {
|
export enum BillingEntitlementKey {
|
||||||
SSO = 'SSO',
|
SSO = 'SSO',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingMeterEventName {
|
export enum BillingMeterEventName {
|
||||||
WORKFLOW_NODE_RUN = 'WORKFLOW_NODE_RUN',
|
WORKFLOW_NODE_RUN = 'WORKFLOW_NODE_RUN',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingMeterEventTimeWindow {
|
export enum BillingMeterEventTimeWindow {
|
||||||
DAY = 'DAY',
|
DAY = 'DAY',
|
||||||
HOUR = 'HOUR',
|
HOUR = 'HOUR',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingMeterStatus {
|
export enum BillingMeterStatus {
|
||||||
ACTIVE = 'ACTIVE',
|
ACTIVE = 'ACTIVE',
|
||||||
INACTIVE = 'INACTIVE',
|
INACTIVE = 'INACTIVE',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { registerEnumType } from '@nestjs/graphql';
|
import { registerEnumType } from '@nestjs/graphql';
|
||||||
|
|
||||||
export enum BillingPlanKey {
|
export enum BillingPlanKey {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingPriceBillingScheme {
|
export enum BillingPriceBillingScheme {
|
||||||
PER_UNIT = 'PER_UNIT',
|
PER_UNIT = 'PER_UNIT',
|
||||||
TIERED = 'TIERED',
|
TIERED = 'TIERED',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingPriceTaxBehavior {
|
export enum BillingPriceTaxBehavior {
|
||||||
EXCLUSIVE = 'EXCLUSIVE',
|
EXCLUSIVE = 'EXCLUSIVE',
|
||||||
INCLUSIVE = 'INCLUSIVE',
|
INCLUSIVE = 'INCLUSIVE',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { registerEnumType } from '@nestjs/graphql';
|
import { registerEnumType } from '@nestjs/graphql';
|
||||||
|
|
||||||
export enum BillingPriceTiersMode {
|
export enum BillingPriceTiersMode {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingPriceType {
|
export enum BillingPriceType {
|
||||||
ONE_TIME = 'ONE_TIME',
|
ONE_TIME = 'ONE_TIME',
|
||||||
RECURRING = 'RECURRING',
|
RECURRING = 'RECURRING',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingSubscriptionCollectionMethod {
|
export enum BillingSubscriptionCollectionMethod {
|
||||||
CHARGE_AUTOMATICALLY = 'CHARGE_AUTOMATICALLY',
|
CHARGE_AUTOMATICALLY = 'CHARGE_AUTOMATICALLY',
|
||||||
SEND_INVOICE = 'SEND_INVOICE',
|
SEND_INVOICE = 'SEND_INVOICE',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum SubscriptionInterval {
|
export enum SubscriptionInterval {
|
||||||
Day = 'day',
|
Day = 'day',
|
||||||
Month = 'month',
|
Month = 'month',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum SubscriptionStatus {
|
export enum SubscriptionStatus {
|
||||||
Active = 'active',
|
Active = 'active',
|
||||||
Canceled = 'canceled',
|
Canceled = 'canceled',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingUsageType {
|
export enum BillingUsageType {
|
||||||
METERED = 'METERED',
|
METERED = 'METERED',
|
||||||
LICENSED = 'LICENSED',
|
LICENSED = 'LICENSED',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
export enum BillingWebhookEvent {
|
export enum BillingWebhookEvent {
|
||||||
CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created',
|
CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created',
|
||||||
CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated',
|
CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated',
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { ArgumentsHost, Catch, ExceptionFilter } from '@nestjs/common';
|
import { ArgumentsHost, Catch, ExceptionFilter } from '@nestjs/common';
|
||||||
|
|
||||||
import { Response } from 'express';
|
import { Response } from 'express';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Logger, Scope } from '@nestjs/common';
|
import { Logger, Scope } from '@nestjs/common';
|
||||||
|
|
||||||
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
|
import { BillingSubscriptionService } from 'src/engine/core-modules/billing/services/billing-subscription.service';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import { OnCustomBatchEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-custom-batch-event.decorator';
|
import { OnCustomBatchEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-custom-batch-event.decorator';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import { OnDatabaseBatchEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-database-batch-event.decorator';
|
import { OnDatabaseBatchEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-database-batch-event.decorator';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
@ -14,11 +16,11 @@ import { StripeBillingPortalService } from 'src/engine/core-modules/billing/stri
|
|||||||
import { StripeCheckoutService } from 'src/engine/core-modules/billing/stripe/services/stripe-checkout.service';
|
import { StripeCheckoutService } from 'src/engine/core-modules/billing/stripe/services/stripe-checkout.service';
|
||||||
import { BillingGetPricesPerPlanResult } from 'src/engine/core-modules/billing/types/billing-get-prices-per-plan-result.type';
|
import { BillingGetPricesPerPlanResult } from 'src/engine/core-modules/billing/types/billing-get-prices-per-plan-result.type';
|
||||||
import { BillingPortalCheckoutSessionParameters } from 'src/engine/core-modules/billing/types/billing-portal-checkout-session-parameters.type';
|
import { BillingPortalCheckoutSessionParameters } from 'src/engine/core-modules/billing/types/billing-portal-checkout-session-parameters.type';
|
||||||
|
import { DomainManagerService } from 'src/engine/core-modules/domain-manager/services/domain-manager.service';
|
||||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
import { DomainManagerService } from 'src/engine/core-modules/domain-manager/services/domain-manager.service';
|
|
||||||
import { assert } from 'src/utils/assert';
|
import { assert } from 'src/utils/assert';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
export class StripeSDKMock {
|
export class StripeSDKMock {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
|
|
||||||
import { StripeSDKService } from 'src/engine/core-modules/billing/stripe/stripe-sdk/services/stripe-sdk.service';
|
import { StripeSDKService } from 'src/engine/core-modules/billing/stripe/stripe-sdk/services/stripe-sdk.service';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
|
|
||||||
import { StripeBillingMeterEventService } from 'src/engine/core-modules/billing/stripe/services/stripe-billing-meter-event.service';
|
import { StripeBillingMeterEventService } from 'src/engine/core-modules/billing/stripe/services/stripe-billing-meter-event.service';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingProduct } from 'src/engine/core-modules/billing/entities/billing-product.entity';
|
import { BillingProduct } from 'src/engine/core-modules/billing/entities/billing-product.entity';
|
||||||
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingPrice } from 'src/engine/core-modules/billing/entities/billing-price.entity';
|
import { BillingPrice } from 'src/engine/core-modules/billing/entities/billing-price.entity';
|
||||||
|
|
||||||
export type BillingGetPricesPerPlanResult = {
|
export type BillingGetPricesPerPlanResult = {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
||||||
import { BillingGetPricesPerPlanResult } from 'src/engine/core-modules/billing/types/billing-get-prices-per-plan-result.type';
|
import { BillingGetPricesPerPlanResult } from 'src/engine/core-modules/billing/types/billing-get-prices-per-plan-result.type';
|
||||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
||||||
import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';
|
import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { NonNegative } from 'type-fest';
|
import { NonNegative } from 'type-fest';
|
||||||
|
|
||||||
import { BillingMeterEventName } from 'src/engine/core-modules/billing/enums/billing-meter-event-names';
|
import { BillingMeterEventName } from 'src/engine/core-modules/billing/enums/billing-meter-event-names';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
||||||
import { BillingPriceTiersMode } from 'src/engine/core-modules/billing/enums/billing-price-tiers-mode.enum';
|
import { BillingPriceTiersMode } from 'src/engine/core-modules/billing/enums/billing-price-tiers-mode.enum';
|
||||||
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
|
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingMeterEventTimeWindow } from 'src/engine/core-modules/billing/enums/billing-meter-event-time-window.enum';
|
import { BillingMeterEventTimeWindow } from 'src/engine/core-modules/billing/enums/billing-meter-event-time-window.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { transformStripeProductToDatabaseProduct } from 'src/engine/core-modules/billing/utils/transform-stripe-product-to-database-product.util';
|
import { transformStripeProductToDatabaseProduct } from 'src/engine/core-modules/billing/utils/transform-stripe-product-to-database-product.util';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingPriceLicensedDTO } from 'src/engine/core-modules/billing/dtos/billing-price-licensed.dto';
|
import { BillingPriceLicensedDTO } from 'src/engine/core-modules/billing/dtos/billing-price-licensed.dto';
|
||||||
import { BillingPriceMeteredDTO } from 'src/engine/core-modules/billing/dtos/billing-price-metered.dto';
|
import { BillingPriceMeteredDTO } from 'src/engine/core-modules/billing/dtos/billing-price-metered.dto';
|
||||||
import { BillingPlanOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-plan.output';
|
import { BillingPlanOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-plan.output';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingMeterEventTimeWindow } from 'src/engine/core-modules/billing/enums/billing-meter-event-time-window.enum';
|
import { BillingMeterEventTimeWindow } from 'src/engine/core-modules/billing/enums/billing-meter-event-time-window.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
export const transformStripeProductToDatabaseProduct = (
|
export const transformStripeProductToDatabaseProduct = (
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingEntitlementKey } from 'src/engine/core-modules/billing/enums/billing-entitlement-key.enum';
|
import { BillingEntitlementKey } from 'src/engine/core-modules/billing/enums/billing-entitlement-key.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
||||||
import { BillingPriceTaxBehavior } from 'src/engine/core-modules/billing/enums/billing-price-tax-behavior.enum';
|
import { BillingPriceTaxBehavior } from 'src/engine/core-modules/billing/enums/billing-price-tax-behavior.enum';
|
||||||
import { BillingPriceTiersMode } from 'src/engine/core-modules/billing/enums/billing-price-tiers-mode.enum';
|
import { BillingPriceTiersMode } from 'src/engine/core-modules/billing/enums/billing-price-tiers-mode.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { transformStripeProductEventToDatabaseProduct } from 'src/engine/core-modules/billing/webhooks/utils/transform-stripe-product-event-to-database-product.util';
|
import { transformStripeProductEventToDatabaseProduct } from 'src/engine/core-modules/billing/webhooks/utils/transform-stripe-product-event-to-database-product.util';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { transformStripeSubscriptionEventToDatabaseCustomer } from 'src/engine/core-modules/billing/webhooks/utils/transform-stripe-subscription-event-to-database-customer.util';
|
import { transformStripeSubscriptionEventToDatabaseCustomer } from 'src/engine/core-modules/billing/webhooks/utils/transform-stripe-subscription-event-to-database-customer.util';
|
||||||
describe('transformStripeSubscriptionEventToDatabaseCustomer', () => {
|
describe('transformStripeSubscriptionEventToDatabaseCustomer', () => {
|
||||||
const mockWorkspaceId = 'workspace_123';
|
const mockWorkspaceId = 'workspace_123';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import { BillingSubscriptionCollectionMethod } from 'src/engine/core-modules/billing/enums/billing-subscription-collection-method.enum';
|
import { BillingSubscriptionCollectionMethod } from 'src/engine/core-modules/billing/enums/billing-subscription-collection-method.enum';
|
||||||
import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';
|
import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';
|
||||||
import { transformStripeSubscriptionEventToDatabaseSubscription } from 'src/engine/core-modules/billing/webhooks/utils/transform-stripe-subscription-event-to-database-subscription.util';
|
import { transformStripeSubscriptionEventToDatabaseSubscription } from 'src/engine/core-modules/billing/webhooks/utils/transform-stripe-subscription-event-to-database-subscription.util';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingEntitlementKey } from 'src/engine/core-modules/billing/enums/billing-entitlement-key.enum';
|
import { BillingEntitlementKey } from 'src/engine/core-modules/billing/enums/billing-entitlement-key.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
import { BillingPriceBillingScheme } from 'src/engine/core-modules/billing/enums/billing-price-billing-scheme.enum';
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
export const transformStripeProductEventToDatabaseProduct = (
|
export const transformStripeProductEventToDatabaseProduct = (
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
export const transformStripeSubscriptionEventToDatabaseCustomer = (
|
export const transformStripeSubscriptionEventToDatabaseCustomer = (
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
export const transformStripeSubscriptionEventToDatabaseSubscriptionItem = (
|
export const transformStripeSubscriptionEventToDatabaseSubscriptionItem = (
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* @license Enterprise */
|
||||||
|
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { BillingSubscriptionCollectionMethod } from 'src/engine/core-modules/billing/enums/billing-subscription-collection-method.enum';
|
import { BillingSubscriptionCollectionMethod } from 'src/engine/core-modules/billing/enums/billing-subscription-collection-method.enum';
|
||||||
|
|||||||
Reference in New Issue
Block a user