@natrave/shared-entities 8.8.0 → 8.9.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-plans/billing-plan.entity.d.ts +2 -0
- package/dist/billing/billing-plans/billing-plan.entity.d.ts.map +1 -1
- package/dist/billing/billing-plans/billing-plan.entity.js +27 -1
- package/dist/billing/billing-subscriptions/billing-subscription.entity.d.ts +1 -0
- package/dist/billing/billing-subscriptions/billing-subscription.entity.d.ts.map +1 -1
- package/dist/billing/billing-subscriptions/billing-subscription.entity.js +8 -0
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@ export declare class BillingPlan {
|
|
|
7
7
|
productId: string;
|
|
8
8
|
internalLabel: string | null;
|
|
9
9
|
amount: number;
|
|
10
|
+
promoAmount: number | null;
|
|
11
|
+
promoWindowDays: number | null;
|
|
10
12
|
chargeType: ChargeType;
|
|
11
13
|
recurringInterval: RecurringInterval | null;
|
|
12
14
|
pricingModel: PricingModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-plan.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-plans/billing-plan.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"billing-plan.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-plans/billing-plan.entity.ts"],"names":[],"mappings":"AAYA,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;AAyBpE,qBAkBa,WAAW;IAItB,EAAE,EAAE,MAAM,CAAC;IAOX,SAAS,EAAE,MAAM,CAAC;IASlB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAM7B,MAAM,EAAE,MAAM,CAAC;IAQf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAS3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAS/B,UAAU,EAAE,UAAU,CAAC;IAUvB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAU5C,YAAY,EAAE,YAAY,CAAC;IAQ3B,eAAe,EAAE,MAAM,CAAC;IAQxB,cAAc,EAAE,MAAM,CAAC;IAQvB,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"}
|
|
@@ -9,6 +9,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
9
9
|
return result;
|
|
10
10
|
};
|
|
11
11
|
import {
|
|
12
|
+
Check,
|
|
12
13
|
Column,
|
|
13
14
|
CreateDateColumn,
|
|
14
15
|
Entity,
|
|
@@ -48,9 +49,25 @@ __decorateClass([
|
|
|
48
49
|
__decorateClass([
|
|
49
50
|
Column({
|
|
50
51
|
type: "int",
|
|
51
|
-
comment: "Valor do plano em centavos."
|
|
52
|
+
comment: "Valor do plano em centavos. Com promo\xE7\xE3o, \xE9 o pre\xE7o cheio (depois da janela)."
|
|
52
53
|
})
|
|
53
54
|
], BillingPlan.prototype, "amount", 2);
|
|
55
|
+
__decorateClass([
|
|
56
|
+
Column({
|
|
57
|
+
name: "promo_amount",
|
|
58
|
+
type: "int",
|
|
59
|
+
nullable: true,
|
|
60
|
+
comment: "Pre\xE7o promocional em centavos, cobrado dentro da janela. Nulo = sem promo\xE7\xE3o."
|
|
61
|
+
})
|
|
62
|
+
], BillingPlan.prototype, "promoAmount", 2);
|
|
63
|
+
__decorateClass([
|
|
64
|
+
Column({
|
|
65
|
+
name: "promo_window_days",
|
|
66
|
+
type: "int",
|
|
67
|
+
nullable: true,
|
|
68
|
+
comment: "Dura\xE7\xE3o da janela promocional em dias (de 24h), contada da cria\xE7\xE3o da assinatura. Nulo = sem promo\xE7\xE3o."
|
|
69
|
+
})
|
|
70
|
+
], BillingPlan.prototype, "promoWindowDays", 2);
|
|
54
71
|
__decorateClass([
|
|
55
72
|
Column({
|
|
56
73
|
name: "charge_type",
|
|
@@ -142,6 +159,15 @@ __decorateClass([
|
|
|
142
159
|
], BillingPlan.prototype, "product", 2);
|
|
143
160
|
BillingPlan = __decorateClass([
|
|
144
161
|
Entity("billing_plans"),
|
|
162
|
+
Check("CHK_billing_plans_promo_pair", '("promo_amount" IS NULL) = ("promo_window_days" IS NULL)'),
|
|
163
|
+
Check(
|
|
164
|
+
"CHK_billing_plans_promo_amount_range",
|
|
165
|
+
'"promo_amount" IS NULL OR ("promo_amount" >= 0 AND "promo_amount" <= "amount")'
|
|
166
|
+
),
|
|
167
|
+
Check(
|
|
168
|
+
"CHK_billing_plans_promo_window_days_positive",
|
|
169
|
+
'"promo_window_days" IS NULL OR "promo_window_days" > 0'
|
|
170
|
+
),
|
|
145
171
|
Index("idx_billing_plans_product", ["productId"]),
|
|
146
172
|
Index("idx_billing_plans_product_valid_from", ["productId", "validFrom"]),
|
|
147
173
|
Index("idx_billing_plans_current", ["productId"], {
|
|
@@ -11,6 +11,7 @@ export declare class BillingSubscription {
|
|
|
11
11
|
trialStartsAt: Date | null;
|
|
12
12
|
trialEndsAt: Date | null;
|
|
13
13
|
freeMatchQuotaOverride: number | null;
|
|
14
|
+
promoEndsAt: Date | null;
|
|
14
15
|
activatedAt: Date | null;
|
|
15
16
|
canceledAt: Date | null;
|
|
16
17
|
currentPeriodStart: Date | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-subscription.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-subscriptions/billing-subscription.entity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"billing-subscription.entity.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-subscriptions/billing-subscription.entity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AA+BrF,qBAca,mBAAmB;IAI9B,EAAE,EAAE,MAAM,CAAC;IAOX,gBAAgB,EAAE,MAAM,CAAC;IASzB,iBAAiB,EAAE,wBAAwB,CAAC;IAO5C,eAAe,EAAE,MAAM,CAAC;IASxB,MAAM,EAAE,yBAAyB,CAAC;IAQlC,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAQ3B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAQzB,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQtC,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"}
|
|
@@ -88,6 +88,14 @@ __decorateClass([
|
|
|
88
88
|
comment: "Cota de partidas gratuitas S\xD3 deste campeonato (cortesia). Nulo = usa a do plano."
|
|
89
89
|
})
|
|
90
90
|
], BillingSubscription.prototype, "freeMatchQuotaOverride", 2);
|
|
91
|
+
__decorateClass([
|
|
92
|
+
Column({
|
|
93
|
+
name: "promo_ends_at",
|
|
94
|
+
type: "timestamptz",
|
|
95
|
+
nullable: true,
|
|
96
|
+
comment: "Fim do pre\xE7o promocional deste campeonato (exclusivo). Nulo = sem promo\xE7\xE3o."
|
|
97
|
+
})
|
|
98
|
+
], BillingSubscription.prototype, "promoEndsAt", 2);
|
|
91
99
|
__decorateClass([
|
|
92
100
|
Column({
|
|
93
101
|
name: "activated_at",
|