@natrave/shared-entities 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/billing-accounts/billing-account.entity.d.ts +17 -4
- package/dist/billing/billing-accounts/billing-account.entity.d.ts.map +1 -1
- package/dist/billing/billing-accounts/billing-account.entity.js +128 -16
- package/dist/billing/billing-accounts/enums/billing-account-billable-entity-type.enum.d.ts +4 -0
- package/dist/billing/billing-accounts/enums/billing-account-billable-entity-type.enum.d.ts.map +1 -0
- package/dist/billing/billing-accounts/enums/billing-account-billable-entity-type.enum.js +7 -0
- package/dist/billing/billing-accounts/enums/billing-person-type.enum.d.ts +5 -0
- package/dist/billing/billing-accounts/enums/billing-person-type.enum.d.ts.map +1 -0
- package/dist/billing/billing-accounts/enums/billing-person-type.enum.js +8 -0
- package/dist/billing/billing-accounts/index.d.ts +2 -1
- package/dist/billing/billing-accounts/index.d.ts.map +1 -1
- package/dist/billing/billing-accounts/index.js +2 -1
- package/dist/billing/{billing-prices/billing-price.entity.d.ts → billing-plans/billing-plan.entity.d.ts} +5 -13
- package/dist/billing/billing-plans/billing-plan.entity.d.ts.map +1 -0
- package/dist/billing/billing-plans/billing-plan.entity.js +145 -0
- package/dist/billing/billing-plans/enums/charge-type.enum.d.ts +5 -0
- package/dist/billing/billing-plans/enums/charge-type.enum.d.ts.map +1 -0
- package/dist/billing/billing-plans/enums/charge-type.enum.js +8 -0
- package/dist/billing/billing-plans/enums/pricing-model.enum.d.ts +5 -0
- package/dist/billing/billing-plans/enums/pricing-model.enum.d.ts.map +1 -0
- package/dist/billing/{billing-prices → billing-plans}/enums/pricing-model.enum.js +0 -1
- package/dist/billing/billing-plans/enums/recurring-interval.enum.d.ts.map +1 -0
- package/dist/billing/billing-plans/index.d.ts +5 -0
- package/dist/billing/billing-plans/index.d.ts.map +1 -0
- package/dist/billing/billing-plans/index.js +4 -0
- package/dist/billing/billing-products/billing-product.entity.d.ts +4 -4
- package/dist/billing/billing-products/billing-product.entity.d.ts.map +1 -1
- package/dist/billing/billing-products/billing-product.entity.js +9 -8
- package/dist/billing/billing-products/enums/billing-product-key.constant.d.ts +6 -0
- package/dist/billing/billing-products/enums/billing-product-key.constant.d.ts.map +1 -0
- package/dist/billing/billing-products/enums/{billing-product-code.constant.js → billing-product-key.constant.js} +2 -2
- package/dist/billing/billing-products/index.d.ts +1 -1
- package/dist/billing/billing-products/index.d.ts.map +1 -1
- package/dist/billing/billing-products/index.js +1 -1
- package/dist/billing/billing-subscription-items/billing-subscription-item.entity.d.ts +3 -3
- package/dist/billing/billing-subscription-items/billing-subscription-item.entity.d.ts.map +1 -1
- package/dist/billing/billing-subscription-items/billing-subscription-item.entity.js +12 -10
- package/dist/billing/billing-subscriptions/billing-subscription.entity.d.ts +3 -3
- package/dist/billing/billing-subscriptions/billing-subscription.entity.d.ts.map +1 -1
- package/dist/billing/billing-subscriptions/billing-subscription.entity.js +11 -11
- package/dist/billing/billing-subscriptions/enums/billing-subject-entity-type.enum.d.ts +4 -0
- package/dist/billing/billing-subscriptions/enums/billing-subject-entity-type.enum.d.ts.map +1 -0
- package/dist/billing/billing-subscriptions/enums/billing-subject-entity-type.enum.js +7 -0
- package/dist/billing/billing-subscriptions/index.d.ts +1 -1
- package/dist/billing/billing-subscriptions/index.d.ts.map +1 -1
- package/dist/billing/billing-subscriptions/index.js +1 -1
- package/dist/billing/index.d.ts +1 -1
- package/dist/billing/index.d.ts.map +1 -1
- package/dist/billing/index.js +1 -1
- package/dist/database-entities/index.d.ts +2 -2
- package/dist/database-entities/index.d.ts.map +1 -1
- package/dist/database-entities/index.js +2 -2
- package/package.json +1 -1
- package/dist/billing/billing-accounts/enums/billing-account-owner-type.enum.d.ts +0 -4
- package/dist/billing/billing-accounts/enums/billing-account-owner-type.enum.d.ts.map +0 -1
- package/dist/billing/billing-accounts/enums/billing-account-owner-type.enum.js +0 -7
- package/dist/billing/billing-prices/billing-price.entity.d.ts.map +0 -1
- package/dist/billing/billing-prices/billing-price.entity.js +0 -170
- package/dist/billing/billing-prices/enums/billing-scheme.enum.d.ts +0 -5
- package/dist/billing/billing-prices/enums/billing-scheme.enum.d.ts.map +0 -1
- package/dist/billing/billing-prices/enums/billing-scheme.enum.js +0 -8
- package/dist/billing/billing-prices/enums/pricing-model.enum.d.ts +0 -6
- package/dist/billing/billing-prices/enums/pricing-model.enum.d.ts.map +0 -1
- package/dist/billing/billing-prices/enums/recurring-interval.enum.d.ts.map +0 -1
- package/dist/billing/billing-prices/enums/tiers-mode.enum.d.ts +0 -5
- package/dist/billing/billing-prices/enums/tiers-mode.enum.d.ts.map +0 -1
- package/dist/billing/billing-prices/enums/tiers-mode.enum.js +0 -8
- package/dist/billing/billing-prices/index.d.ts +0 -6
- package/dist/billing/billing-prices/index.d.ts.map +0 -1
- package/dist/billing/billing-prices/index.js +0 -5
- package/dist/billing/billing-products/enums/billing-product-code.constant.d.ts +0 -6
- package/dist/billing/billing-products/enums/billing-product-code.constant.d.ts.map +0 -1
- package/dist/billing/billing-subscriptions/enums/billing-resource-type.enum.d.ts +0 -4
- package/dist/billing/billing-subscriptions/enums/billing-resource-type.enum.d.ts.map +0 -1
- package/dist/billing/billing-subscriptions/enums/billing-resource-type.enum.js +0 -7
- /package/dist/billing/{billing-prices → billing-plans}/enums/recurring-interval.enum.d.ts +0 -0
- /package/dist/billing/{billing-prices → billing-plans}/enums/recurring-interval.enum.js +0 -0
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { BillingSubscription } from '../billing-subscriptions';
|
|
2
|
-
import {
|
|
2
|
+
import { BillingAccountBillableEntityType } from './enums/billing-account-billable-entity-type.enum';
|
|
3
|
+
import { BillingPersonType } from './enums/billing-person-type.enum';
|
|
3
4
|
export declare class BillingAccount {
|
|
4
5
|
id: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
billableEntityType: BillingAccountBillableEntityType;
|
|
7
|
+
billableEntityId: number;
|
|
8
|
+
personType: BillingPersonType | null;
|
|
9
|
+
document: string | null;
|
|
10
|
+
legalName: string | null;
|
|
11
|
+
email: string | null;
|
|
12
|
+
phone: string | null;
|
|
13
|
+
addressPostalCode: string | null;
|
|
14
|
+
addressStreet: string | null;
|
|
15
|
+
addressNumber: string | null;
|
|
16
|
+
addressComplement: string | null;
|
|
17
|
+
addressNeighborhood: string | null;
|
|
18
|
+
addressCity: string | null;
|
|
19
|
+
addressState: string | null;
|
|
20
|
+
addressCountry: string | null;
|
|
8
21
|
createdAt: Date;
|
|
9
22
|
updatedAt: Date;
|
|
10
23
|
subscriptions: BillingSubscription[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-account.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-accounts/billing-account.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"billing-account.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-accounts/billing-account.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gCAAgC,EAAE,MAAM,mDAAmD,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAiBrE,qBAGa,cAAc;IAIzB,EAAE,EAAE,MAAM,CAAC;IASX,kBAAkB,EAAE,gCAAgC,CAAC;IAOrD,gBAAgB,EAAE,MAAM,CAAC;IAYzB,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAC;IASrC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IASxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IASzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IASrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAWrB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IASjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAS7B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAS7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IASjC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IASnC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAS3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAU5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAO9B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACtC"}
|
|
@@ -19,7 +19,8 @@ import {
|
|
|
19
19
|
UpdateDateColumn
|
|
20
20
|
} from "typeorm";
|
|
21
21
|
import { BillingSubscription } from "../billing-subscriptions/index.js";
|
|
22
|
-
import {
|
|
22
|
+
import { BillingAccountBillableEntityType } from "./enums/billing-account-billable-entity-type.enum.js";
|
|
23
|
+
import { BillingPersonType } from "./enums/billing-person-type.enum.js";
|
|
23
24
|
let BillingAccount = class {
|
|
24
25
|
};
|
|
25
26
|
__decorateClass([
|
|
@@ -29,28 +30,139 @@ __decorateClass([
|
|
|
29
30
|
], BillingAccount.prototype, "id", 2);
|
|
30
31
|
__decorateClass([
|
|
31
32
|
Column({
|
|
32
|
-
name: "
|
|
33
|
+
name: "billable_entity_type",
|
|
33
34
|
type: "enum",
|
|
34
|
-
enum:
|
|
35
|
-
enumName: "
|
|
36
|
-
comment: "Tipo do dono da conta (ex.: organization)."
|
|
35
|
+
enum: BillingAccountBillableEntityType,
|
|
36
|
+
enumName: "billing_accounts_billable_entity_type_enum",
|
|
37
|
+
comment: "Tipo do pagador dono da conta (ex.: organization)."
|
|
37
38
|
})
|
|
38
|
-
], BillingAccount.prototype, "
|
|
39
|
+
], BillingAccount.prototype, "billableEntityType", 2);
|
|
39
40
|
__decorateClass([
|
|
40
41
|
Column({
|
|
41
|
-
name: "
|
|
42
|
+
name: "billable_entity_id",
|
|
42
43
|
type: "int",
|
|
43
|
-
comment: "Identificador do
|
|
44
|
+
comment: "Identificador do pagador no seu dom\xEDnio (soft-ref, ex.: organization.id)."
|
|
44
45
|
})
|
|
45
|
-
], BillingAccount.prototype, "
|
|
46
|
+
], BillingAccount.prototype, "billableEntityId", 2);
|
|
46
47
|
__decorateClass([
|
|
47
48
|
Column({
|
|
48
|
-
name: "
|
|
49
|
-
type: "
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
name: "person_type",
|
|
50
|
+
type: "enum",
|
|
51
|
+
enum: BillingPersonType,
|
|
52
|
+
enumName: "billing_accounts_person_type_enum",
|
|
53
|
+
nullable: true,
|
|
54
|
+
comment: "Natureza jur\xEDdica do pagador (individual \u2192 CPF, company \u2192 CNPJ)."
|
|
55
|
+
})
|
|
56
|
+
], BillingAccount.prototype, "personType", 2);
|
|
57
|
+
__decorateClass([
|
|
58
|
+
Column({
|
|
59
|
+
name: "document",
|
|
60
|
+
type: "varchar",
|
|
61
|
+
length: 14,
|
|
62
|
+
nullable: true,
|
|
63
|
+
comment: "Documento fiscal, s\xF3 d\xEDgitos: CPF (11) ou CNPJ (14)."
|
|
64
|
+
})
|
|
65
|
+
], BillingAccount.prototype, "document", 2);
|
|
66
|
+
__decorateClass([
|
|
67
|
+
Column({
|
|
68
|
+
name: "legal_name",
|
|
69
|
+
type: "varchar",
|
|
70
|
+
length: 255,
|
|
71
|
+
nullable: true,
|
|
72
|
+
comment: "Nome completo (pessoa f\xEDsica) ou raz\xE3o social (pessoa jur\xEDdica)."
|
|
73
|
+
})
|
|
74
|
+
], BillingAccount.prototype, "legalName", 2);
|
|
75
|
+
__decorateClass([
|
|
76
|
+
Column({
|
|
77
|
+
name: "email",
|
|
78
|
+
type: "varchar",
|
|
79
|
+
length: 255,
|
|
80
|
+
nullable: true,
|
|
81
|
+
comment: "E-mail de contato de cobran\xE7a."
|
|
82
|
+
})
|
|
83
|
+
], BillingAccount.prototype, "email", 2);
|
|
84
|
+
__decorateClass([
|
|
85
|
+
Column({
|
|
86
|
+
name: "phone",
|
|
87
|
+
type: "varchar",
|
|
88
|
+
length: 20,
|
|
89
|
+
nullable: true,
|
|
90
|
+
comment: "Telefone de contato (d\xEDgitos / E.164)."
|
|
91
|
+
})
|
|
92
|
+
], BillingAccount.prototype, "phone", 2);
|
|
93
|
+
__decorateClass([
|
|
94
|
+
Column({
|
|
95
|
+
name: "address_postal_code",
|
|
96
|
+
type: "varchar",
|
|
97
|
+
length: 8,
|
|
98
|
+
nullable: true,
|
|
99
|
+
comment: "CEP, s\xF3 d\xEDgitos."
|
|
100
|
+
})
|
|
101
|
+
], BillingAccount.prototype, "addressPostalCode", 2);
|
|
102
|
+
__decorateClass([
|
|
103
|
+
Column({
|
|
104
|
+
name: "address_street",
|
|
105
|
+
type: "varchar",
|
|
106
|
+
length: 255,
|
|
107
|
+
nullable: true,
|
|
108
|
+
comment: "Logradouro."
|
|
109
|
+
})
|
|
110
|
+
], BillingAccount.prototype, "addressStreet", 2);
|
|
111
|
+
__decorateClass([
|
|
112
|
+
Column({
|
|
113
|
+
name: "address_number",
|
|
114
|
+
type: "varchar",
|
|
115
|
+
length: 20,
|
|
116
|
+
nullable: true,
|
|
117
|
+
comment: 'N\xFAmero (varchar: aceita "S/N", "123-A").'
|
|
118
|
+
})
|
|
119
|
+
], BillingAccount.prototype, "addressNumber", 2);
|
|
120
|
+
__decorateClass([
|
|
121
|
+
Column({
|
|
122
|
+
name: "address_complement",
|
|
123
|
+
type: "varchar",
|
|
124
|
+
length: 100,
|
|
125
|
+
nullable: true,
|
|
126
|
+
comment: "Complemento do endere\xE7o."
|
|
127
|
+
})
|
|
128
|
+
], BillingAccount.prototype, "addressComplement", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
Column({
|
|
131
|
+
name: "address_neighborhood",
|
|
132
|
+
type: "varchar",
|
|
133
|
+
length: 100,
|
|
134
|
+
nullable: true,
|
|
135
|
+
comment: "Bairro."
|
|
136
|
+
})
|
|
137
|
+
], BillingAccount.prototype, "addressNeighborhood", 2);
|
|
138
|
+
__decorateClass([
|
|
139
|
+
Column({
|
|
140
|
+
name: "address_city",
|
|
141
|
+
type: "varchar",
|
|
142
|
+
length: 100,
|
|
143
|
+
nullable: true,
|
|
144
|
+
comment: "Cidade."
|
|
145
|
+
})
|
|
146
|
+
], BillingAccount.prototype, "addressCity", 2);
|
|
147
|
+
__decorateClass([
|
|
148
|
+
Column({
|
|
149
|
+
name: "address_state",
|
|
150
|
+
type: "char",
|
|
151
|
+
length: 2,
|
|
152
|
+
nullable: true,
|
|
153
|
+
comment: "UF (ex.: SP)."
|
|
154
|
+
})
|
|
155
|
+
], BillingAccount.prototype, "addressState", 2);
|
|
156
|
+
__decorateClass([
|
|
157
|
+
Column({
|
|
158
|
+
name: "address_country",
|
|
159
|
+
type: "char",
|
|
160
|
+
length: 2,
|
|
161
|
+
default: "BR",
|
|
162
|
+
nullable: true,
|
|
163
|
+
comment: "Pa\xEDs (ISO 3166-1 alpha-2). Default BR."
|
|
52
164
|
})
|
|
53
|
-
], BillingAccount.prototype, "
|
|
165
|
+
], BillingAccount.prototype, "addressCountry", 2);
|
|
54
166
|
__decorateClass([
|
|
55
167
|
CreateDateColumn({
|
|
56
168
|
name: "created_at",
|
|
@@ -70,8 +182,8 @@ __decorateClass([
|
|
|
70
182
|
], BillingAccount.prototype, "subscriptions", 2);
|
|
71
183
|
BillingAccount = __decorateClass([
|
|
72
184
|
Entity("billing_accounts"),
|
|
73
|
-
Unique("
|
|
74
|
-
Index("
|
|
185
|
+
Unique("UQ_billing_accounts_billable_entity", ["billableEntityType", "billableEntityId"]),
|
|
186
|
+
Index("idx_billing_accounts_billable_entity", ["billableEntityType", "billableEntityId"])
|
|
75
187
|
], BillingAccount);
|
|
76
188
|
export {
|
|
77
189
|
BillingAccount
|
package/dist/billing/billing-accounts/enums/billing-account-billable-entity-type.enum.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-account-billable-entity-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-accounts/enums/billing-account-billable-entity-type.enum.ts"],"names":[],"mappings":"AAYA,oBAAY,gCAAgC;IAI1C,YAAY,iBAAiB;CAC9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var BillingAccountBillableEntityType = /* @__PURE__ */ ((BillingAccountBillableEntityType2) => {
|
|
2
|
+
BillingAccountBillableEntityType2["ORGANIZATION"] = "organization";
|
|
3
|
+
return BillingAccountBillableEntityType2;
|
|
4
|
+
})(BillingAccountBillableEntityType || {});
|
|
5
|
+
export {
|
|
6
|
+
BillingAccountBillableEntityType
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-person-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-accounts/enums/billing-person-type.enum.ts"],"names":[],"mappings":"AAUA,oBAAY,iBAAiB;IAI3B,UAAU,eAAe;IAKzB,OAAO,YAAY;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-accounts/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-accounts/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,mDAAmD,CAAC;AAClE,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { BillingProduct } from '../billing-products';
|
|
2
|
-
import {
|
|
2
|
+
import { ChargeType } from './enums/charge-type.enum';
|
|
3
3
|
import { PricingModel } from './enums/pricing-model.enum';
|
|
4
4
|
import { RecurringInterval } from './enums/recurring-interval.enum';
|
|
5
|
-
|
|
6
|
-
export interface BillingPriceTier {
|
|
7
|
-
upTo: number | null;
|
|
8
|
-
unitAmount: number;
|
|
9
|
-
}
|
|
10
|
-
export declare class BillingPrice {
|
|
5
|
+
export declare class BillingPlan {
|
|
11
6
|
id: string;
|
|
12
7
|
productId: string;
|
|
13
|
-
|
|
8
|
+
internalLabel: string | null;
|
|
14
9
|
amount: number;
|
|
15
|
-
|
|
16
|
-
billingScheme: BillingScheme;
|
|
10
|
+
chargeType: ChargeType;
|
|
17
11
|
recurringInterval: RecurringInterval | null;
|
|
18
12
|
pricingModel: PricingModel;
|
|
19
|
-
tiers: BillingPriceTier[] | null;
|
|
20
|
-
tiersMode: TiersMode | null;
|
|
21
13
|
trialPeriodDays: number;
|
|
22
14
|
validFrom: Date;
|
|
23
15
|
validUntil: Date | null;
|
|
@@ -26,4 +18,4 @@ export declare class BillingPrice {
|
|
|
26
18
|
updatedAt: Date;
|
|
27
19
|
product: BillingProduct;
|
|
28
20
|
}
|
|
29
|
-
//# sourceMappingURL=billing-
|
|
21
|
+
//# sourceMappingURL=billing-plan.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-plan.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-plans/billing-plan.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAiBpE,qBAOa,WAAW;IAItB,EAAE,EAAE,MAAM,CAAC;IAOX,SAAS,EAAE,MAAM,CAAC;IASlB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAM7B,MAAM,EAAE,MAAM,CAAC;IASf,UAAU,EAAE,UAAU,CAAC;IAUvB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAU5C,YAAY,EAAE,YAAY,CAAC;IAQ3B,eAAe,EAAE,MAAM,CAAC;IAQxB,SAAS,EAAE,IAAI,CAAC;IAQhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IAQxB,QAAQ,EAAE,OAAO,CAAC;IAOlB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAYhB,OAAO,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
import {
|
|
12
|
+
Column,
|
|
13
|
+
CreateDateColumn,
|
|
14
|
+
Entity,
|
|
15
|
+
Index,
|
|
16
|
+
JoinColumn,
|
|
17
|
+
ManyToOne,
|
|
18
|
+
PrimaryGeneratedColumn,
|
|
19
|
+
UpdateDateColumn
|
|
20
|
+
} from "typeorm";
|
|
21
|
+
import { BillingProduct } from "../billing-products/index.js";
|
|
22
|
+
import { ChargeType } from "./enums/charge-type.enum.js";
|
|
23
|
+
import { PricingModel } from "./enums/pricing-model.enum.js";
|
|
24
|
+
import { RecurringInterval } from "./enums/recurring-interval.enum.js";
|
|
25
|
+
let BillingPlan = class {
|
|
26
|
+
};
|
|
27
|
+
__decorateClass([
|
|
28
|
+
PrimaryGeneratedColumn("uuid", {
|
|
29
|
+
comment: "Identificador \xFAnico do plano."
|
|
30
|
+
})
|
|
31
|
+
], BillingPlan.prototype, "id", 2);
|
|
32
|
+
__decorateClass([
|
|
33
|
+
Column({
|
|
34
|
+
name: "product_id",
|
|
35
|
+
type: "uuid",
|
|
36
|
+
comment: "Identificador do produto ao qual o plano pertence."
|
|
37
|
+
})
|
|
38
|
+
], BillingPlan.prototype, "productId", 2);
|
|
39
|
+
__decorateClass([
|
|
40
|
+
Column({
|
|
41
|
+
name: "internal_label",
|
|
42
|
+
type: "varchar",
|
|
43
|
+
length: 100,
|
|
44
|
+
nullable: true,
|
|
45
|
+
comment: 'R\xF3tulo interno do plano (ex.: "lan\xE7amento 2026"). N\xE3o exibido ao cliente.'
|
|
46
|
+
})
|
|
47
|
+
], BillingPlan.prototype, "internalLabel", 2);
|
|
48
|
+
__decorateClass([
|
|
49
|
+
Column({
|
|
50
|
+
type: "int",
|
|
51
|
+
comment: "Valor do plano em centavos."
|
|
52
|
+
})
|
|
53
|
+
], BillingPlan.prototype, "amount", 2);
|
|
54
|
+
__decorateClass([
|
|
55
|
+
Column({
|
|
56
|
+
name: "charge_type",
|
|
57
|
+
type: "enum",
|
|
58
|
+
enum: ChargeType,
|
|
59
|
+
enumName: "billing_plans_charge_type_enum",
|
|
60
|
+
comment: "Tipo de cobran\xE7a: \xFAnica (one_time) ou recorrente (recurring)."
|
|
61
|
+
})
|
|
62
|
+
], BillingPlan.prototype, "chargeType", 2);
|
|
63
|
+
__decorateClass([
|
|
64
|
+
Column({
|
|
65
|
+
name: "recurring_interval",
|
|
66
|
+
type: "enum",
|
|
67
|
+
enum: RecurringInterval,
|
|
68
|
+
enumName: "billing_plans_recurring_interval_enum",
|
|
69
|
+
nullable: true,
|
|
70
|
+
comment: "Intervalo de recorr\xEAncia (month/year). Nulo quando a cobran\xE7a \xE9 \xFAnica."
|
|
71
|
+
})
|
|
72
|
+
], BillingPlan.prototype, "recurringInterval", 2);
|
|
73
|
+
__decorateClass([
|
|
74
|
+
Column({
|
|
75
|
+
name: "pricing_model",
|
|
76
|
+
type: "enum",
|
|
77
|
+
enum: PricingModel,
|
|
78
|
+
enumName: "billing_plans_pricing_model_enum",
|
|
79
|
+
default: PricingModel.FLAT,
|
|
80
|
+
comment: "Modelo de precifica\xE7\xE3o: valor fixo (flat) ou por unidade (per_unit)."
|
|
81
|
+
})
|
|
82
|
+
], BillingPlan.prototype, "pricingModel", 2);
|
|
83
|
+
__decorateClass([
|
|
84
|
+
Column({
|
|
85
|
+
name: "trial_period_days",
|
|
86
|
+
type: "int",
|
|
87
|
+
default: 0,
|
|
88
|
+
comment: "Dura\xE7\xE3o do trial gratuito em dias. 0 = sem trial."
|
|
89
|
+
})
|
|
90
|
+
], BillingPlan.prototype, "trialPeriodDays", 2);
|
|
91
|
+
__decorateClass([
|
|
92
|
+
Column({
|
|
93
|
+
name: "valid_from",
|
|
94
|
+
type: "timestamptz",
|
|
95
|
+
default: () => "now()",
|
|
96
|
+
comment: "In\xEDcio da vig\xEAncia do plano."
|
|
97
|
+
})
|
|
98
|
+
], BillingPlan.prototype, "validFrom", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
Column({
|
|
101
|
+
name: "valid_until",
|
|
102
|
+
type: "timestamptz",
|
|
103
|
+
nullable: true,
|
|
104
|
+
comment: "Fim da vig\xEAncia do plano. Nulo enquanto vigente."
|
|
105
|
+
})
|
|
106
|
+
], BillingPlan.prototype, "validUntil", 2);
|
|
107
|
+
__decorateClass([
|
|
108
|
+
Column({
|
|
109
|
+
name: "is_active",
|
|
110
|
+
type: "boolean",
|
|
111
|
+
default: true,
|
|
112
|
+
comment: "Indica se o plano est\xE1 ativo. Permite desativa\xE7\xE3o imediata (kill switch)."
|
|
113
|
+
})
|
|
114
|
+
], BillingPlan.prototype, "isActive", 2);
|
|
115
|
+
__decorateClass([
|
|
116
|
+
CreateDateColumn({
|
|
117
|
+
name: "created_at",
|
|
118
|
+
type: "timestamptz",
|
|
119
|
+
comment: "Data de cria\xE7\xE3o do registro."
|
|
120
|
+
})
|
|
121
|
+
], BillingPlan.prototype, "createdAt", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
UpdateDateColumn({
|
|
124
|
+
name: "updated_at",
|
|
125
|
+
type: "timestamptz",
|
|
126
|
+
comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
|
|
127
|
+
})
|
|
128
|
+
], BillingPlan.prototype, "updatedAt", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
ManyToOne(() => BillingProduct, (product) => product.plans, {
|
|
131
|
+
onDelete: "RESTRICT"
|
|
132
|
+
}),
|
|
133
|
+
JoinColumn({ name: "product_id" })
|
|
134
|
+
], BillingPlan.prototype, "product", 2);
|
|
135
|
+
BillingPlan = __decorateClass([
|
|
136
|
+
Entity("billing_plans"),
|
|
137
|
+
Index("idx_billing_plans_product", ["productId"]),
|
|
138
|
+
Index("idx_billing_plans_product_valid_from", ["productId", "validFrom"]),
|
|
139
|
+
Index("idx_billing_plans_current", ["productId"], {
|
|
140
|
+
where: '"valid_until" IS NULL AND "is_active" = true'
|
|
141
|
+
})
|
|
142
|
+
], BillingPlan);
|
|
143
|
+
export {
|
|
144
|
+
BillingPlan
|
|
145
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charge-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-plans/enums/charge-type.enum.ts"],"names":[],"mappings":"AAWA,oBAAY,UAAU;IAIpB,QAAQ,aAAa;IAKrB,SAAS,cAAc;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-model.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-plans/enums/pricing-model.enum.ts"],"names":[],"mappings":"AAUA,oBAAY,YAAY;IAItB,IAAI,SAAS;IAKb,QAAQ,aAAa;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurring-interval.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-plans/enums/recurring-interval.enum.ts"],"names":[],"mappings":"AASA,oBAAY,iBAAiB;IAI3B,KAAK,UAAU;IAKf,IAAI,SAAS;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-plans/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BillingPlan } from '../billing-plans';
|
|
2
2
|
export declare class BillingProduct {
|
|
3
3
|
id: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
key: string;
|
|
5
|
+
displayName: string;
|
|
6
6
|
description: string | null;
|
|
7
7
|
isActive: boolean;
|
|
8
8
|
createdAt: Date;
|
|
9
9
|
updatedAt: Date;
|
|
10
|
-
|
|
10
|
+
plans: BillingPlan[];
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=billing-product.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-product.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-products/billing-product.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"billing-product.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-products/billing-product.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiB/C,qBAIa,cAAc;IAIzB,EAAE,EAAE,MAAM,CAAC;IAQX,GAAG,EAAE,MAAM,CAAC;IAQZ,WAAW,EAAE,MAAM,CAAC;IAOpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,QAAQ,EAAE,OAAO,CAAC;IAOlB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB"}
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
Unique,
|
|
19
19
|
UpdateDateColumn
|
|
20
20
|
} from "typeorm";
|
|
21
|
-
import {
|
|
21
|
+
import { BillingPlan } from "../billing-plans/index.js";
|
|
22
22
|
let BillingProduct = class {
|
|
23
23
|
};
|
|
24
24
|
__decorateClass([
|
|
@@ -30,16 +30,17 @@ __decorateClass([
|
|
|
30
30
|
Column({
|
|
31
31
|
type: "varchar",
|
|
32
32
|
length: 60,
|
|
33
|
-
comment: "
|
|
33
|
+
comment: "Chave sem\xE2ntica est\xE1vel do produto em UPPER_SNAKE_CASE (ex.: TOURNAMENT_LICENSE). Imut\xE1vel ap\xF3s a cria\xE7\xE3o."
|
|
34
34
|
})
|
|
35
|
-
], BillingProduct.prototype, "
|
|
35
|
+
], BillingProduct.prototype, "key", 2);
|
|
36
36
|
__decorateClass([
|
|
37
37
|
Column({
|
|
38
|
+
name: "display_name",
|
|
38
39
|
type: "varchar",
|
|
39
40
|
length: 255,
|
|
40
41
|
comment: "Nome de exibi\xE7\xE3o do produto."
|
|
41
42
|
})
|
|
42
|
-
], BillingProduct.prototype, "
|
|
43
|
+
], BillingProduct.prototype, "displayName", 2);
|
|
43
44
|
__decorateClass([
|
|
44
45
|
Column({
|
|
45
46
|
type: "text",
|
|
@@ -70,12 +71,12 @@ __decorateClass([
|
|
|
70
71
|
})
|
|
71
72
|
], BillingProduct.prototype, "updatedAt", 2);
|
|
72
73
|
__decorateClass([
|
|
73
|
-
OneToMany(() =>
|
|
74
|
-
], BillingProduct.prototype, "
|
|
74
|
+
OneToMany(() => BillingPlan, (plan) => plan.product)
|
|
75
|
+
], BillingProduct.prototype, "plans", 2);
|
|
75
76
|
BillingProduct = __decorateClass([
|
|
76
77
|
Entity("billing_products"),
|
|
77
|
-
Unique("
|
|
78
|
-
Index("
|
|
78
|
+
Unique("UQ_billing_products_key", ["key"]),
|
|
79
|
+
Index("idx_billing_products_key", ["key"]),
|
|
79
80
|
Index("idx_billing_products_is_active", ["isActive"])
|
|
80
81
|
], BillingProduct);
|
|
81
82
|
export {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const BillingProductKey: {
|
|
2
|
+
readonly TOURNAMENT_LICENSE: "TOURNAMENT_LICENSE";
|
|
3
|
+
readonly EXTRA_CATEGORY: "EXTRA_CATEGORY";
|
|
4
|
+
};
|
|
5
|
+
export type BillingProductKey = (typeof BillingProductKey)[keyof typeof BillingProductKey];
|
|
6
|
+
//# sourceMappingURL=billing-product-key.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-product-key.constant.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-products/enums/billing-product-key.constant.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,iBAAiB;;;CAUpB,CAAC;AAWX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const BillingProductKey = {
|
|
2
2
|
/**
|
|
3
3
|
* Licença de uso da plataforma por campeonato (agrupador de categorias).
|
|
4
4
|
*/
|
|
@@ -9,5 +9,5 @@ const BillingProductCode = {
|
|
|
9
9
|
EXTRA_CATEGORY: "EXTRA_CATEGORY"
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
BillingProductKey
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-products/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-products/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./billing-product.entity.js";
|
|
2
|
-
export * from "./enums/billing-product-
|
|
2
|
+
export * from "./enums/billing-product-key.constant.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BillingPlan } from '../billing-plans';
|
|
2
2
|
import { BillingSubscription } from '../billing-subscriptions';
|
|
3
3
|
export declare class BillingSubscriptionItem {
|
|
4
4
|
id: string;
|
|
5
5
|
subscriptionId: string;
|
|
6
|
-
|
|
6
|
+
planId: string;
|
|
7
7
|
quantity: number;
|
|
8
8
|
createdAt: Date;
|
|
9
9
|
updatedAt: Date;
|
|
10
10
|
subscription: BillingSubscription;
|
|
11
|
-
|
|
11
|
+
plan: BillingPlan;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=billing-subscription-item.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-subscription-item.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-subscription-items/billing-subscription-item.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"billing-subscription-item.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-subscription-items/billing-subscription-item.entity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAc/D,qBAIa,uBAAuB;IAIlC,EAAE,EAAE,MAAM,CAAC;IAOX,cAAc,EAAE,MAAM,CAAC;IAOvB,MAAM,EAAE,MAAM,CAAC;IAOf,QAAQ,EAAE,MAAM,CAAC;IAOjB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAahB,YAAY,EAAE,mBAAmB,CAAC;IAUlC,IAAI,EAAE,WAAW,CAAC;CACnB"}
|