@asumano/worklip-typeorm-db 1.1.87 → 1.1.88

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.
@@ -13,6 +13,7 @@ export declare class BillingInvoice {
13
13
  discount: number;
14
14
  tax: number;
15
15
  total: number;
16
+ currency: string;
16
17
  status: number;
17
18
  due_date: Date;
18
19
  paid_date: Date | null;
@@ -114,6 +114,15 @@ __decorate([
114
114
  }),
115
115
  __metadata("design:type", Number)
116
116
  ], BillingInvoice.prototype, "total", void 0);
117
+ __decorate([
118
+ (0, typeorm_1.Column)({
119
+ length: 10,
120
+ type: "varchar",
121
+ default: "COP",
122
+ comment: "Moneda de la factura (ISO 4217).",
123
+ }),
124
+ __metadata("design:type", String)
125
+ ], BillingInvoice.prototype, "currency", void 0);
117
126
  __decorate([
118
127
  (0, typeorm_1.Column)({
119
128
  default: 1,
@@ -13,6 +13,7 @@ export declare class CompanySubscription {
13
13
  end_date: string | null;
14
14
  billing_day: number;
15
15
  price_monthly: number;
16
+ currency: string;
16
17
  status: number;
17
18
  created: Date;
18
19
  updated: Date | null;
@@ -95,6 +95,15 @@ __decorate([
95
95
  }),
96
96
  __metadata("design:type", Number)
97
97
  ], CompanySubscription.prototype, "price_monthly", void 0);
98
+ __decorate([
99
+ (0, typeorm_1.Column)({
100
+ length: 10,
101
+ type: "varchar",
102
+ default: "COP",
103
+ comment: "Moneda en la que se cobra la suscripción (ISO 4217).",
104
+ }),
105
+ __metadata("design:type", String)
106
+ ], CompanySubscription.prototype, "currency", void 0);
98
107
  __decorate([
99
108
  (0, typeorm_1.Column)({
100
109
  default: 1,
@@ -1,4 +1,4 @@
1
- import { Company, CompanyDiscount } from "../entities.views.routes";
1
+ import { Company, CompanyDiscount, Country } from "../entities.views.routes";
2
2
  export declare class DiscountCode {
3
3
  id: number;
4
4
  code: string;
@@ -6,6 +6,7 @@ export declare class DiscountCode {
6
6
  description: string | null;
7
7
  type: number;
8
8
  value: number;
9
+ country: Country;
9
10
  applies_to_plan: number;
10
11
  applies_to_addons: number;
11
12
  applies_to_features: number;
@@ -17,6 +17,7 @@ const entities_views_routes_1 = require("../entities.views.routes");
17
17
  // El código dice QUÉ descuenta (porcentaje o monto), SOBRE QUÉ (plan, complementos,
18
18
  // funcionalidades, o varias), CUÁNTO dura una vez canjeado, hasta cuándo se puede canjear y
19
19
  // quién lo puede canjear. El canje en sí vive en `company_discount`.
20
+ // DOC: El código es único POR PAÍS: el mismo PRO puede existir en dos catálogos.
20
21
  let DiscountCode = class DiscountCode {
21
22
  };
22
23
  exports.DiscountCode = DiscountCode;
@@ -31,7 +32,6 @@ __decorate([
31
32
  (0, typeorm_1.Column)({
32
33
  length: 30,
33
34
  type: "varchar",
34
- unique: true,
35
35
  comment: "Código que escribe la empresa (ej: WELCOME20). Se guarda en mayúsculas.",
36
36
  }),
37
37
  __metadata("design:type", String)
@@ -70,6 +70,11 @@ __decorate([
70
70
  }),
71
71
  __metadata("design:type", Number)
72
72
  ], DiscountCode.prototype, "value", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.ManyToOne)(() => entities_views_routes_1.Country, { onDelete: "RESTRICT", onUpdate: "NO ACTION" }),
75
+ (0, typeorm_1.JoinColumn)({ name: "country" }),
76
+ __metadata("design:type", entities_views_routes_1.Country)
77
+ ], DiscountCode.prototype, "country", void 0);
73
78
  __decorate([
74
79
  (0, typeorm_1.Column)({
75
80
  default: 1,
@@ -196,6 +201,7 @@ __decorate([
196
201
  __metadata("design:type", Array)
197
202
  ], DiscountCode.prototype, "redemptions", void 0);
198
203
  exports.DiscountCode = DiscountCode = __decorate([
204
+ (0, typeorm_1.Index)("UQ_discount_code_country_code", ["country", "code"], { unique: true }),
199
205
  (0, typeorm_1.Entity)({
200
206
  comment: "Catálogo de códigos de descuento.",
201
207
  name: "discount_code",
@@ -1,4 +1,4 @@
1
- import { AssociatePermission, AssociateSection, CompanyFeature, PlanFeature } from "../entities.views.routes";
1
+ import { AssociatePermission, AssociateSection, CompanyFeature, Country, PlanFeature } from "../entities.views.routes";
2
2
  export declare class Feature {
3
3
  id: number;
4
4
  code: string;
@@ -7,6 +7,7 @@ export declare class Feature {
7
7
  icon: string;
8
8
  scope: number;
9
9
  monthly_price: number;
10
+ country: Country;
10
11
  status: number;
11
12
  created: Date;
12
13
  updated: Date | null;
@@ -20,6 +20,7 @@ const entities_views_routes_1 = require("../entities.views.routes");
20
20
  // Mezclarlas en la misma tabla se descartó a propósito: los complementos alimentan las
21
21
  // Alertas de consumo ("cómprame otro paquete al llegar al 80%"), y eso no significa nada
22
22
  // para algo booleano.
23
+ // DOC: El código es único POR PAÍS: el mismo PRO puede existir en dos catálogos.
23
24
  let Feature = class Feature {
24
25
  };
25
26
  exports.Feature = Feature;
@@ -34,7 +35,6 @@ __decorate([
34
35
  (0, typeorm_1.Column)({
35
36
  length: 30,
36
37
  type: "varchar",
37
- unique: true,
38
38
  comment: "Código único de la funcionalidad (ej: WORK_BOARD).",
39
39
  }),
40
40
  __metadata("design:type", String)
@@ -81,6 +81,11 @@ __decorate([
81
81
  }),
82
82
  __metadata("design:type", Number)
83
83
  ], Feature.prototype, "monthly_price", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.ManyToOne)(() => entities_views_routes_1.Country, { onDelete: "RESTRICT", onUpdate: "NO ACTION" }),
86
+ (0, typeorm_1.JoinColumn)({ name: "country" }),
87
+ __metadata("design:type", entities_views_routes_1.Country)
88
+ ], Feature.prototype, "country", void 0);
84
89
  __decorate([
85
90
  (0, typeorm_1.Column)({
86
91
  default: 1,
@@ -125,6 +130,7 @@ __decorate([
125
130
  __metadata("design:type", Array)
126
131
  ], Feature.prototype, "permissions", void 0);
127
132
  exports.Feature = Feature = __decorate([
133
+ (0, typeorm_1.Index)("UQ_feature_country_code", ["country", "code"], { unique: true }),
128
134
  (0, typeorm_1.Entity)({
129
135
  comment: "Catálogo de funcionalidades que se pueden contratar aparte del plan.",
130
136
  name: "feature",
@@ -1,3 +1,4 @@
1
+ import { Country } from "./Country";
1
2
  import { UsageAlert } from "./UsageAlert";
2
3
  import { SubscriptionAddon } from "./SubscriptionAddon";
3
4
  export declare class SubscriptionAddonTemplate {
@@ -8,6 +9,7 @@ export declare class SubscriptionAddonTemplate {
8
9
  addon_type: number;
9
10
  quantity: number;
10
11
  monthly_price: number;
12
+ country: Country;
11
13
  status: number;
12
14
  created: Date;
13
15
  updated: Date | null;
@@ -11,8 +11,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SubscriptionAddonTemplate = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
+ const Country_1 = require("./Country");
14
15
  const UsageAlert_1 = require("./UsageAlert");
15
16
  const SubscriptionAddon_1 = require("./SubscriptionAddon");
17
+ // DOC: El código es único POR PAÍS: el mismo PRO puede existir en dos catálogos.
16
18
  let SubscriptionAddonTemplate = class SubscriptionAddonTemplate {
17
19
  };
18
20
  exports.SubscriptionAddonTemplate = SubscriptionAddonTemplate;
@@ -27,7 +29,6 @@ __decorate([
27
29
  (0, typeorm_1.Column)({
28
30
  length: 20,
29
31
  type: "varchar",
30
- unique: true,
31
32
  comment: "Código único del paquete.",
32
33
  }),
33
34
  __metadata("design:type", String)
@@ -70,6 +71,11 @@ __decorate([
70
71
  }),
71
72
  __metadata("design:type", Number)
72
73
  ], SubscriptionAddonTemplate.prototype, "monthly_price", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.ManyToOne)(() => Country_1.Country, { onDelete: "RESTRICT", onUpdate: "NO ACTION" }),
76
+ (0, typeorm_1.JoinColumn)({ name: "country" }),
77
+ __metadata("design:type", Country_1.Country)
78
+ ], SubscriptionAddonTemplate.prototype, "country", void 0);
73
79
  __decorate([
74
80
  (0, typeorm_1.Column)({
75
81
  default: 1,
@@ -106,6 +112,7 @@ __decorate([
106
112
  __metadata("design:type", Array)
107
113
  ], SubscriptionAddonTemplate.prototype, "subscription_addons", void 0);
108
114
  exports.SubscriptionAddonTemplate = SubscriptionAddonTemplate = __decorate([
115
+ (0, typeorm_1.Index)("UQ_subscription_addon_template_country_code", ["country", "code"], { unique: true }),
109
116
  (0, typeorm_1.Entity)({
110
117
  comment: "Catálogo de paquetes adicionales que pueden ser adquiridos por las empresas.",
111
118
  name: "subscription_addon_template",
@@ -1,4 +1,5 @@
1
1
  import { Company } from "./Company";
2
+ import { Country } from "./Country";
2
3
  import { CompanySubscription } from "./CompanySubscription";
3
4
  import { PlanFeature } from "./PlanFeature";
4
5
  export declare class SubscriptionPlan {
@@ -7,6 +8,7 @@ export declare class SubscriptionPlan {
7
8
  name: string;
8
9
  description: string | null;
9
10
  price_monthly: number;
11
+ country: Country;
10
12
  included_storage_gb: number;
11
13
  included_whatsapp_messages: number;
12
14
  included_emails: number;
@@ -12,8 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SubscriptionPlan = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const Company_1 = require("./Company");
15
+ const Country_1 = require("./Country");
15
16
  const CompanySubscription_1 = require("./CompanySubscription");
16
17
  const PlanFeature_1 = require("./PlanFeature");
18
+ // DOC: El código es único POR PAÍS: el mismo PRO puede existir en dos catálogos.
17
19
  let SubscriptionPlan = class SubscriptionPlan {
18
20
  };
19
21
  exports.SubscriptionPlan = SubscriptionPlan;
@@ -28,7 +30,6 @@ __decorate([
28
30
  (0, typeorm_1.Column)({
29
31
  length: 15,
30
32
  type: "varchar",
31
- unique: true,
32
33
  comment: "Código único del plan.",
33
34
  }),
34
35
  __metadata("design:type", String)
@@ -51,10 +52,15 @@ __decorate([
51
52
  type: "decimal",
52
53
  precision: 14,
53
54
  scale: 2,
54
- comment: "Precio del plan.",
55
+ comment: "Precio del plan, en la moneda del país.",
55
56
  }),
56
57
  __metadata("design:type", Number)
57
58
  ], SubscriptionPlan.prototype, "price_monthly", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.ManyToOne)(() => Country_1.Country, { onDelete: "RESTRICT", onUpdate: "NO ACTION" }),
61
+ (0, typeorm_1.JoinColumn)({ name: "country" }),
62
+ __metadata("design:type", Country_1.Country)
63
+ ], SubscriptionPlan.prototype, "country", void 0);
58
64
  __decorate([
59
65
  (0, typeorm_1.Column)({
60
66
  default: 0,
@@ -161,5 +167,6 @@ __decorate([
161
167
  __metadata("design:type", Array)
162
168
  ], SubscriptionPlan.prototype, "plan_features", void 0);
163
169
  exports.SubscriptionPlan = SubscriptionPlan = __decorate([
170
+ (0, typeorm_1.Index)("UQ_subscription_plan_country_code", ["country", "code"], { unique: true }),
164
171
  (0, typeorm_1.Entity)({ comment: "Planes que tiene el software.", name: "subscription_plan" })
165
172
  ], SubscriptionPlan);
@@ -6,6 +6,10 @@ export declare class SubscriptionAddonTemplates {
6
6
  addon_type: number;
7
7
  quantity: number;
8
8
  monthly_price: number;
9
+ country: number;
10
+ country_name: string;
11
+ country_currency: string;
12
+ country_locale: string | null;
9
13
  status: number;
10
14
  created: Date;
11
15
  updated: Date | null;
@@ -42,6 +42,22 @@ __decorate([
42
42
  (0, typeorm_1.ViewColumn)(),
43
43
  __metadata("design:type", Number)
44
44
  ], SubscriptionAddonTemplates.prototype, "monthly_price", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.ViewColumn)(),
47
+ __metadata("design:type", Number)
48
+ ], SubscriptionAddonTemplates.prototype, "country", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.ViewColumn)(),
51
+ __metadata("design:type", String)
52
+ ], SubscriptionAddonTemplates.prototype, "country_name", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.ViewColumn)(),
55
+ __metadata("design:type", String)
56
+ ], SubscriptionAddonTemplates.prototype, "country_currency", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.ViewColumn)(),
59
+ __metadata("design:type", Object)
60
+ ], SubscriptionAddonTemplates.prototype, "country_locale", void 0);
45
61
  __decorate([
46
62
  (0, typeorm_1.ViewColumn)(),
47
63
  __metadata("design:type", Number)
@@ -14,6 +14,10 @@ export declare class SubscriptionPlans {
14
14
  is_custom: number;
15
15
  company: number | null;
16
16
  company_name: string | null;
17
+ country: number;
18
+ country_name: string;
19
+ country_currency: string;
20
+ country_locale: string | null;
17
21
  status: number;
18
22
  created: Date;
19
23
  updated: Date | null;
@@ -74,6 +74,22 @@ __decorate([
74
74
  (0, typeorm_1.ViewColumn)(),
75
75
  __metadata("design:type", Object)
76
76
  ], SubscriptionPlans.prototype, "company_name", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.ViewColumn)(),
79
+ __metadata("design:type", Number)
80
+ ], SubscriptionPlans.prototype, "country", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.ViewColumn)(),
83
+ __metadata("design:type", String)
84
+ ], SubscriptionPlans.prototype, "country_name", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.ViewColumn)(),
87
+ __metadata("design:type", String)
88
+ ], SubscriptionPlans.prototype, "country_currency", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.ViewColumn)(),
91
+ __metadata("design:type", Object)
92
+ ], SubscriptionPlans.prototype, "country_locale", void 0);
77
93
  __decorate([
78
94
  (0, typeorm_1.ViewColumn)(),
79
95
  __metadata("design:type", Number)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asumano/worklip-typeorm-db",
3
- "version": "1.1.87",
3
+ "version": "1.1.88",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },