test-entity-library-asm 3.8.0 → 3.8.2

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.
@@ -1,4 +1,4 @@
1
- import { PartnerPermissionSection } from "..";
1
+ import { PartnerPlatformSection } from "..";
2
2
  export declare class PartnerPlatform {
3
3
  id: number;
4
4
  code: string;
@@ -6,5 +6,5 @@ export declare class PartnerPlatform {
6
6
  description: string | null;
7
7
  icon: string | null;
8
8
  status: number;
9
- partner_platform_sections: PartnerPermissionSection[];
9
+ partner_platform_sections: PartnerPlatformSection[];
10
10
  }
@@ -69,7 +69,7 @@ var PartnerPlatform = /** @class */ (function () {
69
69
  __metadata("design:type", Number)
70
70
  ], PartnerPlatform.prototype, "status", void 0);
71
71
  __decorate([
72
- (0, typeorm_1.OneToMany)(function () { return __1.PartnerPermissionSection; }, function (partnerPermissionSection) { return partnerPermissionSection.platform; }),
72
+ (0, typeorm_1.OneToMany)(function () { return __1.PartnerPlatformSection; }, function (partnerPlatformSection) { return partnerPlatformSection.platform; }),
73
73
  __metadata("design:type", Array)
74
74
  ], PartnerPlatform.prototype, "partner_platform_sections", void 0);
75
75
  PartnerPlatform = __decorate([
@@ -0,0 +1,11 @@
1
+ import { PartnerPlatform, PartnerPlatformSectionPermission } from "..";
2
+ export declare class PartnerPlatformSection {
3
+ id: number;
4
+ code: string;
5
+ platform: PartnerPlatform;
6
+ name: string;
7
+ description: string | null;
8
+ icon: string | null;
9
+ status: number;
10
+ partner_platform_sections: PartnerPlatformSectionPermission[];
11
+ }
@@ -0,0 +1,92 @@
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.PartnerPlatformSection = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var __1 = require("..");
15
+ var PartnerPlatformSection = /** @class */ (function () {
16
+ function PartnerPlatformSection() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ type: "int",
21
+ comment: "Número de identificación (ID) único de cada registro.",
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], PartnerPlatformSection.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({
27
+ length: 10,
28
+ type: "varchar",
29
+ unique: true,
30
+ comment: "Código del permiso.",
31
+ }),
32
+ __metadata("design:type", String)
33
+ ], PartnerPlatformSection.prototype, "code", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.ManyToOne)(function () { return __1.PartnerPlatform; }, function (partnerPlatform) { return partnerPlatform.partner_platform_sections; }, {
36
+ onDelete: "RESTRICT",
37
+ onUpdate: "NO ACTION",
38
+ }),
39
+ (0, typeorm_1.JoinColumn)({ name: "platform" }),
40
+ __metadata("design:type", __1.PartnerPlatform)
41
+ ], PartnerPlatformSection.prototype, "platform", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({
44
+ length: 40,
45
+ type: "varchar",
46
+ comment: "Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
47
+ }),
48
+ __metadata("design:type", String)
49
+ ], PartnerPlatformSection.prototype, "name", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({
52
+ length: 40,
53
+ type: "varchar",
54
+ comment: "Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
55
+ nullable: true,
56
+ default: null,
57
+ }),
58
+ __metadata("design:type", Object)
59
+ ], PartnerPlatformSection.prototype, "description", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({
62
+ length: 20,
63
+ type: "varchar",
64
+ comment: "Icono de la sección para los permisos.",
65
+ nullable: true,
66
+ default: null,
67
+ }),
68
+ __metadata("design:type", Object)
69
+ ], PartnerPlatformSection.prototype, "icon", void 0);
70
+ __decorate([
71
+ (0, typeorm_1.Column)({
72
+ default: 1,
73
+ type: "int",
74
+ width: 1,
75
+ comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
76
+ }),
77
+ __metadata("design:type", Number)
78
+ ], PartnerPlatformSection.prototype, "status", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.OneToMany)(function () { return __1.PartnerPlatformSectionPermission; }, function (partnerPlatformSectionPermission) {
81
+ return partnerPlatformSectionPermission.section;
82
+ }),
83
+ __metadata("design:type", Array)
84
+ ], PartnerPlatformSection.prototype, "partner_platform_sections", void 0);
85
+ PartnerPlatformSection = __decorate([
86
+ (0, typeorm_1.Entity)("partner_platform_section", {
87
+ comment: "Tabla creada para agregar las secciones para lo permisos del partner. Acá se va a agregar las páginas y accesos de la plataforma.",
88
+ })
89
+ ], PartnerPlatformSection);
90
+ return PartnerPlatformSection;
91
+ }());
92
+ exports.PartnerPlatformSection = PartnerPlatformSection;
@@ -0,0 +1,16 @@
1
+ import { PartnerPlatformSection, PartnerPlatformSectionPermissionAssociate } from "..";
2
+ import { PartnerRole } from "./PartnerRole";
3
+ export declare class PartnerPlatformSectionPermission {
4
+ id: number;
5
+ code: string;
6
+ section: PartnerPlatformSection;
7
+ name: string;
8
+ description: string | null;
9
+ action: string | null;
10
+ endpoint: string | null;
11
+ icon: string | null;
12
+ status: number;
13
+ permission_associates: PartnerPlatformSectionPermissionAssociate[];
14
+ associated_by: PartnerPlatformSectionPermissionAssociate[];
15
+ roles_permissions: PartnerRole[];
16
+ }
@@ -0,0 +1,132 @@
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.PartnerPlatformSectionPermission = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var __1 = require("..");
15
+ var PartnerRole_1 = require("./PartnerRole");
16
+ var PartnerPlatformSectionPermission = /** @class */ (function () {
17
+ function PartnerPlatformSectionPermission() {
18
+ }
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)({
21
+ type: "int",
22
+ comment: "Número de identificación (ID) único de cada registro.",
23
+ }),
24
+ __metadata("design:type", Number)
25
+ ], PartnerPlatformSectionPermission.prototype, "id", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({
28
+ length: 10,
29
+ type: "varchar",
30
+ unique: true,
31
+ comment: "Código del permiso.",
32
+ }),
33
+ __metadata("design:type", String)
34
+ ], PartnerPlatformSectionPermission.prototype, "code", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.ManyToOne)(function () { return __1.PartnerPlatformSection; }, function (partnerPlatformSection) {
37
+ return partnerPlatformSection.partner_platform_sections;
38
+ }, {
39
+ onDelete: "RESTRICT",
40
+ onUpdate: "NO ACTION",
41
+ }),
42
+ (0, typeorm_1.JoinColumn)({ name: "section" }),
43
+ __metadata("design:type", __1.PartnerPlatformSection)
44
+ ], PartnerPlatformSectionPermission.prototype, "section", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({
47
+ length: 40,
48
+ type: "varchar",
49
+ comment: "Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
50
+ }),
51
+ __metadata("design:type", String)
52
+ ], PartnerPlatformSectionPermission.prototype, "name", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({
55
+ length: 40,
56
+ type: "varchar",
57
+ comment: "Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
58
+ nullable: true,
59
+ default: null,
60
+ }),
61
+ __metadata("design:type", Object)
62
+ ], PartnerPlatformSectionPermission.prototype, "description", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)({
65
+ length: 100,
66
+ type: "varchar",
67
+ comment: "Campo que me indica qué acción se hace en el frontend.",
68
+ nullable: true,
69
+ default: null,
70
+ }),
71
+ __metadata("design:type", Object)
72
+ ], PartnerPlatformSectionPermission.prototype, "action", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({
75
+ length: 100,
76
+ type: "varchar",
77
+ comment: "Acá guardamos el endpoint que usa para esa acción.",
78
+ nullable: true,
79
+ default: null,
80
+ }),
81
+ __metadata("design:type", Object)
82
+ ], PartnerPlatformSectionPermission.prototype, "endpoint", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({
85
+ length: 20,
86
+ type: "varchar",
87
+ comment: "Icono de la sección para los permisos.",
88
+ nullable: true,
89
+ default: null,
90
+ }),
91
+ __metadata("design:type", Object)
92
+ ], PartnerPlatformSectionPermission.prototype, "icon", void 0);
93
+ __decorate([
94
+ (0, typeorm_1.Column)({
95
+ default: 1,
96
+ type: "int",
97
+ width: 1,
98
+ comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
99
+ }),
100
+ __metadata("design:type", Number)
101
+ ], PartnerPlatformSectionPermission.prototype, "status", void 0);
102
+ __decorate([
103
+ (0, typeorm_1.OneToMany)(function () { return __1.PartnerPlatformSectionPermissionAssociate; }, function (ppa) { return ppa.permission; }),
104
+ __metadata("design:type", Array)
105
+ ], PartnerPlatformSectionPermission.prototype, "permission_associates", void 0);
106
+ __decorate([
107
+ (0, typeorm_1.OneToMany)(function () { return __1.PartnerPlatformSectionPermissionAssociate; }, function (ppa) { return ppa.associate; }),
108
+ __metadata("design:type", Array)
109
+ ], PartnerPlatformSectionPermission.prototype, "associated_by", void 0);
110
+ __decorate([
111
+ (0, typeorm_1.ManyToMany)(function () { return PartnerRole_1.PartnerRole; }, function (partnerRole) { return partnerRole.roles_permissions; }),
112
+ (0, typeorm_1.JoinTable)({
113
+ name: "partner_role_permission",
114
+ joinColumn: {
115
+ name: "permission",
116
+ referencedColumnName: "id",
117
+ },
118
+ inverseJoinColumn: {
119
+ name: "role",
120
+ referencedColumnName: "id",
121
+ },
122
+ }),
123
+ __metadata("design:type", Array)
124
+ ], PartnerPlatformSectionPermission.prototype, "roles_permissions", void 0);
125
+ PartnerPlatformSectionPermission = __decorate([
126
+ (0, typeorm_1.Entity)("partner_platform_section_permission", {
127
+ comment: "Permisos que estarán disponibles en la plataforma para los usuarios (partners).",
128
+ })
129
+ ], PartnerPlatformSectionPermission);
130
+ return PartnerPlatformSectionPermission;
131
+ }());
132
+ exports.PartnerPlatformSectionPermission = PartnerPlatformSectionPermission;
@@ -0,0 +1,6 @@
1
+ import { PartnerPlatformSectionPermission } from "./PartnerPlatformSectionPermission";
2
+ export declare class PartnerPlatformSectionPermissionAssociate {
3
+ id: number;
4
+ permission: PartnerPlatformSectionPermission;
5
+ associate: PartnerPlatformSectionPermission;
6
+ }
@@ -0,0 +1,42 @@
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.PartnerPlatformSectionPermissionAssociate = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var PartnerPlatformSectionPermission_1 = require("./PartnerPlatformSectionPermission");
15
+ var PartnerPlatformSectionPermissionAssociate = /** @class */ (function () {
16
+ function PartnerPlatformSectionPermissionAssociate() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ type: "int",
21
+ comment: "ID único del registro de asociación.",
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], PartnerPlatformSectionPermissionAssociate.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(function () { return PartnerPlatformSectionPermission_1.PartnerPlatformSectionPermission; }, function (permission) { return permission.permission_associates; }, { onDelete: "CASCADE" }),
27
+ (0, typeorm_1.JoinColumn)({ name: "partner_platform_section_permission" }),
28
+ __metadata("design:type", PartnerPlatformSectionPermission_1.PartnerPlatformSectionPermission)
29
+ ], PartnerPlatformSectionPermissionAssociate.prototype, "permission", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.ManyToOne)(function () { return PartnerPlatformSectionPermission_1.PartnerPlatformSectionPermission; }, function (associate) { return associate.associated_by; }, { onDelete: "CASCADE" }),
32
+ (0, typeorm_1.JoinColumn)({ name: "partner_platform_section_permission_associate" }),
33
+ __metadata("design:type", PartnerPlatformSectionPermission_1.PartnerPlatformSectionPermission)
34
+ ], PartnerPlatformSectionPermissionAssociate.prototype, "associate", void 0);
35
+ PartnerPlatformSectionPermissionAssociate = __decorate([
36
+ (0, typeorm_1.Entity)("partner_platform_section_permission_associate", {
37
+ comment: "Asociaciones de permisos que dependen entre sí. Esto sirve por si algún permiso necesita que otros permisos estén activos para poder activarse.",
38
+ })
39
+ ], PartnerPlatformSectionPermissionAssociate);
40
+ return PartnerPlatformSectionPermissionAssociate;
41
+ }());
42
+ exports.PartnerPlatformSectionPermissionAssociate = PartnerPlatformSectionPermissionAssociate;
@@ -1,6 +1,6 @@
1
1
  import { Company } from "./Company";
2
2
  import { Partner } from "./Partner";
3
- import { PartnerPermission } from "./PartnerPermission";
3
+ import { PartnerPlatformSectionPermission } from "./PartnerPlatformSectionPermission";
4
4
  export declare class PartnerRole {
5
5
  id: number;
6
6
  code: string;
@@ -8,6 +8,6 @@ export declare class PartnerRole {
8
8
  name: string;
9
9
  description: string | null;
10
10
  status: number;
11
- roles_permissions: PartnerPermission[];
11
+ roles_permissions: PartnerPlatformSectionPermission[];
12
12
  partners_roles: Partner[];
13
13
  }
@@ -13,7 +13,7 @@ exports.PartnerRole = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
14
  var Company_1 = require("./Company");
15
15
  var Partner_1 = require("./Partner");
16
- var PartnerPermission_1 = require("./PartnerPermission");
16
+ var PartnerPlatformSectionPermission_1 = require("./PartnerPlatformSectionPermission");
17
17
  var PartnerRole = /** @class */ (function () {
18
18
  function PartnerRole() {
19
19
  }
@@ -70,7 +70,7 @@ var PartnerRole = /** @class */ (function () {
70
70
  __metadata("design:type", Number)
71
71
  ], PartnerRole.prototype, "status", void 0);
72
72
  __decorate([
73
- (0, typeorm_1.ManyToMany)(function () { return PartnerPermission_1.PartnerPermission; }, function (partnerPermission) { return partnerPermission.roles_permissions; }),
73
+ (0, typeorm_1.ManyToMany)(function () { return PartnerPlatformSectionPermission_1.PartnerPlatformSectionPermission; }, function (partnerPermission) { return partnerPermission.roles_permissions; }),
74
74
  (0, typeorm_1.JoinTable)({
75
75
  name: "partner_role_permission",
76
76
  joinColumn: {
@@ -0,0 +1,8 @@
1
+ export declare class VerificationCode {
2
+ id: number;
3
+ email: string;
4
+ phone: string;
5
+ code: string;
6
+ expiration: Date;
7
+ created: Date;
8
+ }
@@ -0,0 +1,76 @@
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.VerificationCode = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var dateTransformer_1 = require("../transformers/dateTransformer");
15
+ var VerificationCode = /** @class */ (function () {
16
+ function VerificationCode() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ type: "int",
21
+ comment: "Número de identificación (ID) único de cada registro.",
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], VerificationCode.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({
27
+ length: 100,
28
+ type: "varchar",
29
+ comment: "Correo electrónico al que se le envía el código de verificación.",
30
+ nullable: true,
31
+ default: null,
32
+ }),
33
+ __metadata("design:type", String)
34
+ ], VerificationCode.prototype, "email", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({
37
+ length: 12,
38
+ type: "varchar",
39
+ comment: "Número de teléfono al que se le envía el código de verificación.",
40
+ nullable: true,
41
+ default: null,
42
+ }),
43
+ __metadata("design:type", String)
44
+ ], VerificationCode.prototype, "phone", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({
47
+ length: 5,
48
+ type: "varchar",
49
+ comment: "Código de verificación que se le envía al usuario.",
50
+ }),
51
+ __metadata("design:type", String)
52
+ ], VerificationCode.prototype, "code", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({
55
+ type: "datetime",
56
+ transformer: new dateTransformer_1.DateTransformer(),
57
+ comment: "Fecha de expiración del código de verificación.",
58
+ }),
59
+ __metadata("design:type", Date)
60
+ ], VerificationCode.prototype, "expiration", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({
63
+ type: "datetime",
64
+ transformer: new dateTransformer_1.DateTransformer(),
65
+ comment: "Fecha de creación del código de verificación.",
66
+ }),
67
+ __metadata("design:type", Date)
68
+ ], VerificationCode.prototype, "created", void 0);
69
+ VerificationCode = __decorate([
70
+ (0, typeorm_1.Entity)("verification_code", {
71
+ comment: "Acá se van a guardar los códigos que se envíen para crear cuentas, verificar correos, números de teléfono entre otros.",
72
+ })
73
+ ], VerificationCode);
74
+ return VerificationCode;
75
+ }());
76
+ exports.VerificationCode = VerificationCode;
@@ -17,7 +17,7 @@ export { MasterPermission } from "./entities/MasterPermission";
17
17
  export { MasterRole } from "./entities/MasterRole";
18
18
  export { Partner } from "./entities/Partner";
19
19
  export { PartnerNotification } from "./entities/PartnerNotification";
20
- export { PartnerPermission } from "./entities/PartnerPermission";
20
+ export { PartnerPlatformSectionPermission } from "./entities/PartnerPlatformSectionPermission";
21
21
  export { PartnerRole } from "./entities/PartnerRole";
22
22
  export { PaymentMethod } from "./entities/PaymentMethod";
23
23
  export { Plan } from "./entities/Plan";
@@ -40,7 +40,7 @@ export { PosSystem } from "./entities/PosSystem";
40
40
  export { VerifyLocal } from "./entities/VerifyLocal";
41
41
  export { MasterNotification } from "./entities/MasterNotification";
42
42
  export { LocalPlan } from "./entities/LocalPlan";
43
- export { PartnerPermissionSection } from "./entities/PartnerPermissionSection";
43
+ export { PartnerPlatformSection } from "./entities/PartnerPlatformSection";
44
44
  export { PartnerPlatform } from "./entities/PartnerPlatform";
45
45
  export { ServicePlan } from "./entities/ServicePlan";
46
46
  export { Bank } from "./entities/Bank";
@@ -69,6 +69,8 @@ export { RequestLocalTable } from "./entities/RequestLocalTable";
69
69
  export { Gallery } from "./entities/Gallery";
70
70
  export { ProductImage } from "./entities/ProductImage";
71
71
  export { LocalPaymentMethod } from "./entities/LocalPaymentMethod";
72
+ export { VerificationCode } from "./entities/VerificationCode";
73
+ export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPlatformSectionPermissionAssociate";
72
74
  export { LocalsCompany } from "./views/LocalsCompany";
73
75
  export { VerifyLocals } from "./views/VerifyLocals";
74
76
  export { MasterNotifications } from "./views/MasterNotifications";
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ToppingImage = exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.Square = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
18
- exports.CustomRepository = exports.getLocalReservesInformation = exports.getVerifyLocalsInformation = exports.getLocalsCompanyInformation = exports.getDiscountsCodeUserInformation = exports.getDiscountsCodeCompanyInformation = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.LocalPaymentMethod = exports.ProductImage = exports.Gallery = exports.RequestLocalTable = exports.RequestInvoiceCategory = exports.RequestInvoice = exports.LocalTableReserve = exports.LocalReserveStatus = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
17
+ exports.ToppingImage = exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPlatformSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.Square = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPlatformSectionPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
18
+ exports.CustomRepository = exports.getLocalReservesInformation = exports.getVerifyLocalsInformation = exports.getLocalsCompanyInformation = exports.getDiscountsCodeUserInformation = exports.getDiscountsCodeCompanyInformation = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.PartnerPlatformSectionPermissionAssociate = exports.VerificationCode = exports.LocalPaymentMethod = exports.ProductImage = exports.Gallery = exports.RequestLocalTable = exports.RequestInvoiceCategory = exports.RequestInvoice = exports.LocalTableReserve = exports.LocalReserveStatus = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
19
19
  var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
20
20
  Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
21
21
  var Category_1 = require("./entities/Category");
@@ -54,8 +54,8 @@ var Partner_1 = require("./entities/Partner");
54
54
  Object.defineProperty(exports, "Partner", { enumerable: true, get: function () { return Partner_1.Partner; } });
55
55
  var PartnerNotification_1 = require("./entities/PartnerNotification");
56
56
  Object.defineProperty(exports, "PartnerNotification", { enumerable: true, get: function () { return PartnerNotification_1.PartnerNotification; } });
57
- var PartnerPermission_1 = require("./entities/PartnerPermission");
58
- Object.defineProperty(exports, "PartnerPermission", { enumerable: true, get: function () { return PartnerPermission_1.PartnerPermission; } });
57
+ var PartnerPlatformSectionPermission_1 = require("./entities/PartnerPlatformSectionPermission");
58
+ Object.defineProperty(exports, "PartnerPlatformSectionPermission", { enumerable: true, get: function () { return PartnerPlatformSectionPermission_1.PartnerPlatformSectionPermission; } });
59
59
  var PartnerRole_1 = require("./entities/PartnerRole");
60
60
  Object.defineProperty(exports, "PartnerRole", { enumerable: true, get: function () { return PartnerRole_1.PartnerRole; } });
61
61
  var PaymentMethod_1 = require("./entities/PaymentMethod");
@@ -100,8 +100,8 @@ var MasterNotification_1 = require("./entities/MasterNotification");
100
100
  Object.defineProperty(exports, "MasterNotification", { enumerable: true, get: function () { return MasterNotification_1.MasterNotification; } });
101
101
  var LocalPlan_1 = require("./entities/LocalPlan");
102
102
  Object.defineProperty(exports, "LocalPlan", { enumerable: true, get: function () { return LocalPlan_1.LocalPlan; } });
103
- var PartnerPermissionSection_1 = require("./entities/PartnerPermissionSection");
104
- Object.defineProperty(exports, "PartnerPermissionSection", { enumerable: true, get: function () { return PartnerPermissionSection_1.PartnerPermissionSection; } });
103
+ var PartnerPlatformSection_1 = require("./entities/PartnerPlatformSection");
104
+ Object.defineProperty(exports, "PartnerPlatformSection", { enumerable: true, get: function () { return PartnerPlatformSection_1.PartnerPlatformSection; } });
105
105
  var PartnerPlatform_1 = require("./entities/PartnerPlatform");
106
106
  Object.defineProperty(exports, "PartnerPlatform", { enumerable: true, get: function () { return PartnerPlatform_1.PartnerPlatform; } });
107
107
  var ServicePlan_1 = require("./entities/ServicePlan");
@@ -158,6 +158,10 @@ var ProductImage_1 = require("./entities/ProductImage");
158
158
  Object.defineProperty(exports, "ProductImage", { enumerable: true, get: function () { return ProductImage_1.ProductImage; } });
159
159
  var LocalPaymentMethod_1 = require("./entities/LocalPaymentMethod");
160
160
  Object.defineProperty(exports, "LocalPaymentMethod", { enumerable: true, get: function () { return LocalPaymentMethod_1.LocalPaymentMethod; } });
161
+ var VerificationCode_1 = require("./entities/VerificationCode");
162
+ Object.defineProperty(exports, "VerificationCode", { enumerable: true, get: function () { return VerificationCode_1.VerificationCode; } });
163
+ var PartnerPlatformSectionPermissionAssociate_1 = require("./entities/PartnerPlatformSectionPermissionAssociate");
164
+ Object.defineProperty(exports, "PartnerPlatformSectionPermissionAssociate", { enumerable: true, get: function () { return PartnerPlatformSectionPermissionAssociate_1.PartnerPlatformSectionPermissionAssociate; } });
161
165
  var LocalsCompany_1 = require("./views/LocalsCompany");
162
166
  Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
163
167
  var VerifyLocals_1 = require("./views/VerifyLocals");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.8.0",
3
+ "version": "3.8.2",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
2
- import { PartnerPermissionSection } from "..";
2
+ import { PartnerPlatformSection } from "..";
3
3
 
4
4
  @Entity("partner_platform", {
5
5
  comment: "Tabla creada para agregar las plataformas de los usuarios.",
@@ -56,8 +56,8 @@ export class PartnerPlatform {
56
56
  status: number;
57
57
 
58
58
  @OneToMany(
59
- () => PartnerPermissionSection,
60
- (partnerPermissionSection) => partnerPermissionSection.platform
59
+ () => PartnerPlatformSection,
60
+ (partnerPlatformSection) => partnerPlatformSection.platform
61
61
  )
62
- partner_platform_sections: PartnerPermissionSection[];
62
+ partner_platform_sections: PartnerPlatformSection[];
63
63
  }
@@ -6,13 +6,13 @@ import {
6
6
  OneToMany,
7
7
  PrimaryGeneratedColumn,
8
8
  } from "typeorm";
9
- import { PartnerPermission, PartnerPlatform } from "..";
9
+ import { PartnerPlatform, PartnerPlatformSectionPermission } from "..";
10
10
 
11
- @Entity("partner_permission_section", {
11
+ @Entity("partner_platform_section", {
12
12
  comment:
13
- "Tabla creada para agregar las secciones para lo permisos del partner.",
13
+ "Tabla creada para agregar las secciones para lo permisos del partner. Acá se va a agregar las páginas y accesos de la plataforma.",
14
14
  })
15
- export class PartnerPermissionSection {
15
+ export class PartnerPlatformSection {
16
16
  @PrimaryGeneratedColumn({
17
17
  type: "int",
18
18
  comment: "Número de identificación (ID) único de cada registro.",
@@ -75,8 +75,9 @@ export class PartnerPermissionSection {
75
75
  status: number;
76
76
 
77
77
  @OneToMany(
78
- () => PartnerPermission,
79
- (partnerPermissionSection) => partnerPermissionSection.section
78
+ () => PartnerPlatformSectionPermission,
79
+ (partnerPlatformSectionPermission) =>
80
+ partnerPlatformSectionPermission.section
80
81
  )
81
- partner_permissions_sections: PartnerPermission[];
82
+ partner_platform_sections: PartnerPlatformSectionPermission[];
82
83
  }
@@ -5,16 +5,20 @@ import {
5
5
  JoinTable,
6
6
  ManyToMany,
7
7
  ManyToOne,
8
+ OneToMany,
8
9
  PrimaryGeneratedColumn,
9
10
  } from "typeorm";
10
- import { PartnerPermissionSection } from "..";
11
+ import {
12
+ PartnerPlatformSection,
13
+ PartnerPlatformSectionPermissionAssociate,
14
+ } from "..";
11
15
  import { PartnerRole } from "./PartnerRole";
12
16
 
13
- @Entity("partner_permission", {
17
+ @Entity("partner_platform_section_permission", {
14
18
  comment:
15
19
  "Permisos que estarán disponibles en la plataforma para los usuarios (partners).",
16
20
  })
17
- export class PartnerPermission {
21
+ export class PartnerPlatformSectionPermission {
18
22
  @PrimaryGeneratedColumn({
19
23
  type: "int",
20
24
  comment: "Número de identificación (ID) único de cada registro.",
@@ -30,16 +34,16 @@ export class PartnerPermission {
30
34
  code: string;
31
35
 
32
36
  @ManyToOne(
33
- () => PartnerPermissionSection,
34
- (partnerPermissionSection) =>
35
- partnerPermissionSection.partner_permissions_sections,
37
+ () => PartnerPlatformSection,
38
+ (partnerPlatformSection) =>
39
+ partnerPlatformSection.partner_platform_sections,
36
40
  {
37
41
  onDelete: "RESTRICT",
38
42
  onUpdate: "NO ACTION",
39
43
  }
40
44
  )
41
45
  @JoinColumn({ name: "section" })
42
- section: PartnerPermissionSection;
46
+ section: PartnerPlatformSection;
43
47
 
44
48
  @Column({
45
49
  length: 40,
@@ -59,6 +63,24 @@ export class PartnerPermission {
59
63
  })
60
64
  description: string | null;
61
65
 
66
+ @Column({
67
+ length: 100,
68
+ type: "varchar",
69
+ comment: "Campo que me indica qué acción se hace en el frontend.",
70
+ nullable: true,
71
+ default: null,
72
+ })
73
+ action: string | null;
74
+
75
+ @Column({
76
+ length: 100,
77
+ type: "varchar",
78
+ comment: "Acá guardamos el endpoint que usa para esa acción.",
79
+ nullable: true,
80
+ default: null,
81
+ })
82
+ endpoint: string | null;
83
+
62
84
  @Column({
63
85
  length: 20,
64
86
  type: "varchar",
@@ -77,6 +99,18 @@ export class PartnerPermission {
77
99
  })
78
100
  status: number;
79
101
 
102
+ @OneToMany(
103
+ () => PartnerPlatformSectionPermissionAssociate,
104
+ (ppa) => ppa.permission
105
+ )
106
+ permission_associates: PartnerPlatformSectionPermissionAssociate[];
107
+
108
+ @OneToMany(
109
+ () => PartnerPlatformSectionPermissionAssociate,
110
+ (ppa) => ppa.associate
111
+ )
112
+ associated_by: PartnerPlatformSectionPermissionAssociate[];
113
+
80
114
  @ManyToMany(() => PartnerRole, (partnerRole) => partnerRole.roles_permissions)
81
115
  @JoinTable({
82
116
  name: "partner_role_permission",
@@ -0,0 +1,30 @@
1
+ import { Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
2
+ import { PartnerPlatformSectionPermission } from "./PartnerPlatformSectionPermission";
3
+
4
+ @Entity("partner_platform_section_permission_associate", {
5
+ comment:
6
+ "Asociaciones de permisos que dependen entre sí. Esto sirve por si algún permiso necesita que otros permisos estén activos para poder activarse.",
7
+ })
8
+ export class PartnerPlatformSectionPermissionAssociate {
9
+ @PrimaryGeneratedColumn({
10
+ type: "int",
11
+ comment: "ID único del registro de asociación.",
12
+ })
13
+ id: number;
14
+
15
+ @ManyToOne(
16
+ () => PartnerPlatformSectionPermission,
17
+ (permission) => permission.permission_associates,
18
+ { onDelete: "CASCADE" }
19
+ )
20
+ @JoinColumn({ name: "partner_platform_section_permission" })
21
+ permission: PartnerPlatformSectionPermission;
22
+
23
+ @ManyToOne(
24
+ () => PartnerPlatformSectionPermission,
25
+ (associate) => associate.associated_by,
26
+ { onDelete: "CASCADE" }
27
+ )
28
+ @JoinColumn({ name: "partner_platform_section_permission_associate" })
29
+ associate: PartnerPlatformSectionPermission;
30
+ }
@@ -9,7 +9,7 @@ import {
9
9
  } from "typeorm";
10
10
  import { Company } from "./Company";
11
11
  import { Partner } from "./Partner";
12
- import { PartnerPermission } from "./PartnerPermission";
12
+ import { PartnerPlatformSectionPermission } from "./PartnerPlatformSectionPermission";
13
13
 
14
14
  @Entity("partner_role", {
15
15
  comment:
@@ -66,7 +66,7 @@ export class PartnerRole {
66
66
  status: number;
67
67
 
68
68
  @ManyToMany(
69
- () => PartnerPermission,
69
+ () => PartnerPlatformSectionPermission,
70
70
  (partnerPermission) => partnerPermission.roles_permissions
71
71
  )
72
72
  @JoinTable({
@@ -80,7 +80,7 @@ export class PartnerRole {
80
80
  referencedColumnName: "id",
81
81
  },
82
82
  })
83
- roles_permissions: PartnerPermission[];
83
+ roles_permissions: PartnerPlatformSectionPermission[];
84
84
 
85
85
  @ManyToMany(() => Partner, (partner) => partner.partners_roles)
86
86
  @JoinTable({
@@ -0,0 +1,53 @@
1
+ import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
2
+ import { DateTransformer } from "../transformers/dateTransformer";
3
+
4
+ @Entity("verification_code", {
5
+ comment:
6
+ "Acá se van a guardar los códigos que se envíen para crear cuentas, verificar correos, números de teléfono entre otros.",
7
+ })
8
+ export class VerificationCode {
9
+ @PrimaryGeneratedColumn({
10
+ type: "int",
11
+ comment: "Número de identificación (ID) único de cada registro.",
12
+ })
13
+ id: number;
14
+
15
+ @Column({
16
+ length: 100,
17
+ type: "varchar",
18
+ comment: "Correo electrónico al que se le envía el código de verificación.",
19
+ nullable: true,
20
+ default: null,
21
+ })
22
+ email: string;
23
+
24
+ @Column({
25
+ length: 12,
26
+ type: "varchar",
27
+ comment: "Número de teléfono al que se le envía el código de verificación.",
28
+ nullable: true,
29
+ default: null,
30
+ })
31
+ phone: string;
32
+
33
+ @Column({
34
+ length: 5,
35
+ type: "varchar",
36
+ comment: "Código de verificación que se le envía al usuario.",
37
+ })
38
+ code: string;
39
+
40
+ @Column({
41
+ type: "datetime",
42
+ transformer: new DateTransformer(),
43
+ comment: "Fecha de expiración del código de verificación.",
44
+ })
45
+ expiration: Date;
46
+
47
+ @Column({
48
+ type: "datetime",
49
+ transformer: new DateTransformer(),
50
+ comment: "Fecha de creación del código de verificación.",
51
+ })
52
+ created: Date;
53
+ }
@@ -17,7 +17,7 @@ export { MasterPermission } from "./entities/MasterPermission";
17
17
  export { MasterRole } from "./entities/MasterRole";
18
18
  export { Partner } from "./entities/Partner";
19
19
  export { PartnerNotification } from "./entities/PartnerNotification";
20
- export { PartnerPermission } from "./entities/PartnerPermission";
20
+ export { PartnerPlatformSectionPermission } from "./entities/PartnerPlatformSectionPermission";
21
21
  export { PartnerRole } from "./entities/PartnerRole";
22
22
  export { PaymentMethod } from "./entities/PaymentMethod";
23
23
  export { Plan } from "./entities/Plan";
@@ -40,7 +40,7 @@ export { PosSystem } from "./entities/PosSystem";
40
40
  export { VerifyLocal } from "./entities/VerifyLocal";
41
41
  export { MasterNotification } from "./entities/MasterNotification";
42
42
  export { LocalPlan } from "./entities/LocalPlan";
43
- export { PartnerPermissionSection } from "./entities/PartnerPermissionSection";
43
+ export { PartnerPlatformSection } from "./entities/PartnerPlatformSection";
44
44
  export { PartnerPlatform } from "./entities/PartnerPlatform";
45
45
  export { ServicePlan } from "./entities/ServicePlan";
46
46
  export { Bank } from "./entities/Bank";
@@ -69,6 +69,8 @@ export { RequestLocalTable } from "./entities/RequestLocalTable";
69
69
  export { Gallery } from "./entities/Gallery";
70
70
  export { ProductImage } from "./entities/ProductImage";
71
71
  export { LocalPaymentMethod } from "./entities/LocalPaymentMethod";
72
+ export { VerificationCode } from "./entities/VerificationCode";
73
+ export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPlatformSectionPermissionAssociate";
72
74
 
73
75
  export { LocalsCompany } from "./views/LocalsCompany";
74
76
  export { VerifyLocals } from "./views/VerifyLocals";