easywork-common-lib 1.0.954 → 1.0.956
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/company.entity.d.ts +14 -0
- package/dist/entities/company.entity.js +118 -0
- package/dist/entities/company.entity.js.map +1 -0
- package/dist/entities/group.entity.d.ts +11 -5
- package/dist/entities/group.entity.js +22 -4
- package/dist/entities/group.entity.js.map +1 -1
- package/dist/entities/index.d.ts +40 -37
- package/dist/entities/index.js +3 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/subscriptions/payment-history.entity.d.ts +24 -0
- package/dist/entities/subscriptions/payment-history.entity.js +124 -0
- package/dist/entities/subscriptions/payment-history.entity.js.map +1 -0
- package/dist/entities/subscriptions/plan.entity.d.ts +19 -0
- package/dist/entities/subscriptions/plan.entity.js +104 -0
- package/dist/entities/subscriptions/plan.entity.js.map +1 -0
- package/dist/entities/subscriptions/subscription.entity.d.ts +27 -0
- package/dist/entities/subscriptions/subscription.entity.js +134 -0
- package/dist/entities/subscriptions/subscription.entity.js.map +1 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EntityBase } from '../common/database/base.entity';
|
|
2
|
+
import { Group } from './group.entity';
|
|
3
|
+
export declare class Company extends EntityBase {
|
|
4
|
+
businessName: string;
|
|
5
|
+
businessType: string;
|
|
6
|
+
rfc: string;
|
|
7
|
+
address: string;
|
|
8
|
+
zipCode: string;
|
|
9
|
+
city: string;
|
|
10
|
+
state: string;
|
|
11
|
+
source: string;
|
|
12
|
+
logo: string;
|
|
13
|
+
group: Group;
|
|
14
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Company = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("../common/database/base.entity");
|
|
15
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
16
|
+
const group_entity_1 = require("./group.entity");
|
|
17
|
+
let Company = class Company extends base_entity_1.EntityBase {
|
|
18
|
+
businessName;
|
|
19
|
+
businessType;
|
|
20
|
+
rfc;
|
|
21
|
+
address;
|
|
22
|
+
zipCode;
|
|
23
|
+
city;
|
|
24
|
+
state;
|
|
25
|
+
source;
|
|
26
|
+
logo;
|
|
27
|
+
group;
|
|
28
|
+
};
|
|
29
|
+
exports.Company = Company;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ unique: true }),
|
|
32
|
+
(0, swagger_1.ApiProperty)({
|
|
33
|
+
description: 'Nombre comercial del negocio',
|
|
34
|
+
example: 'Mi Tienda S.A. de C.V.',
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Company.prototype, "businessName", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)(),
|
|
40
|
+
(0, swagger_1.ApiProperty)({
|
|
41
|
+
description: 'Tipo de negocio (ej. minorista, servicios, manufactura)',
|
|
42
|
+
example: 'Minorista',
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], Company.prototype, "businessType", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ unique: true }),
|
|
48
|
+
(0, swagger_1.ApiProperty)({
|
|
49
|
+
description: 'Registro Federal de Contribuyentes (RFC) del negocio',
|
|
50
|
+
example: 'XAXX010101000',
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], Company.prototype, "rfc", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)(),
|
|
56
|
+
(0, swagger_1.ApiProperty)({
|
|
57
|
+
description: 'Dirección física del negocio',
|
|
58
|
+
example: 'Calle Falsa 123, Colonia Inventada',
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], Company.prototype, "address", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ length: 10 }),
|
|
64
|
+
(0, swagger_1.ApiProperty)({
|
|
65
|
+
description: 'Código postal del negocio',
|
|
66
|
+
example: '01234',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], Company.prototype, "zipCode", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)(),
|
|
72
|
+
(0, swagger_1.ApiProperty)({
|
|
73
|
+
description: 'Ciudad donde se encuentra el negocio',
|
|
74
|
+
example: 'Ciudad de México',
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], Company.prototype, "city", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)(),
|
|
80
|
+
(0, swagger_1.ApiProperty)({
|
|
81
|
+
description: 'Estado o provincia donde se encuentra el negocio',
|
|
82
|
+
example: 'Ciudad de México',
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], Company.prototype, "state", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
88
|
+
(0, swagger_1.ApiProperty)({
|
|
89
|
+
description: 'Fuente de donde se obtuvo la información del negocio (ej. sitio web, base de datos externa)',
|
|
90
|
+
example: 'Página web oficial',
|
|
91
|
+
required: false,
|
|
92
|
+
}),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], Company.prototype, "source", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
97
|
+
(0, swagger_1.ApiProperty)({
|
|
98
|
+
description: 'URL del logo del negocio',
|
|
99
|
+
example: 'https://ejemplo.com/logo.png',
|
|
100
|
+
required: false,
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], Company.prototype, "logo", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, swagger_1.ApiProperty)({
|
|
106
|
+
type: () => group_entity_1.Group,
|
|
107
|
+
description: 'Groups assigned to the user',
|
|
108
|
+
}),
|
|
109
|
+
(0, typeorm_1.ManyToOne)(() => group_entity_1.Group, group => group.users, {
|
|
110
|
+
onDelete: 'CASCADE',
|
|
111
|
+
onUpdate: 'CASCADE',
|
|
112
|
+
}),
|
|
113
|
+
__metadata("design:type", group_entity_1.Group)
|
|
114
|
+
], Company.prototype, "group", void 0);
|
|
115
|
+
exports.Company = Company = __decorate([
|
|
116
|
+
(0, typeorm_1.Entity)()
|
|
117
|
+
], Company);
|
|
118
|
+
//# sourceMappingURL=company.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company.entity.js","sourceRoot":"","sources":["../../src/entities/company.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,gEAA4D;AAC5D,6CAA8C;AAC9C,iDAAuC;AAGhC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,wBAAU;IAMrC,YAAY,CAAS;IAOrB,YAAY,CAAS;IAOrB,GAAG,CAAS;IAOZ,OAAO,CAAS;IAO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AW,EAAE,6FAA6F;QAC1G,OAAO,EAAE,oBAAoB;QAC7B,QAAQ,EAAE,KAAK;KAChB,CAAC;;uCACa;AAQf;IANC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,8BAA8B;QACvC,QAAQ,EAAE,KAAK;KAChB,CAAC;;qCACW;AAUb;IARC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAK;QACjB,WAAW,EAAE,6BAA6B;KAC3C,CAAC;IACD,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;QAC5C,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;8BACK,oBAAK;sCAAC;kBA1EF,OAAO;IADnB,IAAA,gBAAM,GAAE;GACI,OAAO,CA2EnB"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { EntityBase } from
|
|
2
|
-
import { User } from
|
|
3
|
-
import { Course } from
|
|
4
|
-
import { AgenteIntermediario } from
|
|
5
|
-
import { Agent } from
|
|
1
|
+
import { EntityBase } from '../common/database/base.entity';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
import { Course } from './capacitation';
|
|
4
|
+
import { AgenteIntermediario } from './sales/agente-intermediario.entity';
|
|
5
|
+
import { Agent } from './sales';
|
|
6
|
+
import { Company } from './company.entity';
|
|
7
|
+
import { Subscription } from './subscriptions/subscription.entity';
|
|
8
|
+
import { PaymentHistory } from './subscriptions/payment-history.entity';
|
|
6
9
|
export declare class Group extends EntityBase {
|
|
7
10
|
name: string;
|
|
8
11
|
level: number;
|
|
9
12
|
users: User[];
|
|
10
13
|
courses: Course[];
|
|
14
|
+
company: Company;
|
|
15
|
+
paymentHistory: PaymentHistory;
|
|
16
|
+
subscription: Subscription;
|
|
11
17
|
agenteIntermediarios: AgenteIntermediario[];
|
|
12
18
|
subAgentes: Agent[];
|
|
13
19
|
}
|
|
@@ -17,11 +17,17 @@ const user_entity_1 = require("./user.entity");
|
|
|
17
17
|
const capacitation_1 = require("./capacitation");
|
|
18
18
|
const agente_intermediario_entity_1 = require("./sales/agente-intermediario.entity");
|
|
19
19
|
const sales_1 = require("./sales");
|
|
20
|
+
const company_entity_1 = require("./company.entity");
|
|
21
|
+
const subscription_entity_1 = require("./subscriptions/subscription.entity");
|
|
22
|
+
const payment_history_entity_1 = require("./subscriptions/payment-history.entity");
|
|
20
23
|
let Group = class Group extends base_entity_1.EntityBase {
|
|
21
24
|
name;
|
|
22
25
|
level;
|
|
23
26
|
users;
|
|
24
27
|
courses;
|
|
28
|
+
company;
|
|
29
|
+
paymentHistory;
|
|
30
|
+
subscription;
|
|
25
31
|
agenteIntermediarios;
|
|
26
32
|
subAgentes;
|
|
27
33
|
};
|
|
@@ -36,19 +42,31 @@ __decorate([
|
|
|
36
42
|
__metadata("design:type", Number)
|
|
37
43
|
], Group.prototype, "level", void 0);
|
|
38
44
|
__decorate([
|
|
39
|
-
(0, typeorm_1.ManyToMany)(() => user_entity_1.User,
|
|
45
|
+
(0, typeorm_1.ManyToMany)(() => user_entity_1.User, user => user.groups),
|
|
40
46
|
__metadata("design:type", Array)
|
|
41
47
|
], Group.prototype, "users", void 0);
|
|
42
48
|
__decorate([
|
|
43
|
-
(0, typeorm_1.ManyToMany)(() => capacitation_1.Course,
|
|
49
|
+
(0, typeorm_1.ManyToMany)(() => capacitation_1.Course, course => course.groups),
|
|
44
50
|
__metadata("design:type", Array)
|
|
45
51
|
], Group.prototype, "courses", void 0);
|
|
46
52
|
__decorate([
|
|
47
|
-
(0, typeorm_1.OneToMany)(() =>
|
|
53
|
+
(0, typeorm_1.OneToMany)(() => company_entity_1.Company, company => company.group),
|
|
54
|
+
__metadata("design:type", company_entity_1.Company)
|
|
55
|
+
], Group.prototype, "company", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.OneToMany)(() => payment_history_entity_1.PaymentHistory, paymentHistory => paymentHistory.group),
|
|
58
|
+
__metadata("design:type", payment_history_entity_1.PaymentHistory)
|
|
59
|
+
], Group.prototype, "paymentHistory", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.OneToOne)(() => subscription_entity_1.Subscription, subscription => subscription.group),
|
|
62
|
+
__metadata("design:type", subscription_entity_1.Subscription)
|
|
63
|
+
], Group.prototype, "subscription", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.OneToMany)(() => agente_intermediario_entity_1.AgenteIntermediario, agenteIntermediario => agenteIntermediario.group),
|
|
48
66
|
__metadata("design:type", Array)
|
|
49
67
|
], Group.prototype, "agenteIntermediarios", void 0);
|
|
50
68
|
__decorate([
|
|
51
|
-
(0, typeorm_1.OneToMany)(() => sales_1.Agent,
|
|
69
|
+
(0, typeorm_1.OneToMany)(() => sales_1.Agent, agente => agente.group),
|
|
52
70
|
__metadata("design:type", Array)
|
|
53
71
|
], Group.prototype, "subAgentes", void 0);
|
|
54
72
|
exports.Group = Group = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.entity.js","sourceRoot":"","sources":["../../src/entities/group.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"group.entity.js","sourceRoot":"","sources":["../../src/entities/group.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4C;AAC5C,qCAA0E;AAC1E,gEAA4D;AAC5D,+CAAqC;AACrC,iDAAwC;AACxC,qFAA0E;AAC1E,mCAAgC;AAChC,qDAA2C;AAC3C,6EAAmE;AACnE,mFAAwE;AAGjE,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,wBAAU;IAGnC,IAAI,CAAS;IAGb,KAAK,CAAS;IAGd,KAAK,CAAS;IAGd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"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
1
|
+
export * from './app_config/app-config.entity';
|
|
2
|
+
export * from './currency.entity';
|
|
3
|
+
export * from './drive';
|
|
4
|
+
export * from './easyapp/filter-view.entity';
|
|
5
|
+
export * from './email.entity';
|
|
6
|
+
export * from './group.entity';
|
|
7
|
+
export * from './imap-config.entity';
|
|
8
|
+
export * from './login-history.entity';
|
|
9
|
+
export * from './meeting-comment.entity';
|
|
10
|
+
export * from './meeting.entity';
|
|
11
|
+
export * from './menu-permissions.entity';
|
|
12
|
+
export * from './notifications';
|
|
13
|
+
export * from './otp-log.entity';
|
|
14
|
+
export * from './permission.entity';
|
|
15
|
+
export * from './phone.entity';
|
|
16
|
+
export * from './policy';
|
|
17
|
+
export * from './profile.entity';
|
|
18
|
+
export * from './protocol.entity';
|
|
19
|
+
export * from './refresh-token.entity';
|
|
20
|
+
export * from './role.entity';
|
|
21
|
+
export * from './sales';
|
|
22
|
+
export * from './tag.entity';
|
|
23
|
+
export * from './user-invitations.entity';
|
|
24
|
+
export * from './user.entity';
|
|
25
|
+
export * from './capacitation';
|
|
26
|
+
export * from './tools';
|
|
27
|
+
export * from './tools/mail/email-signature.entity';
|
|
28
|
+
export * from './tools/mail/mailbox-user-access.entity';
|
|
29
|
+
export * from './tools/mail/mailbox.entity';
|
|
30
|
+
export * from './tools/mail/mail.entity';
|
|
31
|
+
export * from './thirdparty/google-webhooks-config.entity';
|
|
32
|
+
export * from './thirdparty/google-gmail-watch-record.entity';
|
|
33
|
+
export * from './thirdparty/oauth.entity';
|
|
34
|
+
export * from './thirdparty/diio-integration.entity';
|
|
35
|
+
export * from './subscriptions/plan.entity';
|
|
36
|
+
export * from './subscriptions/subscription.entity';
|
|
37
|
+
export * from './subscriptions/payment-history.entity';
|
|
38
|
+
export * from './helpers';
|
|
39
|
+
export * from './audit.entity';
|
|
40
|
+
export * from './user-change-log.entity';
|
package/dist/entities/index.js
CHANGED
|
@@ -48,6 +48,9 @@ __exportStar(require("./thirdparty/google-webhooks-config.entity"), exports);
|
|
|
48
48
|
__exportStar(require("./thirdparty/google-gmail-watch-record.entity"), exports);
|
|
49
49
|
__exportStar(require("./thirdparty/oauth.entity"), exports);
|
|
50
50
|
__exportStar(require("./thirdparty/diio-integration.entity"), exports);
|
|
51
|
+
__exportStar(require("./subscriptions/plan.entity"), exports);
|
|
52
|
+
__exportStar(require("./subscriptions/subscription.entity"), exports);
|
|
53
|
+
__exportStar(require("./subscriptions/payment-history.entity"), exports);
|
|
51
54
|
__exportStar(require("./helpers"), exports);
|
|
52
55
|
__exportStar(require("./audit.entity"), exports);
|
|
53
56
|
__exportStar(require("./user-change-log.entity"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,oDAAkC;AAClC,0CAAwB;AACxB,+D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|
|
1
|
+
import { BaseEntityOnlyEssential } from '../../common/database/base.entity';
|
|
2
|
+
import { Subscription } from './subscription.entity';
|
|
3
|
+
import { Group } from '../group.entity';
|
|
4
|
+
export declare enum PaymentStatus {
|
|
5
|
+
SUCCEEDED = "succeeded",
|
|
6
|
+
FAILED = "failed",
|
|
7
|
+
PENDING = "pending",
|
|
8
|
+
REFUNDED = "refunded",
|
|
9
|
+
DISPUTED = "disputed"
|
|
10
|
+
}
|
|
11
|
+
export declare class PaymentHistory extends BaseEntityOnlyEssential {
|
|
12
|
+
subscriptionId: number | null;
|
|
13
|
+
subscription: Subscription | null;
|
|
14
|
+
workspaceId: number;
|
|
15
|
+
group: Group;
|
|
16
|
+
amount: number;
|
|
17
|
+
currency: string;
|
|
18
|
+
paymentStatus: PaymentStatus;
|
|
19
|
+
transactionDate: Date;
|
|
20
|
+
paymentGatewayTransactionId: string | null;
|
|
21
|
+
paymentMethodInfo: Record<string, any> | null;
|
|
22
|
+
invoiceUrl: string | null;
|
|
23
|
+
notes: string | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PaymentHistory = exports.PaymentStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const base_entity_1 = require("../../common/database/base.entity");
|
|
16
|
+
const subscription_entity_1 = require("./subscription.entity");
|
|
17
|
+
const group_entity_1 = require("../group.entity");
|
|
18
|
+
var PaymentStatus;
|
|
19
|
+
(function (PaymentStatus) {
|
|
20
|
+
PaymentStatus["SUCCEEDED"] = "succeeded";
|
|
21
|
+
PaymentStatus["FAILED"] = "failed";
|
|
22
|
+
PaymentStatus["PENDING"] = "pending";
|
|
23
|
+
PaymentStatus["REFUNDED"] = "refunded";
|
|
24
|
+
PaymentStatus["DISPUTED"] = "disputed";
|
|
25
|
+
})(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
|
|
26
|
+
let PaymentHistory = class PaymentHistory extends base_entity_1.BaseEntityOnlyEssential {
|
|
27
|
+
subscriptionId;
|
|
28
|
+
subscription;
|
|
29
|
+
workspaceId;
|
|
30
|
+
group;
|
|
31
|
+
amount;
|
|
32
|
+
currency;
|
|
33
|
+
paymentStatus;
|
|
34
|
+
transactionDate;
|
|
35
|
+
paymentGatewayTransactionId;
|
|
36
|
+
paymentMethodInfo;
|
|
37
|
+
invoiceUrl;
|
|
38
|
+
notes;
|
|
39
|
+
};
|
|
40
|
+
exports.PaymentHistory = PaymentHistory;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
43
|
+
(0, swagger_1.ApiProperty)({
|
|
44
|
+
description: 'ID of the associated workspace subscription (nullable for one-time payments)',
|
|
45
|
+
example: 10,
|
|
46
|
+
nullable: true,
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], PaymentHistory.prototype, "subscriptionId", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToOne)(() => subscription_entity_1.Subscription, subscription => subscription.paymentHistory, { onDelete: 'SET NULL' }),
|
|
52
|
+
(0, typeorm_1.JoinColumn)({ name: 'subscription_id' }),
|
|
53
|
+
__metadata("design:type", subscription_entity_1.Subscription)
|
|
54
|
+
], PaymentHistory.prototype, "subscription", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
57
|
+
(0, swagger_1.ApiProperty)({ description: 'ID of the workspace associated with the payment', example: 101 }),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], PaymentHistory.prototype, "workspaceId", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.ManyToOne)(() => group_entity_1.Group, group => group.paymentHistory, { onDelete: 'CASCADE' }),
|
|
62
|
+
(0, typeorm_1.JoinColumn)({ name: 'group_id' }),
|
|
63
|
+
__metadata("design:type", group_entity_1.Group)
|
|
64
|
+
], PaymentHistory.prototype, "group", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 2, nullable: false }),
|
|
67
|
+
(0, swagger_1.ApiProperty)({ description: 'Amount of the payment', example: 9.99 }),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], PaymentHistory.prototype, "amount", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 3, nullable: false }),
|
|
72
|
+
(0, swagger_1.ApiProperty)({ description: 'Currency code (e.g., "USD", "EUR")', example: 'USD' }),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], PaymentHistory.prototype, "currency", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: PaymentStatus, nullable: false }),
|
|
77
|
+
(0, swagger_1.ApiProperty)({ description: 'Status of the payment', enum: PaymentStatus, example: PaymentStatus.SUCCEEDED }),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], PaymentHistory.prototype, "paymentStatus", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' }),
|
|
82
|
+
(0, swagger_1.ApiProperty)({ description: 'Date and time of the transaction', example: '2024-06-05T11:00:00Z' }),
|
|
83
|
+
__metadata("design:type", Date)
|
|
84
|
+
], PaymentHistory.prototype, "transactionDate", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true, nullable: true }),
|
|
87
|
+
(0, swagger_1.ApiProperty)({
|
|
88
|
+
description: 'Transaction ID from the payment processor (e.g., Stripe, PayPal)',
|
|
89
|
+
example: 'txn_abc123xyz',
|
|
90
|
+
nullable: true,
|
|
91
|
+
}),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], PaymentHistory.prototype, "paymentGatewayTransactionId", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.Column)({ type: 'json', nullable: true }),
|
|
96
|
+
(0, swagger_1.ApiProperty)({
|
|
97
|
+
description: 'JSON containing payment method details (e.g., card type, last 4 digits)',
|
|
98
|
+
example: { cardType: 'Visa', last4: '4242' },
|
|
99
|
+
nullable: true,
|
|
100
|
+
}),
|
|
101
|
+
__metadata("design:type", Object)
|
|
102
|
+
], PaymentHistory.prototype, "paymentMethodInfo", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 512, nullable: true }),
|
|
105
|
+
(0, swagger_1.ApiProperty)({
|
|
106
|
+
description: 'URL to the invoice PDF or page',
|
|
107
|
+
example: 'https://example.com/invoices/12345',
|
|
108
|
+
nullable: true,
|
|
109
|
+
}),
|
|
110
|
+
__metadata("design:type", String)
|
|
111
|
+
], PaymentHistory.prototype, "invoiceUrl", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
114
|
+
(0, swagger_1.ApiProperty)({
|
|
115
|
+
description: 'Internal notes about the payment',
|
|
116
|
+
example: 'Refund initiated due to double charge.',
|
|
117
|
+
nullable: true,
|
|
118
|
+
}),
|
|
119
|
+
__metadata("design:type", String)
|
|
120
|
+
], PaymentHistory.prototype, "notes", void 0);
|
|
121
|
+
exports.PaymentHistory = PaymentHistory = __decorate([
|
|
122
|
+
(0, typeorm_1.Entity)('payment_history')
|
|
123
|
+
], PaymentHistory);
|
|
124
|
+
//# sourceMappingURL=payment-history.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-history.entity.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/payment-history.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkF;AAClF,6CAA8C;AAC9C,mEAA4E;AAC5E,+DAAqD;AACrD,kDAAwC;AAExC,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;AACvB,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,qCAAuB;IAOzD,cAAc,CAAgB;IAI9B,YAAY,CAAsB;IAIlC,WAAW,CAAS;IAIpB,KAAK,CAAQ;IAIb,MAAM,CAAS;IAIf,QAAQ,CAAS;IAIjB,aAAa,CAAgB;IAI7B,eAAe,CAAO;IAQtB,2BAA2B,CAAgB;IAQ3C,iBAAiB,CAA6B;IAQ9C,UAAU,CAAgB;IAQ1B,KAAK,CAAgB;CACtB,CAAA;AApEY,wCAAc;AAOzB;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,8EAA8E;QAC3F,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;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E,CAAC;IACxC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,kCAAkC;QAC/C,OAAO,EAAE,wCAAwC;QACjD,QAAQ,EAAE,IAAI;KACf,CAAC;;6CACmB;yBAnEV,cAAc;IAD1B,IAAA,gBAAM,EAAC,iBAAiB,CAAC;GACb,cAAc,CAoE1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseEntityOnlyEssential } from '../../common/database/base.entity';
|
|
2
|
+
import { Subscription } from './subscription.entity';
|
|
3
|
+
export declare enum BillingCycle {
|
|
4
|
+
MONTHLY = "monthly",
|
|
5
|
+
ANNUALLY = "annually",
|
|
6
|
+
ONE_TIME = "one_time"
|
|
7
|
+
}
|
|
8
|
+
export declare class Plan extends BaseEntityOnlyEssential {
|
|
9
|
+
planName: string;
|
|
10
|
+
description: string;
|
|
11
|
+
price: number;
|
|
12
|
+
currency: string;
|
|
13
|
+
billingCycle: BillingCycle;
|
|
14
|
+
userLimit: number | null;
|
|
15
|
+
storageLimitGb: number | null;
|
|
16
|
+
otherFeatures: Record<string, any> | null;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
subscription: Subscription;
|
|
19
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Plan = exports.BillingCycle = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const base_entity_1 = require("../../common/database/base.entity");
|
|
16
|
+
const subscription_entity_1 = require("./subscription.entity");
|
|
17
|
+
var BillingCycle;
|
|
18
|
+
(function (BillingCycle) {
|
|
19
|
+
BillingCycle["MONTHLY"] = "monthly";
|
|
20
|
+
BillingCycle["ANNUALLY"] = "annually";
|
|
21
|
+
BillingCycle["ONE_TIME"] = "one_time";
|
|
22
|
+
})(BillingCycle || (exports.BillingCycle = BillingCycle = {}));
|
|
23
|
+
let Plan = class Plan extends base_entity_1.BaseEntityOnlyEssential {
|
|
24
|
+
planName;
|
|
25
|
+
description;
|
|
26
|
+
price;
|
|
27
|
+
currency;
|
|
28
|
+
billingCycle;
|
|
29
|
+
userLimit;
|
|
30
|
+
storageLimitGb;
|
|
31
|
+
otherFeatures;
|
|
32
|
+
isActive;
|
|
33
|
+
subscription;
|
|
34
|
+
};
|
|
35
|
+
exports.Plan = Plan;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, unique: true, nullable: false }),
|
|
38
|
+
(0, swagger_1.ApiProperty)({ description: 'Nombre del plan (ej. "Free", "Basic Monthly", "Pro Annual")', example: 'Basic Monthly' }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], Plan.prototype, "planName", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
43
|
+
(0, swagger_1.ApiProperty)({ description: 'Descripción detallada del plan', example: 'Plan mensual con características básicas.' }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], Plan.prototype, "description", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 2, nullable: false }),
|
|
48
|
+
(0, swagger_1.ApiProperty)({ description: 'Precio del plan', example: 9.99 }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], Plan.prototype, "price", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 3, nullable: false, default: 'USD' }),
|
|
53
|
+
(0, swagger_1.ApiProperty)({ description: 'Moneda del precio (ej. "USD", "EUR")', example: 'USD' }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], Plan.prototype, "currency", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: BillingCycle, nullable: false }),
|
|
58
|
+
(0, swagger_1.ApiProperty)({
|
|
59
|
+
description: 'Frecuencia de facturación',
|
|
60
|
+
enum: BillingCycle,
|
|
61
|
+
example: BillingCycle.MONTHLY,
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], Plan.prototype, "billingCycle", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
67
|
+
(0, swagger_1.ApiProperty)({
|
|
68
|
+
description: 'Límite máximo de usuarios permitidos (null para ilimitado)',
|
|
69
|
+
example: 5,
|
|
70
|
+
nullable: true,
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:type", Number)
|
|
73
|
+
], Plan.prototype, "userLimit", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
76
|
+
(0, swagger_1.ApiProperty)({
|
|
77
|
+
description: 'Límite máximo de almacenamiento en GB (null para ilimitado)',
|
|
78
|
+
example: 100,
|
|
79
|
+
nullable: true,
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], Plan.prototype, "storageLimitGb", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ type: 'json', nullable: true }),
|
|
85
|
+
(0, swagger_1.ApiProperty)({
|
|
86
|
+
description: 'JSON para otros límites/flags de características específicas',
|
|
87
|
+
example: { featureA: true, featureB_limit: 1000 },
|
|
88
|
+
nullable: true,
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], Plan.prototype, "otherFeatures", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true, nullable: false }),
|
|
94
|
+
(0, swagger_1.ApiProperty)({ description: 'Indica si el plan está activo (true) o ha sido deprecado (false)', example: true }),
|
|
95
|
+
__metadata("design:type", Boolean)
|
|
96
|
+
], Plan.prototype, "isActive", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.OneToOne)(() => subscription_entity_1.Subscription, subscription => subscription.group),
|
|
99
|
+
__metadata("design:type", subscription_entity_1.Subscription)
|
|
100
|
+
], Plan.prototype, "subscription", void 0);
|
|
101
|
+
exports.Plan = Plan = __decorate([
|
|
102
|
+
(0, typeorm_1.Entity)('plans')
|
|
103
|
+
], Plan);
|
|
104
|
+
//# sourceMappingURL=plan.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.entity.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/plan.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmD;AACnD,6CAA8C;AAC9C,mEAA4E;AAC5E,+DAAqD;AAErD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAGM,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qCAAuB;IAG/C,QAAQ,CAAS;IAIjB,WAAW,CAAS;IAIpB,KAAK,CAAS;IAId,QAAQ,CAAS;IAQjB,YAAY,CAAe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
+
import { BaseEntityOnlyEssential } from '../../common/database/base.entity';
|
|
3
|
+
import { Group } from '../group.entity';
|
|
4
|
+
import { PaymentHistory } from './payment-history.entity';
|
|
5
|
+
export declare enum SubscriptionStatus {
|
|
6
|
+
ACTIVE = "active",
|
|
7
|
+
TRIALING = "trialing",
|
|
8
|
+
PAST_DUE = "past_due",
|
|
9
|
+
CANCELED = "canceled",
|
|
10
|
+
ENDED = "ended",
|
|
11
|
+
FREE = "free",
|
|
12
|
+
PENDING_PAYMENT = "pending_payment"
|
|
13
|
+
}
|
|
14
|
+
export declare class Subscription extends BaseEntityOnlyEssential {
|
|
15
|
+
groupId: number;
|
|
16
|
+
group: Group;
|
|
17
|
+
planId: number;
|
|
18
|
+
plan: Plan;
|
|
19
|
+
subscriptionStatus: SubscriptionStatus;
|
|
20
|
+
currentPeriodStartsAt: Date | null;
|
|
21
|
+
currentPeriodEndsAt: Date | null;
|
|
22
|
+
trialEndsAt: Date | null;
|
|
23
|
+
canceledAt: Date | null;
|
|
24
|
+
accessEndsAt: Date | null;
|
|
25
|
+
paymentGatewaySubscriptionId: string | null;
|
|
26
|
+
paymentHistory: PaymentHistory;
|
|
27
|
+
}
|