easywork-common-lib 1.0.963 → 1.0.970
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/entities/otp-log.entity.d.ts +4 -2
- package/dist/entities/otp-log.entity.js +15 -3
- package/dist/entities/otp-log.entity.js.map +1 -1
- package/dist/entities/subscriptions/subscription.entity.d.ts +4 -4
- package/dist/entities/subscriptions/subscription.entity.js +17 -17
- package/dist/entities/subscriptions/subscription.entity.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { EntityBase } from
|
|
2
|
-
import { User } from
|
|
1
|
+
import { EntityBase } from '../common/database/base.entity';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
3
|
export declare class OtpLog extends EntityBase {
|
|
4
4
|
expiresIn: Date;
|
|
5
5
|
otpCode?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
phone?: string;
|
|
6
8
|
user: User;
|
|
7
9
|
isUsed?: boolean;
|
|
8
10
|
}
|
|
@@ -17,13 +17,15 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
17
17
|
let OtpLog = class OtpLog extends base_entity_1.EntityBase {
|
|
18
18
|
expiresIn;
|
|
19
19
|
otpCode;
|
|
20
|
+
email;
|
|
21
|
+
phone;
|
|
20
22
|
user;
|
|
21
23
|
isUsed;
|
|
22
24
|
};
|
|
23
25
|
exports.OtpLog = OtpLog;
|
|
24
26
|
__decorate([
|
|
25
27
|
(0, swagger_1.ApiProperty)({ type: Date, description: 'Expiration time of the OTP code' }),
|
|
26
|
-
(0, typeorm_1.Column)({ type:
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'timestamp' }),
|
|
27
29
|
__metadata("design:type", Date)
|
|
28
30
|
], OtpLog.prototype, "expiresIn", void 0);
|
|
29
31
|
__decorate([
|
|
@@ -31,9 +33,19 @@ __decorate([
|
|
|
31
33
|
(0, typeorm_1.Column)({ length: 20, nullable: true }),
|
|
32
34
|
__metadata("design:type", String)
|
|
33
35
|
], OtpLog.prototype, "otpCode", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Email to compare at verification process', required: false }),
|
|
38
|
+
(0, typeorm_1.Column)({ length: 254, nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], OtpLog.prototype, "email", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Phone to compare at verification process', maxLength: 20, required: false }),
|
|
43
|
+
(0, typeorm_1.Column)({ length: 20, nullable: true }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], OtpLog.prototype, "phone", void 0);
|
|
34
46
|
__decorate([
|
|
35
47
|
(0, swagger_1.ApiProperty)({ type: () => user_entity_1.User, description: 'User associated with the OTP log' }),
|
|
36
|
-
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { eager: false, nullable:
|
|
48
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { eager: false, nullable: true }),
|
|
37
49
|
(0, typeorm_1.JoinColumn)(),
|
|
38
50
|
__metadata("design:type", user_entity_1.User)
|
|
39
51
|
], OtpLog.prototype, "user", void 0);
|
|
@@ -44,6 +56,6 @@ __decorate([
|
|
|
44
56
|
], OtpLog.prototype, "isUsed", void 0);
|
|
45
57
|
exports.OtpLog = OtpLog = __decorate([
|
|
46
58
|
(0, typeorm_1.Entity)(),
|
|
47
|
-
(0, typeorm_1.Index)([
|
|
59
|
+
(0, typeorm_1.Index)(['otpCode'], { unique: true })
|
|
48
60
|
], OtpLog);
|
|
49
61
|
//# sourceMappingURL=otp-log.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-log.entity.js","sourceRoot":"","sources":["../../src/entities/otp-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,gEAA4D;AAC5D,+CAAqC;A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AC;IACtH,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCACxB;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAClF,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,IAAA,oBAAU,GAAE;8BACN,kBAAI;oCAAC;AAIZ;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzF,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;sCACV;iBAxBN,MAAM;IAFlB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACxB,MAAM,CAyBlB"}
|
|
@@ -12,10 +12,8 @@ export declare enum SubscriptionStatus {
|
|
|
12
12
|
PENDING_PAYMENT = "pending_payment"
|
|
13
13
|
}
|
|
14
14
|
export declare class Subscription extends BaseEntityOnlyEssential {
|
|
15
|
-
groupId:
|
|
16
|
-
|
|
17
|
-
planId: number;
|
|
18
|
-
plan: Plan;
|
|
15
|
+
groupId: string;
|
|
16
|
+
planId: string;
|
|
19
17
|
subscriptionStatus: SubscriptionStatus;
|
|
20
18
|
currentPeriodStartsAt: Date | null;
|
|
21
19
|
currentPeriodEndsAt: Date | null;
|
|
@@ -24,4 +22,6 @@ export declare class Subscription extends BaseEntityOnlyEssential {
|
|
|
24
22
|
accessEndsAt: Date | null;
|
|
25
23
|
paymentGatewaySubscriptionId: string | null;
|
|
26
24
|
paymentHistory: PaymentHistory;
|
|
25
|
+
group: Group;
|
|
26
|
+
plan: Plan;
|
|
27
27
|
}
|
|
@@ -28,9 +28,7 @@ var SubscriptionStatus;
|
|
|
28
28
|
})(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
|
|
29
29
|
let Subscription = class Subscription extends base_entity_1.BaseEntityOnlyEssential {
|
|
30
30
|
groupId;
|
|
31
|
-
group;
|
|
32
31
|
planId;
|
|
33
|
-
plan;
|
|
34
32
|
subscriptionStatus;
|
|
35
33
|
currentPeriodStartsAt;
|
|
36
34
|
currentPeriodEndsAt;
|
|
@@ -39,30 +37,22 @@ let Subscription = class Subscription extends base_entity_1.BaseEntityOnlyEssent
|
|
|
39
37
|
accessEndsAt;
|
|
40
38
|
paymentGatewaySubscriptionId;
|
|
41
39
|
paymentHistory;
|
|
40
|
+
group;
|
|
41
|
+
plan;
|
|
42
42
|
};
|
|
43
43
|
exports.Subscription = Subscription;
|
|
44
44
|
__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ type: '
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
46
46
|
(0, swagger_1.ApiProperty)({ description: 'ID del espacio de trabajo asociado', example: 101 }),
|
|
47
|
-
__metadata("design:type",
|
|
47
|
+
__metadata("design:type", String)
|
|
48
48
|
], Subscription.prototype, "groupId", void 0);
|
|
49
49
|
__decorate([
|
|
50
|
-
(0, typeorm_1.
|
|
51
|
-
(0, typeorm_1.JoinColumn)({ name: 'group_id' }),
|
|
52
|
-
__metadata("design:type", group_entity_1.Group)
|
|
53
|
-
], Subscription.prototype, "group", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: false }),
|
|
56
51
|
(0, swagger_1.ApiProperty)({ description: 'ID del plan de suscripción asociado', example: 1 }),
|
|
57
|
-
__metadata("design:type",
|
|
52
|
+
__metadata("design:type", String)
|
|
58
53
|
], Subscription.prototype, "planId", void 0);
|
|
59
54
|
__decorate([
|
|
60
|
-
(0, typeorm_1.
|
|
61
|
-
(0, typeorm_1.JoinColumn)({ name: 'plan_id' }),
|
|
62
|
-
__metadata("design:type", plan_entity_1.Plan)
|
|
63
|
-
], Subscription.prototype, "plan", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, typeorm_1.Column)({ type: 'enum', enum: SubscriptionStatus, nullable: false }),
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: SubscriptionStatus, nullable: false, default: SubscriptionStatus.ACTIVE }),
|
|
66
56
|
(0, swagger_1.ApiProperty)({
|
|
67
57
|
description: 'Estado actual de la suscripción',
|
|
68
58
|
enum: SubscriptionStatus,
|
|
@@ -128,6 +118,16 @@ __decorate([
|
|
|
128
118
|
(0, typeorm_1.OneToMany)(() => payment_history_entity_1.PaymentHistory, paymentHistory => paymentHistory.subscription),
|
|
129
119
|
__metadata("design:type", payment_history_entity_1.PaymentHistory)
|
|
130
120
|
], Subscription.prototype, "paymentHistory", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, typeorm_1.ManyToOne)(() => group_entity_1.Group, group => group.subscription, { onDelete: 'CASCADE', nullable: true }),
|
|
123
|
+
(0, typeorm_1.JoinColumn)({ name: 'group_id' }),
|
|
124
|
+
__metadata("design:type", group_entity_1.Group)
|
|
125
|
+
], Subscription.prototype, "group", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.ManyToOne)(() => plan_entity_1.Plan, plan => plan.subscription, { onDelete: 'RESTRICT' }),
|
|
128
|
+
(0, typeorm_1.JoinColumn)({ name: 'plan_id' }),
|
|
129
|
+
__metadata("design:type", plan_entity_1.Plan)
|
|
130
|
+
], Subscription.prototype, "plan", void 0);
|
|
131
131
|
exports.Subscription = Subscription = __decorate([
|
|
132
132
|
(0, typeorm_1.Entity)('subscriptions')
|
|
133
133
|
], Subscription);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.entity.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/subscription.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA2E;AAC3E,6CAA8C;AAC9C,+CAAqC;AACrC,mEAA4E;AAC5E,kDAAwC;AACxC,qEAA0D;AAE1D,IAAY,kBAQX;AARD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,yDAAmC,CAAA;AACrC,CAAC,EARW,kBAAkB,kCAAlB,kBAAkB,QAQ7B;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,qCAAuB;IAGvD,OAAO,CAAS;IAIhB,
|
|
1
|
+
{"version":3,"file":"subscription.entity.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/subscription.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA2E;AAC3E,6CAA8C;AAC9C,+CAAqC;AACrC,mEAA4E;AAC5E,kDAAwC;AACxC,qEAA0D;AAE1D,IAAY,kBAQX;AARD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,yDAAmC,CAAA;AACrC,CAAC,EARW,kBAAkB,kCAAlB,kBAAkB,QAQ7B;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,qCAAuB;IAGvD,OAAO,CAAS;IAIhB,MAAM,CAAS;IAQf,kBAAkB,CAAqB;IAQvC,qBAAqB,CAAc;IAQnC,mBAAmB,CAAc;IAQjC,WAAW,CAAc;IAQzB,UAAU,CAAc;IAQxB,YAAY,CAAc;IAQ1B,4BAA4B,CAAgB;IAG5C,cAAc,CAAiB;IAI/B,KAAK,CAAQ;IAIb,IAAI,CAAO;CACZ,CAAA;AA3EY,oCAAY;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