@natrave/shared-entities 7.1.0 → 7.2.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.
Files changed (34) hide show
  1. package/dist/billing/billing-accounts/billing-account.entity.d.ts +12 -0
  2. package/dist/billing/billing-accounts/billing-account.entity.d.ts.map +1 -0
  3. package/dist/billing/billing-accounts/billing-account.entity.js +78 -0
  4. package/dist/billing/billing-accounts/enums/billing-account-owner-type.enum.d.ts +4 -0
  5. package/dist/billing/billing-accounts/enums/billing-account-owner-type.enum.d.ts.map +1 -0
  6. package/dist/billing/billing-accounts/enums/billing-account-owner-type.enum.js +7 -0
  7. package/dist/billing/billing-accounts/index.d.ts +3 -0
  8. package/dist/billing/billing-accounts/index.d.ts.map +1 -0
  9. package/dist/billing/billing-accounts/index.js +2 -0
  10. package/dist/billing/billing-subscription-items/billing-subscription-item.entity.d.ts +13 -0
  11. package/dist/billing/billing-subscription-items/billing-subscription-item.entity.d.ts.map +1 -0
  12. package/dist/billing/billing-subscription-items/billing-subscription-item.entity.js +84 -0
  13. package/dist/billing/billing-subscription-items/index.d.ts +2 -0
  14. package/dist/billing/billing-subscription-items/index.d.ts.map +1 -0
  15. package/dist/billing/billing-subscription-items/index.js +1 -0
  16. package/dist/billing/billing-subscriptions/billing-subscription.entity.d.ts +22 -0
  17. package/dist/billing/billing-subscriptions/billing-subscription.entity.d.ts.map +1 -0
  18. package/dist/billing/billing-subscriptions/billing-subscription.entity.js +149 -0
  19. package/dist/billing/billing-subscriptions/enums/billing-resource-type.enum.d.ts +4 -0
  20. package/dist/billing/billing-subscriptions/enums/billing-resource-type.enum.d.ts.map +1 -0
  21. package/dist/billing/billing-subscriptions/enums/billing-resource-type.enum.js +7 -0
  22. package/dist/billing/billing-subscriptions/enums/billing-subscription-status.enum.d.ts +9 -0
  23. package/dist/billing/billing-subscriptions/enums/billing-subscription-status.enum.d.ts.map +1 -0
  24. package/dist/billing/billing-subscriptions/enums/billing-subscription-status.enum.js +12 -0
  25. package/dist/billing/billing-subscriptions/index.d.ts +4 -0
  26. package/dist/billing/billing-subscriptions/index.d.ts.map +1 -0
  27. package/dist/billing/billing-subscriptions/index.js +3 -0
  28. package/dist/billing/index.d.ts +3 -0
  29. package/dist/billing/index.d.ts.map +1 -1
  30. package/dist/billing/index.js +3 -0
  31. package/dist/database-entities/index.d.ts +2 -2
  32. package/dist/database-entities/index.d.ts.map +1 -1
  33. package/dist/database-entities/index.js +10 -1
  34. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import { BillingSubscription } from '../billing-subscriptions';
2
+ import { BillingAccountOwnerType } from './enums/billing-account-owner-type.enum';
3
+ export declare class BillingAccount {
4
+ id: string;
5
+ ownerType: BillingAccountOwnerType;
6
+ ownerId: number;
7
+ creditBalance: number;
8
+ createdAt: Date;
9
+ updatedAt: Date;
10
+ subscriptions: BillingSubscription[];
11
+ }
12
+ //# sourceMappingURL=billing-account.entity.d.ts.map
@@ -0,0 +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,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAalF,qBAGa,cAAc;IAIzB,EAAE,EAAE,MAAM,CAAC;IASX,SAAS,EAAE,uBAAuB,CAAC;IAOnC,OAAO,EAAE,MAAM,CAAC;IAQhB,aAAa,EAAE,MAAM,CAAC;IAOtB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACtC"}
@@ -0,0 +1,78 @@
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
+ OneToMany,
17
+ PrimaryGeneratedColumn,
18
+ Unique,
19
+ UpdateDateColumn
20
+ } from "typeorm";
21
+ import { BillingSubscription } from "../billing-subscriptions/index.js";
22
+ import { BillingAccountOwnerType } from "./enums/billing-account-owner-type.enum.js";
23
+ let BillingAccount = class {
24
+ };
25
+ __decorateClass([
26
+ PrimaryGeneratedColumn("uuid", {
27
+ comment: "Identificador \xFAnico da conta de billing."
28
+ })
29
+ ], BillingAccount.prototype, "id", 2);
30
+ __decorateClass([
31
+ Column({
32
+ name: "owner_type",
33
+ type: "enum",
34
+ enum: BillingAccountOwnerType,
35
+ enumName: "billing_accounts_owner_type_enum",
36
+ comment: "Tipo do dono da conta (ex.: organization)."
37
+ })
38
+ ], BillingAccount.prototype, "ownerType", 2);
39
+ __decorateClass([
40
+ Column({
41
+ name: "owner_id",
42
+ type: "int",
43
+ comment: "Identificador do dono da conta no seu dom\xEDnio (ex.: organization.id)."
44
+ })
45
+ ], BillingAccount.prototype, "ownerId", 2);
46
+ __decorateClass([
47
+ Column({
48
+ name: "credit_balance",
49
+ type: "int",
50
+ default: 0,
51
+ comment: "Saldo de cr\xE9dito da conta em centavos (estornos/cr\xE9ditos). Nunca negativo."
52
+ })
53
+ ], BillingAccount.prototype, "creditBalance", 2);
54
+ __decorateClass([
55
+ CreateDateColumn({
56
+ name: "created_at",
57
+ type: "timestamptz",
58
+ comment: "Data de cria\xE7\xE3o do registro."
59
+ })
60
+ ], BillingAccount.prototype, "createdAt", 2);
61
+ __decorateClass([
62
+ UpdateDateColumn({
63
+ name: "updated_at",
64
+ type: "timestamptz",
65
+ comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
66
+ })
67
+ ], BillingAccount.prototype, "updatedAt", 2);
68
+ __decorateClass([
69
+ OneToMany(() => BillingSubscription, (subscription) => subscription.billingAccount)
70
+ ], BillingAccount.prototype, "subscriptions", 2);
71
+ BillingAccount = __decorateClass([
72
+ Entity("billing_accounts"),
73
+ Unique("UQ_billing_accounts_owner", ["ownerType", "ownerId"]),
74
+ Index("idx_billing_accounts_owner", ["ownerType", "ownerId"])
75
+ ], BillingAccount);
76
+ export {
77
+ BillingAccount
78
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum BillingAccountOwnerType {
2
+ ORGANIZATION = "organization"
3
+ }
4
+ //# sourceMappingURL=billing-account-owner-type.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-account-owner-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-accounts/enums/billing-account-owner-type.enum.ts"],"names":[],"mappings":"AAWA,oBAAY,uBAAuB;IAIjC,YAAY,iBAAiB;CAC9B"}
@@ -0,0 +1,7 @@
1
+ var BillingAccountOwnerType = /* @__PURE__ */ ((BillingAccountOwnerType2) => {
2
+ BillingAccountOwnerType2["ORGANIZATION"] = "organization";
3
+ return BillingAccountOwnerType2;
4
+ })(BillingAccountOwnerType || {});
5
+ export {
6
+ BillingAccountOwnerType
7
+ };
@@ -0,0 +1,3 @@
1
+ export * from './billing-account.entity';
2
+ export * from './enums/billing-account-owner-type.enum';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-accounts/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yCAAyC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./billing-account.entity.js";
2
+ export * from "./enums/billing-account-owner-type.enum.js";
@@ -0,0 +1,13 @@
1
+ import { BillingPrice } from '../billing-prices';
2
+ import { BillingSubscription } from '../billing-subscriptions';
3
+ export declare class BillingSubscriptionItem {
4
+ id: string;
5
+ subscriptionId: string;
6
+ priceId: string;
7
+ quantity: number;
8
+ createdAt: Date;
9
+ updatedAt: Date;
10
+ subscription: BillingSubscription;
11
+ price: BillingPrice;
12
+ }
13
+ //# sourceMappingURL=billing-subscription-item.entity.d.ts.map
@@ -0,0 +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":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAc/D,qBAGa,uBAAuB;IAIlC,EAAE,EAAE,MAAM,CAAC;IAOX,cAAc,EAAE,MAAM,CAAC;IAOvB,OAAO,EAAE,MAAM,CAAC;IAOhB,QAAQ,EAAE,MAAM,CAAC;IAOjB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAYhB,YAAY,EAAE,mBAAmB,CAAC;IAUlC,KAAK,EAAE,YAAY,CAAC;CACrB"}
@@ -0,0 +1,84 @@
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 { BillingPrice } from "../billing-prices/index.js";
22
+ import { BillingSubscription } from "../billing-subscriptions/index.js";
23
+ let BillingSubscriptionItem = class {
24
+ };
25
+ __decorateClass([
26
+ PrimaryGeneratedColumn("uuid", {
27
+ comment: "Identificador \xFAnico do item de assinatura."
28
+ })
29
+ ], BillingSubscriptionItem.prototype, "id", 2);
30
+ __decorateClass([
31
+ Column({
32
+ name: "subscription_id",
33
+ type: "uuid",
34
+ comment: "Identificador da assinatura \xE0 qual o item pertence."
35
+ })
36
+ ], BillingSubscriptionItem.prototype, "subscriptionId", 2);
37
+ __decorateClass([
38
+ Column({
39
+ name: "price_id",
40
+ type: "uuid",
41
+ comment: "Identificador da vers\xE3o de pre\xE7o contratada para este item."
42
+ })
43
+ ], BillingSubscriptionItem.prototype, "priceId", 2);
44
+ __decorateClass([
45
+ Column({
46
+ type: "int",
47
+ default: 1,
48
+ comment: "Quantidade contratada deste pre\xE7o (ex.: n\xBA de categorias extras)."
49
+ })
50
+ ], BillingSubscriptionItem.prototype, "quantity", 2);
51
+ __decorateClass([
52
+ CreateDateColumn({
53
+ name: "created_at",
54
+ type: "timestamptz",
55
+ comment: "Data de cria\xE7\xE3o do registro."
56
+ })
57
+ ], BillingSubscriptionItem.prototype, "createdAt", 2);
58
+ __decorateClass([
59
+ UpdateDateColumn({
60
+ name: "updated_at",
61
+ type: "timestamptz",
62
+ comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
63
+ })
64
+ ], BillingSubscriptionItem.prototype, "updatedAt", 2);
65
+ __decorateClass([
66
+ ManyToOne(() => BillingSubscription, (subscription) => subscription.items, {
67
+ onDelete: "CASCADE"
68
+ }),
69
+ JoinColumn({ name: "subscription_id" })
70
+ ], BillingSubscriptionItem.prototype, "subscription", 2);
71
+ __decorateClass([
72
+ ManyToOne(() => BillingPrice, {
73
+ onDelete: "RESTRICT"
74
+ }),
75
+ JoinColumn({ name: "price_id" })
76
+ ], BillingSubscriptionItem.prototype, "price", 2);
77
+ BillingSubscriptionItem = __decorateClass([
78
+ Entity("billing_subscription_items"),
79
+ Index("idx_billing_subscription_items_subscription", ["subscriptionId"]),
80
+ Index("idx_billing_subscription_items_price", ["priceId"])
81
+ ], BillingSubscriptionItem);
82
+ export {
83
+ BillingSubscriptionItem
84
+ };
@@ -0,0 +1,2 @@
1
+ export * from './billing-subscription-item.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-subscription-items/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./billing-subscription-item.entity.js";
@@ -0,0 +1,22 @@
1
+ import { BillingAccount } from '../billing-accounts';
2
+ import { BillingSubscriptionItem } from '../billing-subscription-items';
3
+ import { BillingResourceType } from './enums/billing-resource-type.enum';
4
+ import { BillingSubscriptionStatus } from './enums/billing-subscription-status.enum';
5
+ export declare class BillingSubscription {
6
+ id: string;
7
+ billingAccountId: string;
8
+ resourceType: BillingResourceType;
9
+ resourceId: number;
10
+ status: BillingSubscriptionStatus;
11
+ trialStartsAt: Date | null;
12
+ trialEndsAt: Date | null;
13
+ activatedAt: Date | null;
14
+ canceledAt: Date | null;
15
+ currentPeriodStart: Date | null;
16
+ currentPeriodEnd: Date | null;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ billingAccount: BillingAccount;
20
+ items: BillingSubscriptionItem[];
21
+ }
22
+ //# sourceMappingURL=billing-subscription.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-subscription.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-subscriptions/billing-subscription.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAiBrF,qBAUa,mBAAmB;IAI9B,EAAE,EAAE,MAAM,CAAC;IAOX,gBAAgB,EAAE,MAAM,CAAC;IASzB,YAAY,EAAE,mBAAmB,CAAC;IAOlC,UAAU,EAAE,MAAM,CAAC;IASnB,MAAM,EAAE,yBAAyB,CAAC;IAQlC,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAQ3B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAQzB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAQzB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IAQxB,kBAAkB,EAAE,IAAI,GAAG,IAAI,CAAC;IAQhC,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC;IAO9B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAYhB,cAAc,EAAE,cAAc,CAAC;IAM/B,KAAK,EAAE,uBAAuB,EAAE,CAAC;CAClC"}
@@ -0,0 +1,149 @@
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
+ OneToMany,
19
+ PrimaryGeneratedColumn,
20
+ Unique,
21
+ UpdateDateColumn
22
+ } from "typeorm";
23
+ import { BillingAccount } from "../billing-accounts/index.js";
24
+ import { BillingSubscriptionItem } from "../billing-subscription-items/index.js";
25
+ import { BillingResourceType } from "./enums/billing-resource-type.enum.js";
26
+ import { BillingSubscriptionStatus } from "./enums/billing-subscription-status.enum.js";
27
+ let BillingSubscription = class {
28
+ };
29
+ __decorateClass([
30
+ PrimaryGeneratedColumn("uuid", {
31
+ comment: "Identificador \xFAnico da assinatura."
32
+ })
33
+ ], BillingSubscription.prototype, "id", 2);
34
+ __decorateClass([
35
+ Column({
36
+ name: "billing_account_id",
37
+ type: "uuid",
38
+ comment: "Identificador da conta de billing respons\xE1vel pela assinatura."
39
+ })
40
+ ], BillingSubscription.prototype, "billingAccountId", 2);
41
+ __decorateClass([
42
+ Column({
43
+ name: "resource_type",
44
+ type: "enum",
45
+ enum: BillingResourceType,
46
+ enumName: "billing_subscriptions_resource_type_enum",
47
+ comment: "Tipo do recurso cobr\xE1vel (ex.: tournament_category_group)."
48
+ })
49
+ ], BillingSubscription.prototype, "resourceType", 2);
50
+ __decorateClass([
51
+ Column({
52
+ name: "resource_id",
53
+ type: "int",
54
+ comment: "Identificador do recurso cobr\xE1vel no seu dom\xEDnio (ex.: category_group.id)."
55
+ })
56
+ ], BillingSubscription.prototype, "resourceId", 2);
57
+ __decorateClass([
58
+ Column({
59
+ type: "enum",
60
+ enum: BillingSubscriptionStatus,
61
+ enumName: "billing_subscriptions_status_enum",
62
+ default: BillingSubscriptionStatus.INCOMPLETE,
63
+ comment: "Estado atual da assinatura (m\xE1quina de estados do ciclo de vida)."
64
+ })
65
+ ], BillingSubscription.prototype, "status", 2);
66
+ __decorateClass([
67
+ Column({
68
+ name: "trial_starts_at",
69
+ type: "timestamptz",
70
+ nullable: true,
71
+ comment: "In\xEDcio do trial. Nulo quando a assinatura n\xE3o tem trial."
72
+ })
73
+ ], BillingSubscription.prototype, "trialStartsAt", 2);
74
+ __decorateClass([
75
+ Column({
76
+ name: "trial_ends_at",
77
+ type: "timestamptz",
78
+ nullable: true,
79
+ comment: "Fim do trial. Nulo quando a assinatura n\xE3o tem trial."
80
+ })
81
+ ], BillingSubscription.prototype, "trialEndsAt", 2);
82
+ __decorateClass([
83
+ Column({
84
+ name: "activated_at",
85
+ type: "timestamptz",
86
+ nullable: true,
87
+ comment: "Momento em que a assinatura passou a ACTIVE (primeiro pagamento confirmado)."
88
+ })
89
+ ], BillingSubscription.prototype, "activatedAt", 2);
90
+ __decorateClass([
91
+ Column({
92
+ name: "canceled_at",
93
+ type: "timestamptz",
94
+ nullable: true,
95
+ comment: "Momento em que a assinatura foi cancelada. Nulo enquanto n\xE3o cancelada."
96
+ })
97
+ ], BillingSubscription.prototype, "canceledAt", 2);
98
+ __decorateClass([
99
+ Column({
100
+ name: "current_period_start",
101
+ type: "timestamptz",
102
+ nullable: true,
103
+ comment: "In\xEDcio do per\xEDodo vigente (recorr\xEAncia). Nulo em cobran\xE7a \xFAnica."
104
+ })
105
+ ], BillingSubscription.prototype, "currentPeriodStart", 2);
106
+ __decorateClass([
107
+ Column({
108
+ name: "current_period_end",
109
+ type: "timestamptz",
110
+ nullable: true,
111
+ comment: "Fim do per\xEDodo vigente (recorr\xEAncia). Nulo em cobran\xE7a \xFAnica."
112
+ })
113
+ ], BillingSubscription.prototype, "currentPeriodEnd", 2);
114
+ __decorateClass([
115
+ CreateDateColumn({
116
+ name: "created_at",
117
+ type: "timestamptz",
118
+ comment: "Data de cria\xE7\xE3o do registro."
119
+ })
120
+ ], BillingSubscription.prototype, "createdAt", 2);
121
+ __decorateClass([
122
+ UpdateDateColumn({
123
+ name: "updated_at",
124
+ type: "timestamptz",
125
+ comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
126
+ })
127
+ ], BillingSubscription.prototype, "updatedAt", 2);
128
+ __decorateClass([
129
+ ManyToOne(() => BillingAccount, (account) => account.subscriptions, {
130
+ onDelete: "RESTRICT"
131
+ }),
132
+ JoinColumn({ name: "billing_account_id" })
133
+ ], BillingSubscription.prototype, "billingAccount", 2);
134
+ __decorateClass([
135
+ OneToMany(() => BillingSubscriptionItem, (item) => item.subscription)
136
+ ], BillingSubscription.prototype, "items", 2);
137
+ BillingSubscription = __decorateClass([
138
+ Entity("billing_subscriptions"),
139
+ Unique("UQ_billing_subscriptions_resource", ["resourceType", "resourceId"]),
140
+ Index("idx_billing_subscriptions_account", ["billingAccountId"]),
141
+ Index("idx_billing_subscriptions_resource", ["resourceType", "resourceId"]),
142
+ Index("idx_billing_subscriptions_status", ["status"]),
143
+ Index("idx_billing_subscriptions_trial_expiring", ["trialEndsAt"], {
144
+ where: `"status" = 'trialing'`
145
+ })
146
+ ], BillingSubscription);
147
+ export {
148
+ BillingSubscription
149
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum BillingResourceType {
2
+ TOURNAMENT_CATEGORY_GROUP = "tournament_category_group"
3
+ }
4
+ //# sourceMappingURL=billing-resource-type.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-resource-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-subscriptions/enums/billing-resource-type.enum.ts"],"names":[],"mappings":"AAUA,oBAAY,mBAAmB;IAI7B,yBAAyB,8BAA8B;CACxD"}
@@ -0,0 +1,7 @@
1
+ var BillingResourceType = /* @__PURE__ */ ((BillingResourceType2) => {
2
+ BillingResourceType2["TOURNAMENT_CATEGORY_GROUP"] = "tournament_category_group";
3
+ return BillingResourceType2;
4
+ })(BillingResourceType || {});
5
+ export {
6
+ BillingResourceType
7
+ };
@@ -0,0 +1,9 @@
1
+ export declare enum BillingSubscriptionStatus {
2
+ INCOMPLETE = "incomplete",
3
+ TRIALING = "trialing",
4
+ ACTIVE = "active",
5
+ PAST_DUE = "past_due",
6
+ SUSPENDED = "suspended",
7
+ CANCELED = "canceled"
8
+ }
9
+ //# sourceMappingURL=billing-subscription-status.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-subscription-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-subscriptions/enums/billing-subscription-status.enum.ts"],"names":[],"mappings":"AAyBA,oBAAY,yBAAyB;IACnC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,QAAQ,aAAa;CACtB"}
@@ -0,0 +1,12 @@
1
+ var BillingSubscriptionStatus = /* @__PURE__ */ ((BillingSubscriptionStatus2) => {
2
+ BillingSubscriptionStatus2["INCOMPLETE"] = "incomplete";
3
+ BillingSubscriptionStatus2["TRIALING"] = "trialing";
4
+ BillingSubscriptionStatus2["ACTIVE"] = "active";
5
+ BillingSubscriptionStatus2["PAST_DUE"] = "past_due";
6
+ BillingSubscriptionStatus2["SUSPENDED"] = "suspended";
7
+ BillingSubscriptionStatus2["CANCELED"] = "canceled";
8
+ return BillingSubscriptionStatus2;
9
+ })(BillingSubscriptionStatus || {});
10
+ export {
11
+ BillingSubscriptionStatus
12
+ };
@@ -0,0 +1,4 @@
1
+ export * from './billing-subscription.entity';
2
+ export * from './enums/billing-resource-type.enum';
3
+ export * from './enums/billing-subscription-status.enum';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-subscriptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./billing-subscription.entity.js";
2
+ export * from "./enums/billing-resource-type.enum.js";
3
+ export * from "./enums/billing-subscription-status.enum.js";
@@ -1,3 +1,6 @@
1
+ export * from './billing-accounts';
1
2
  export * from './billing-prices';
2
3
  export * from './billing-products';
4
+ export * from './billing-subscription-items';
5
+ export * from './billing-subscriptions';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC"}
@@ -1,2 +1,5 @@
1
+ export * from "./billing-accounts/index.js";
1
2
  export * from "./billing-prices/index.js";
2
3
  export * from "./billing-products/index.js";
4
+ export * from "./billing-subscription-items/index.js";
5
+ export * from "./billing-subscriptions/index.js";
@@ -1,5 +1,5 @@
1
1
  import { PasswordReset, RefreshToken, User, UserAuthProvider, UserOnboardingIntent, UserVerification } from '../app-auth';
2
- import { BillingPrice, BillingProduct } from '../billing';
2
+ import { BillingAccount, BillingPrice, BillingProduct, BillingSubscription, BillingSubscriptionItem } from '../billing';
3
3
  import { Organization, OrganizationUser, OrganizationUserBillingInfo, PhoneNumber } from '../central-auth';
4
4
  import { Coupon, CouponUsage } from '../coupons';
5
5
  import { Address, Facility, FacilityImage, FacilityOwner, Field, FieldImage } from '../facilities';
@@ -11,5 +11,5 @@ import { Player, PlayerPersonalData, PlayerPosition } from '../players';
11
11
  import { PlayerTeam, Team, TeamAccessCode, TeamJoinRequest, TeamModality, TeamTrophy } from '../teams';
12
12
  import { RegulationExtraction, Tournament, TournamentAllowedPhone, TournamentBracket, TournamentBracketSlot, TournamentCategoryGroup, TournamentContact, TournamentCoupon, TournamentFacility, TournamentFollow, TournamentFormatConfig, TournamentGroup, TournamentGroupContact, TournamentMatch, TournamentMatchAvailability, TournamentMatchCard, TournamentMatchGoal, TournamentMatchRule, TournamentMatchSchema, TournamentPayment, TournamentPenaltyShootout, TournamentPlayer, TournamentPlayerRule, TournamentPrizeRule, TournamentPublicationChargeRule, TournamentRegistrationRequest, TournamentRegistrationRequirement, TournamentRegulationFieldStatus, TournamentTeam, TournamentTeamInvitation } from '../tournaments';
13
13
  import { UserDomainEvent, UserEventView } from '../user-events';
14
- export declare const DATABASE_ENTITIES: (typeof PasswordReset | typeof Notification | typeof User | typeof NotificationDelivery | typeof NotificationDispatchLog | typeof PushDeviceToken | typeof UserNotificationPreference | typeof TeamPlayerMergeHistory | typeof Team | typeof PlayerTeam | typeof Player | typeof TournamentMatchGoal | typeof TournamentTeam | typeof TournamentMatch | typeof TournamentPlayer | typeof TournamentPenaltyShootout | typeof RegulationExtraction | typeof Tournament | typeof TournamentAllowedPhone | typeof PhoneNumber | typeof TournamentGroupContact | typeof TournamentCategoryGroup | typeof Organization | typeof TournamentContact | typeof Coupon | typeof CouponUsage | typeof TournamentCoupon | typeof FacilityImage | typeof Facility | typeof FacilityOwner | typeof Field | typeof FieldImage | typeof TournamentFacility | typeof TournamentFollow | typeof TournamentFormatConfig | typeof TournamentMatchRule | typeof TournamentMatchSchema | typeof TournamentMatchAvailability | typeof UserPaymentProvider | typeof PaymentProvider | typeof Payment | typeof TournamentPayment | typeof OrganizationUser | typeof TournamentPlayerRule | typeof TournamentPrizeRule | typeof TournamentPublicationChargeRule | typeof TournamentRegistrationRequest | typeof TournamentRegistrationRequirement | typeof TournamentRegulationFieldStatus | typeof TournamentTeamInvitation | typeof Address | typeof OrganizationUserBillingInfo | typeof TournamentGroup | typeof TournamentBracket | typeof TournamentBracketSlot | typeof TeamTrophy | typeof TournamentMatchCard | typeof TeamAccessCode | typeof TeamJoinRequest | typeof TeamModality | typeof PlayerPosition | typeof PlayerPersonalData | typeof UserAuthProvider | typeof RefreshToken | typeof UserOnboardingIntent | typeof UserVerification | typeof BillingProduct | typeof BillingPrice | typeof FeedActivitySubject | typeof FeedActivity | typeof FeedOutbox | typeof UserDomainEvent | typeof UserEventView)[];
14
+ export declare const DATABASE_ENTITIES: (typeof PasswordReset | typeof Notification | typeof User | typeof NotificationDelivery | typeof NotificationDispatchLog | typeof PushDeviceToken | typeof UserNotificationPreference | typeof TeamPlayerMergeHistory | typeof Team | typeof PlayerTeam | typeof Player | typeof TournamentMatchGoal | typeof TournamentTeam | typeof TournamentMatch | typeof TournamentPlayer | typeof TournamentPenaltyShootout | typeof RegulationExtraction | typeof Tournament | typeof TournamentAllowedPhone | typeof PhoneNumber | typeof TournamentGroupContact | typeof TournamentCategoryGroup | typeof Organization | typeof TournamentContact | typeof Coupon | typeof CouponUsage | typeof TournamentCoupon | typeof FacilityImage | typeof Facility | typeof FacilityOwner | typeof Field | typeof FieldImage | typeof TournamentFacility | typeof TournamentFollow | typeof TournamentFormatConfig | typeof TournamentMatchRule | typeof TournamentMatchSchema | typeof TournamentMatchAvailability | typeof UserPaymentProvider | typeof PaymentProvider | typeof Payment | typeof TournamentPayment | typeof OrganizationUser | typeof TournamentPlayerRule | typeof TournamentPrizeRule | typeof TournamentPublicationChargeRule | typeof TournamentRegistrationRequest | typeof TournamentRegistrationRequirement | typeof TournamentRegulationFieldStatus | typeof TournamentTeamInvitation | typeof Address | typeof OrganizationUserBillingInfo | typeof TournamentGroup | typeof TournamentBracket | typeof TournamentBracketSlot | typeof TeamTrophy | typeof TournamentMatchCard | typeof TeamAccessCode | typeof TeamJoinRequest | typeof TeamModality | typeof PlayerPosition | typeof PlayerPersonalData | typeof UserAuthProvider | typeof RefreshToken | typeof UserOnboardingIntent | typeof UserVerification | typeof BillingProduct | typeof BillingPrice | typeof BillingSubscriptionItem | typeof BillingSubscription | typeof BillingAccount | typeof FeedActivitySubject | typeof FeedActivity | typeof FeedOutbox | typeof UserDomainEvent | typeof UserEventView)[];
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database-entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,UAAU,EACV,IAAI,EACJ,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EAEjC,+BAA+B,EAE/B,cAAc,EACd,wBAAwB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,w4DA4E7B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database-entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,UAAU,EACV,IAAI,EACJ,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EAEjC,+BAA+B,EAE/B,cAAc,EACd,wBAAwB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,89DA+E7B,CAAC"}
@@ -6,7 +6,13 @@ import {
6
6
  UserOnboardingIntent,
7
7
  UserVerification
8
8
  } from "../app-auth/index.js";
9
- import { BillingPrice, BillingProduct } from "../billing/index.js";
9
+ import {
10
+ BillingAccount,
11
+ BillingPrice,
12
+ BillingProduct,
13
+ BillingSubscription,
14
+ BillingSubscriptionItem
15
+ } from "../billing/index.js";
10
16
  import {
11
17
  Organization,
12
18
  OrganizationUser,
@@ -73,6 +79,9 @@ const DATABASE_ENTITIES = [
73
79
  Address,
74
80
  BillingProduct,
75
81
  BillingPrice,
82
+ BillingAccount,
83
+ BillingSubscription,
84
+ BillingSubscriptionItem,
76
85
  Coupon,
77
86
  CouponUsage,
78
87
  Facility,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",