@asumano/worklip-typeorm-db 1.0.0 → 1.1.1

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.
Files changed (62) hide show
  1. package/dist/entities/Associate.d.ts +32 -0
  2. package/dist/entities/Associate.js +228 -0
  3. package/dist/entities/AssociatePermission.d.ts +9 -0
  4. package/dist/entities/AssociatePermission.js +81 -0
  5. package/dist/entities/AssociatePlatform.d.ts +8 -0
  6. package/dist/entities/AssociatePlatform.js +51 -0
  7. package/dist/entities/AssociateRole.d.ts +9 -0
  8. package/dist/entities/AssociateRole.js +81 -0
  9. package/dist/entities/AssociateSession.d.ts +12 -0
  10. package/dist/entities/AssociateSession.js +97 -0
  11. package/dist/entities/Brand.d.ts +7 -0
  12. package/dist/entities/Brand.js +46 -0
  13. package/dist/entities/City.d.ts +15 -0
  14. package/dist/entities/City.js +68 -0
  15. package/dist/entities/Client.d.ts +17 -0
  16. package/dist/entities/Client.js +107 -0
  17. package/dist/entities/Company.d.ts +15 -0
  18. package/dist/entities/Company.js +77 -0
  19. package/dist/entities/Country.d.ts +2 -0
  20. package/dist/entities/Country.js +5 -0
  21. package/dist/entities/GlobalTemplate.d.ts +10 -0
  22. package/dist/entities/GlobalTemplate.js +78 -0
  23. package/dist/entities/GlobalTemplateSection.d.ts +13 -0
  24. package/dist/entities/GlobalTemplateSection.js +95 -0
  25. package/dist/entities/GlobalTemplateSectionItem.d.ts +11 -0
  26. package/dist/entities/GlobalTemplateSectionItem.js +90 -0
  27. package/dist/entities/Master.d.ts +20 -0
  28. package/dist/entities/Master.js +153 -0
  29. package/dist/entities/MasterSession.d.ts +12 -0
  30. package/dist/entities/MasterSession.js +97 -0
  31. package/dist/entities/Region.d.ts +9 -0
  32. package/dist/entities/Region.js +59 -0
  33. package/dist/entities/Reminder.d.ts +15 -0
  34. package/dist/entities/Reminder.js +96 -0
  35. package/dist/entities/ServiceOrder.d.ts +18 -0
  36. package/dist/entities/ServiceOrder.js +115 -0
  37. package/dist/entities/ServiceOrderHistory.d.ts +9 -0
  38. package/dist/entities/ServiceOrderHistory.js +64 -0
  39. package/dist/entities/Template.d.ts +14 -0
  40. package/dist/entities/Template.js +91 -0
  41. package/dist/entities/TemplateSection.d.ts +13 -0
  42. package/dist/entities/TemplateSection.js +95 -0
  43. package/dist/entities/TemplateSectionItem.d.ts +11 -0
  44. package/dist/entities/TemplateSectionItem.js +90 -0
  45. package/dist/entities/Vehicle.d.ts +15 -0
  46. package/dist/entities/Vehicle.js +83 -0
  47. package/dist/entities/Workshop.d.ts +24 -0
  48. package/dist/entities/Workshop.js +156 -0
  49. package/dist/entities.index.d.ts +23 -0
  50. package/dist/entities.index.js +47 -1
  51. package/dist/entities.views.routes.d.ts +1 -0
  52. package/dist/entities.views.routes.js +17 -0
  53. package/dist/index.d.ts +1 -0
  54. package/dist/index.js +4 -0
  55. package/package.json +10 -2
  56. package/ormconfig.json +0 -10
  57. package/src/entities/Country.ts +0 -56
  58. package/src/entities.index.ts +0 -1
  59. package/src/index.ts +0 -72
  60. package/src/types.ts +0 -1
  61. package/tsconfig.json +0 -20
  62. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,32 @@
1
+ import { City } from "./City";
2
+ import { Company } from "./Company";
3
+ import { AssociateSession } from "./AssociateSession";
4
+ import { Workshop } from "./Workshop";
5
+ import { ServiceOrderHistory } from "./ServiceOrderHistory";
6
+ import { Reminder } from "./Reminder";
7
+ import { AssociatePermission, AssociateRole } from "../entities.views.routes";
8
+ export declare class Associate {
9
+ id: number;
10
+ code: string;
11
+ company: Company;
12
+ document: string;
13
+ name: string;
14
+ surname: string;
15
+ email: string;
16
+ phone: string;
17
+ city: City;
18
+ address: string | null;
19
+ password: string;
20
+ details: any | null;
21
+ created: Date;
22
+ updated: Date | null;
23
+ owner: number;
24
+ status: number;
25
+ visible: number;
26
+ associate_sessions: AssociateSession[];
27
+ workshops_associated: Workshop[];
28
+ service_order_history: ServiceOrderHistory[];
29
+ reminders: Reminder[];
30
+ roles: AssociateRole[];
31
+ permissions: AssociatePermission[];
32
+ }
@@ -0,0 +1,228 @@
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.Associate = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const City_1 = require("./City");
15
+ const Company_1 = require("./Company");
16
+ const AssociateSession_1 = require("./AssociateSession");
17
+ const Workshop_1 = require("./Workshop");
18
+ const ServiceOrderHistory_1 = require("./ServiceOrderHistory");
19
+ const Reminder_1 = require("./Reminder");
20
+ const entities_views_routes_1 = require("../entities.views.routes");
21
+ let Associate = class Associate {
22
+ };
23
+ exports.Associate = Associate;
24
+ __decorate([
25
+ (0, typeorm_1.PrimaryGeneratedColumn)({
26
+ type: "int",
27
+ comment: "Número de identificación (ID) único de cada registro.",
28
+ }),
29
+ __metadata("design:type", Number)
30
+ ], Associate.prototype, "id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({
33
+ length: 15,
34
+ type: "varchar",
35
+ unique: true,
36
+ comment: "Código único del usuario.",
37
+ }),
38
+ __metadata("design:type", String)
39
+ ], Associate.prototype, "code", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.ManyToOne)(() => Company_1.Company, (company) => company.associates, {
42
+ onDelete: "CASCADE",
43
+ onUpdate: "NO ACTION",
44
+ }),
45
+ (0, typeorm_1.JoinColumn)({ name: "company" }),
46
+ __metadata("design:type", Company_1.Company)
47
+ ], Associate.prototype, "company", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({
50
+ type: "varchar",
51
+ length: 14,
52
+ unique: true,
53
+ comment: "Número de documento del usuario.",
54
+ }),
55
+ __metadata("design:type", String)
56
+ ], Associate.prototype, "document", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del usuario." }),
59
+ __metadata("design:type", String)
60
+ ], Associate.prototype, "name", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({
63
+ length: 50,
64
+ type: "varchar",
65
+ comment: "Apellidos del usuario.",
66
+ }),
67
+ __metadata("design:type", String)
68
+ ], Associate.prototype, "surname", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({
71
+ type: "varchar",
72
+ length: 100,
73
+ unique: true,
74
+ comment: "Correo electrónico del usuario.",
75
+ }),
76
+ __metadata("design:type", String)
77
+ ], Associate.prototype, "email", void 0);
78
+ __decorate([
79
+ (0, typeorm_1.Column)({
80
+ type: "varchar",
81
+ length: 12,
82
+ unique: true,
83
+ comment: "Número de celular del usuario.",
84
+ }),
85
+ __metadata("design:type", String)
86
+ ], Associate.prototype, "phone", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.ManyToOne)(() => City_1.City, (city) => city.associates, {
89
+ onDelete: "RESTRICT",
90
+ onUpdate: "NO ACTION",
91
+ }),
92
+ (0, typeorm_1.JoinColumn)({ name: "city" }),
93
+ __metadata("design:type", City_1.City)
94
+ ], Associate.prototype, "city", void 0);
95
+ __decorate([
96
+ (0, typeorm_1.Column)({
97
+ nullable: true,
98
+ default: null,
99
+ type: "varchar",
100
+ length: 100,
101
+ comment: "Dirección del usuario.",
102
+ }),
103
+ __metadata("design:type", Object)
104
+ ], Associate.prototype, "address", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.Column)({
107
+ type: "varchar",
108
+ length: 255,
109
+ comment: "Contraseña almacenada tipo SHA256 del usuario.",
110
+ }),
111
+ __metadata("design:type", String)
112
+ ], Associate.prototype, "password", void 0);
113
+ __decorate([
114
+ (0, typeorm_1.Column)({
115
+ type: "json",
116
+ nullable: true,
117
+ default: null,
118
+ comment: "Campo de tipo JSON donde se guarda información necesaria para el usuario.",
119
+ }),
120
+ __metadata("design:type", Object)
121
+ ], Associate.prototype, "details", void 0);
122
+ __decorate([
123
+ (0, typeorm_1.Column)({
124
+ type: "datetime",
125
+ comment: "Fecha de creación del registro.",
126
+ default: () => "CURRENT_TIMESTAMP",
127
+ }),
128
+ __metadata("design:type", Date)
129
+ ], Associate.prototype, "created", void 0);
130
+ __decorate([
131
+ (0, typeorm_1.Column)({
132
+ type: "datetime",
133
+ nullable: true,
134
+ default: null,
135
+ comment: "Fecha de actualización del registro.",
136
+ onUpdate: "CURRENT_TIMESTAMP",
137
+ }),
138
+ __metadata("design:type", Object)
139
+ ], Associate.prototype, "updated", void 0);
140
+ __decorate([
141
+ (0, typeorm_1.Column)({
142
+ default: 0,
143
+ type: "int",
144
+ width: 1,
145
+ comment: "En este campo sabemos sí el usuario que está en la tabla es dueño de una empresa/company en la plataforma.",
146
+ }),
147
+ __metadata("design:type", Number)
148
+ ], Associate.prototype, "owner", void 0);
149
+ __decorate([
150
+ (0, typeorm_1.Column)({
151
+ default: 1,
152
+ type: "int",
153
+ width: 1,
154
+ comment: "¿El usuario tiene acceso a la plataforma?:\n1. Activo: El usuario tiene acceso.\n0. Inactivo: El usuario no tiene acceso a la plataforma.",
155
+ }),
156
+ __metadata("design:type", Number)
157
+ ], Associate.prototype, "status", void 0);
158
+ __decorate([
159
+ (0, typeorm_1.Column)({
160
+ default: 1,
161
+ type: "int",
162
+ width: 1,
163
+ comment: "Es el estado para verificar si se envía en la papelera o no.",
164
+ }),
165
+ __metadata("design:type", Number)
166
+ ], Associate.prototype, "visible", void 0);
167
+ __decorate([
168
+ (0, typeorm_1.OneToMany)(() => AssociateSession_1.AssociateSession, (associateSession) => associateSession.associate),
169
+ __metadata("design:type", Array)
170
+ ], Associate.prototype, "associate_sessions", void 0);
171
+ __decorate([
172
+ (0, typeorm_1.ManyToMany)(() => Workshop_1.Workshop, (workshop) => workshop.associates),
173
+ (0, typeorm_1.JoinTable)({
174
+ name: "workshop_associate",
175
+ joinColumn: {
176
+ name: "associate",
177
+ referencedColumnName: "id",
178
+ },
179
+ inverseJoinColumn: {
180
+ name: "workshop",
181
+ referencedColumnName: "id",
182
+ },
183
+ }),
184
+ __metadata("design:type", Array)
185
+ ], Associate.prototype, "workshops_associated", void 0);
186
+ __decorate([
187
+ (0, typeorm_1.OneToMany)(() => ServiceOrderHistory_1.ServiceOrderHistory, (serviceOrderHistory) => serviceOrderHistory.associate),
188
+ __metadata("design:type", Array)
189
+ ], Associate.prototype, "service_order_history", void 0);
190
+ __decorate([
191
+ (0, typeorm_1.OneToMany)(() => Reminder_1.Reminder, (reminder) => reminder.associate),
192
+ __metadata("design:type", Array)
193
+ ], Associate.prototype, "reminders", void 0);
194
+ __decorate([
195
+ (0, typeorm_1.ManyToMany)(() => entities_views_routes_1.AssociateRole, (role) => role.associates),
196
+ (0, typeorm_1.JoinTable)({
197
+ name: "associate_assigned_role",
198
+ joinColumn: {
199
+ name: "associate",
200
+ referencedColumnName: "id",
201
+ },
202
+ inverseJoinColumn: {
203
+ name: "role",
204
+ referencedColumnName: "id",
205
+ },
206
+ }),
207
+ __metadata("design:type", Array)
208
+ ], Associate.prototype, "roles", void 0);
209
+ __decorate([
210
+ (0, typeorm_1.ManyToMany)(() => entities_views_routes_1.AssociatePermission, (permission) => permission.associates),
211
+ (0, typeorm_1.JoinTable)({
212
+ name: "associate_assigned_permission",
213
+ joinColumn: {
214
+ name: "associate",
215
+ referencedColumnName: "id",
216
+ },
217
+ inverseJoinColumn: {
218
+ name: "permission",
219
+ referencedColumnName: "id",
220
+ },
221
+ }),
222
+ __metadata("design:type", Array)
223
+ ], Associate.prototype, "permissions", void 0);
224
+ exports.Associate = Associate = __decorate([
225
+ (0, typeorm_1.Entity)({
226
+ comment: "Usuarios de los concesionarios/talleres de la plataforma.",
227
+ })
228
+ ], Associate);
@@ -0,0 +1,9 @@
1
+ import { Associate, AssociatePlatform, AssociateRole } from "../entities.views.routes";
2
+ export declare class AssociatePermission {
3
+ id: number;
4
+ platform: AssociatePlatform;
5
+ name: string;
6
+ status: number;
7
+ roles: AssociateRole[];
8
+ associates: Associate[];
9
+ }
@@ -0,0 +1,81 @@
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.AssociatePermission = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const entities_views_routes_1 = require("../entities.views.routes");
15
+ let AssociatePermission = class AssociatePermission {
16
+ };
17
+ exports.AssociatePermission = AssociatePermission;
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
+ ], AssociatePermission.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(() => entities_views_routes_1.AssociatePlatform, (platform) => platform.permissions, {
27
+ onDelete: "CASCADE",
28
+ onUpdate: "NO ACTION",
29
+ }),
30
+ (0, typeorm_1.JoinColumn)({ name: "platform" }),
31
+ __metadata("design:type", entities_views_routes_1.AssociatePlatform)
32
+ ], AssociatePermission.prototype, "platform", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del permiso." }),
35
+ __metadata("design:type", String)
36
+ ], AssociatePermission.prototype, "name", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({
39
+ default: 1,
40
+ type: "int",
41
+ width: 1,
42
+ comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
43
+ }),
44
+ __metadata("design:type", Number)
45
+ ], AssociatePermission.prototype, "status", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.ManyToMany)(() => entities_views_routes_1.AssociateRole, (role) => role.permissions),
48
+ (0, typeorm_1.JoinTable)({
49
+ name: "associate_role_permission",
50
+ joinColumn: {
51
+ name: "permission",
52
+ referencedColumnName: "id",
53
+ },
54
+ inverseJoinColumn: {
55
+ name: "role",
56
+ referencedColumnName: "id",
57
+ },
58
+ }),
59
+ __metadata("design:type", Array)
60
+ ], AssociatePermission.prototype, "roles", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.ManyToMany)(() => entities_views_routes_1.Associate, (associate) => associate.permissions),
63
+ (0, typeorm_1.JoinTable)({
64
+ name: "associate_assigned_permission",
65
+ joinColumn: {
66
+ name: "permission",
67
+ referencedColumnName: "id",
68
+ },
69
+ inverseJoinColumn: {
70
+ name: "associate",
71
+ referencedColumnName: "id",
72
+ },
73
+ }),
74
+ __metadata("design:type", Array)
75
+ ], AssociatePermission.prototype, "associates", void 0);
76
+ exports.AssociatePermission = AssociatePermission = __decorate([
77
+ (0, typeorm_1.Entity)({
78
+ comment: "Permisos que va a tener los concesionarios/talleres.",
79
+ name: "associate_permission",
80
+ })
81
+ ], AssociatePermission);
@@ -0,0 +1,8 @@
1
+ import { AssociatePermission, AssociateRole } from "../entities.views.routes";
2
+ export declare class AssociatePlatform {
3
+ id: number;
4
+ name: string;
5
+ status: number;
6
+ roles: AssociateRole[];
7
+ permissions: AssociatePermission[];
8
+ }
@@ -0,0 +1,51 @@
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.AssociatePlatform = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const entities_views_routes_1 = require("../entities.views.routes");
15
+ let AssociatePlatform = class AssociatePlatform {
16
+ };
17
+ exports.AssociatePlatform = AssociatePlatform;
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
+ ], AssociatePlatform.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre de la plataforma." }),
27
+ __metadata("design:type", String)
28
+ ], AssociatePlatform.prototype, "name", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({
31
+ default: 1,
32
+ type: "int",
33
+ width: 1,
34
+ comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
35
+ }),
36
+ __metadata("design:type", Number)
37
+ ], AssociatePlatform.prototype, "status", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.OneToMany)(() => entities_views_routes_1.AssociateRole, (role) => role.platform),
40
+ __metadata("design:type", Array)
41
+ ], AssociatePlatform.prototype, "roles", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.OneToMany)(() => entities_views_routes_1.AssociatePermission, (permission) => permission.platform),
44
+ __metadata("design:type", Array)
45
+ ], AssociatePlatform.prototype, "permissions", void 0);
46
+ exports.AssociatePlatform = AssociatePlatform = __decorate([
47
+ (0, typeorm_1.Entity)({
48
+ comment: "Plataformas que va a tener los concesionarios/talleres.",
49
+ name: "associate_platform",
50
+ })
51
+ ], AssociatePlatform);
@@ -0,0 +1,9 @@
1
+ import { Associate, AssociatePermission, AssociatePlatform } from "../entities.views.routes";
2
+ export declare class AssociateRole {
3
+ id: number;
4
+ platform: AssociatePlatform;
5
+ name: string;
6
+ status: number;
7
+ permissions: AssociatePermission[];
8
+ associates: Associate[];
9
+ }
@@ -0,0 +1,81 @@
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.AssociateRole = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const entities_views_routes_1 = require("../entities.views.routes");
15
+ let AssociateRole = class AssociateRole {
16
+ };
17
+ exports.AssociateRole = AssociateRole;
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
+ ], AssociateRole.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(() => entities_views_routes_1.AssociatePlatform, (platform) => platform.roles, {
27
+ onDelete: "CASCADE",
28
+ onUpdate: "NO ACTION",
29
+ }),
30
+ (0, typeorm_1.JoinColumn)({ name: "platform" }),
31
+ __metadata("design:type", entities_views_routes_1.AssociatePlatform)
32
+ ], AssociateRole.prototype, "platform", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del rol." }),
35
+ __metadata("design:type", String)
36
+ ], AssociateRole.prototype, "name", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({
39
+ default: 1,
40
+ type: "int",
41
+ width: 1,
42
+ comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
43
+ }),
44
+ __metadata("design:type", Number)
45
+ ], AssociateRole.prototype, "status", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.ManyToMany)(() => entities_views_routes_1.AssociatePermission, (permission) => permission.roles),
48
+ (0, typeorm_1.JoinTable)({
49
+ name: "associate_role_permission",
50
+ joinColumn: {
51
+ name: "role",
52
+ referencedColumnName: "id",
53
+ },
54
+ inverseJoinColumn: {
55
+ name: "permission",
56
+ referencedColumnName: "id",
57
+ },
58
+ }),
59
+ __metadata("design:type", Array)
60
+ ], AssociateRole.prototype, "permissions", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.ManyToMany)(() => entities_views_routes_1.Associate, (associate) => associate.roles),
63
+ (0, typeorm_1.JoinTable)({
64
+ name: "associate_assigned_role",
65
+ joinColumn: {
66
+ name: "role",
67
+ referencedColumnName: "id",
68
+ },
69
+ inverseJoinColumn: {
70
+ name: "associate",
71
+ referencedColumnName: "id",
72
+ },
73
+ }),
74
+ __metadata("design:type", Array)
75
+ ], AssociateRole.prototype, "associates", void 0);
76
+ exports.AssociateRole = AssociateRole = __decorate([
77
+ (0, typeorm_1.Entity)({
78
+ comment: "Roles que van a tener los concesionarios/talleres.",
79
+ name: "associate_role",
80
+ })
81
+ ], AssociateRole);
@@ -0,0 +1,12 @@
1
+ import { Associate } from "..";
2
+ export declare class AssociateSession {
3
+ id: number;
4
+ associate: Associate;
5
+ token: string;
6
+ ip_address: string;
7
+ start_time: Date;
8
+ finish_time: Date | null;
9
+ status: number;
10
+ created: Date;
11
+ updated: Date | null;
12
+ }
@@ -0,0 +1,97 @@
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.AssociateSession = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const __1 = require("..");
15
+ let AssociateSession = class AssociateSession {
16
+ };
17
+ exports.AssociateSession = AssociateSession;
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
+ ], AssociateSession.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(() => __1.Associate, (associate) => associate.associate_sessions, {
27
+ onDelete: "CASCADE",
28
+ onUpdate: "NO ACTION",
29
+ }),
30
+ (0, typeorm_1.JoinColumn)({ name: "associate" }),
31
+ __metadata("design:type", __1.Associate)
32
+ ], AssociateSession.prototype, "associate", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({
35
+ length: 255,
36
+ type: "varchar",
37
+ comment: "Token generado para la sesión.",
38
+ }),
39
+ __metadata("design:type", String)
40
+ ], AssociateSession.prototype, "token", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({
43
+ length: 255,
44
+ type: "varchar",
45
+ comment: "Dirección IP de donde está accediendo.",
46
+ }),
47
+ __metadata("design:type", String)
48
+ ], AssociateSession.prototype, "ip_address", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({
51
+ type: "datetime",
52
+ comment: "Fecha de inicio de la sesión.",
53
+ }),
54
+ __metadata("design:type", Date)
55
+ ], AssociateSession.prototype, "start_time", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({
58
+ type: "datetime",
59
+ nullable: true,
60
+ default: null,
61
+ comment: "Fecha de finalización de la sesión.",
62
+ }),
63
+ __metadata("design:type", Object)
64
+ ], AssociateSession.prototype, "finish_time", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({
67
+ default: 1,
68
+ type: "int",
69
+ width: 1,
70
+ comment: "Estado de la sesión:\r\n1. Activa.\r\n2. Expirada.\r\n3. Revocada.",
71
+ }),
72
+ __metadata("design:type", Number)
73
+ ], AssociateSession.prototype, "status", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.Column)({
76
+ type: "datetime",
77
+ comment: "Fecha de creación del registro.",
78
+ default: () => "CURRENT_TIMESTAMP",
79
+ }),
80
+ __metadata("design:type", Date)
81
+ ], AssociateSession.prototype, "created", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.Column)({
84
+ type: "datetime",
85
+ nullable: true,
86
+ comment: "Fecha de actualización del registro.",
87
+ default: null,
88
+ onUpdate: "CURRENT_TIMESTAMP",
89
+ }),
90
+ __metadata("design:type", Object)
91
+ ], AssociateSession.prototype, "updated", void 0);
92
+ exports.AssociateSession = AssociateSession = __decorate([
93
+ (0, typeorm_1.Entity)({
94
+ comment: "Tabla creada para llevar el control de las sesiones (associate).",
95
+ name: "associate_session",
96
+ })
97
+ ], AssociateSession);
@@ -0,0 +1,7 @@
1
+ import { Vehicle } from "./Vehicle";
2
+ export declare class Brand {
3
+ id: number;
4
+ name: string;
5
+ details: any | null;
6
+ vehicles: Vehicle[];
7
+ }
@@ -0,0 +1,46 @@
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.Brand = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Vehicle_1 = require("./Vehicle");
15
+ let Brand = class Brand {
16
+ };
17
+ exports.Brand = Brand;
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
+ ], Brand.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre de la marca." }),
27
+ __metadata("design:type", String)
28
+ ], Brand.prototype, "name", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({
31
+ type: "json",
32
+ nullable: true,
33
+ default: null,
34
+ comment: "Campo de tipo JSON para guardar la información que se necesite.",
35
+ }),
36
+ __metadata("design:type", Object)
37
+ ], Brand.prototype, "details", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.OneToMany)(() => Vehicle_1.Vehicle, (vehicle) => vehicle.brand),
40
+ __metadata("design:type", Array)
41
+ ], Brand.prototype, "vehicles", void 0);
42
+ exports.Brand = Brand = __decorate([
43
+ (0, typeorm_1.Entity)({
44
+ comment: "Marcas de vehículos que estarán disponibles en la plataforma.",
45
+ })
46
+ ], Brand);