@asumano/worklip-typeorm-db 1.1.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.
- package/dist/entities/Associate.d.ts +3 -0
- package/dist/entities/Associate.js +31 -0
- package/dist/entities/AssociatePermission.d.ts +9 -0
- package/dist/entities/AssociatePermission.js +81 -0
- package/dist/entities/AssociatePlatform.d.ts +8 -0
- package/dist/entities/AssociatePlatform.js +51 -0
- package/dist/entities/AssociateRole.d.ts +9 -0
- package/dist/entities/AssociateRole.js +81 -0
- package/dist/entities.index.d.ts +3 -0
- package/dist/entities.index.js +7 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import { AssociateSession } from "./AssociateSession";
|
|
|
4
4
|
import { Workshop } from "./Workshop";
|
|
5
5
|
import { ServiceOrderHistory } from "./ServiceOrderHistory";
|
|
6
6
|
import { Reminder } from "./Reminder";
|
|
7
|
+
import { AssociatePermission, AssociateRole } from "../entities.views.routes";
|
|
7
8
|
export declare class Associate {
|
|
8
9
|
id: number;
|
|
9
10
|
code: string;
|
|
@@ -26,4 +27,6 @@ export declare class Associate {
|
|
|
26
27
|
workshops_associated: Workshop[];
|
|
27
28
|
service_order_history: ServiceOrderHistory[];
|
|
28
29
|
reminders: Reminder[];
|
|
30
|
+
roles: AssociateRole[];
|
|
31
|
+
permissions: AssociatePermission[];
|
|
29
32
|
}
|
|
@@ -17,6 +17,7 @@ const AssociateSession_1 = require("./AssociateSession");
|
|
|
17
17
|
const Workshop_1 = require("./Workshop");
|
|
18
18
|
const ServiceOrderHistory_1 = require("./ServiceOrderHistory");
|
|
19
19
|
const Reminder_1 = require("./Reminder");
|
|
20
|
+
const entities_views_routes_1 = require("../entities.views.routes");
|
|
20
21
|
let Associate = class Associate {
|
|
21
22
|
};
|
|
22
23
|
exports.Associate = Associate;
|
|
@@ -190,6 +191,36 @@ __decorate([
|
|
|
190
191
|
(0, typeorm_1.OneToMany)(() => Reminder_1.Reminder, (reminder) => reminder.associate),
|
|
191
192
|
__metadata("design:type", Array)
|
|
192
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);
|
|
193
224
|
exports.Associate = Associate = __decorate([
|
|
194
225
|
(0, typeorm_1.Entity)({
|
|
195
226
|
comment: "Usuarios de los concesionarios/talleres de la plataforma.",
|
|
@@ -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,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);
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -19,3 +19,6 @@ export { TemplateSectionItem } from "./entities/TemplateSectionItem";
|
|
|
19
19
|
export { ServiceOrder } from "./entities/ServiceOrder";
|
|
20
20
|
export { ServiceOrderHistory } from "./entities/ServiceOrderHistory";
|
|
21
21
|
export { Reminder } from "./entities/Reminder";
|
|
22
|
+
export { AssociatePlatform } from "./entities/AssociatePlatform";
|
|
23
|
+
export { AssociateRole } from "./entities/AssociateRole";
|
|
24
|
+
export { AssociatePermission } from "./entities/AssociatePermission";
|
package/dist/entities.index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Reminder = exports.ServiceOrderHistory = exports.ServiceOrder = exports.TemplateSectionItem = exports.TemplateSection = exports.Template = exports.Workshop = exports.GlobalTemplateSectionItem = exports.GlobalTemplateSection = exports.GlobalTemplate = exports.AssociateSession = exports.MasterSession = exports.Associate = exports.Client = exports.Master = exports.Vehicle = exports.Brand = exports.Company = exports.City = exports.Region = exports.Country = void 0;
|
|
3
|
+
exports.AssociatePermission = exports.AssociateRole = exports.AssociatePlatform = exports.Reminder = exports.ServiceOrderHistory = exports.ServiceOrder = exports.TemplateSectionItem = exports.TemplateSection = exports.Template = exports.Workshop = exports.GlobalTemplateSectionItem = exports.GlobalTemplateSection = exports.GlobalTemplate = exports.AssociateSession = exports.MasterSession = exports.Associate = exports.Client = exports.Master = exports.Vehicle = exports.Brand = exports.Company = exports.City = exports.Region = exports.Country = void 0;
|
|
4
4
|
var Country_1 = require("./entities/Country");
|
|
5
5
|
Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
|
|
6
6
|
var Region_1 = require("./entities/Region");
|
|
@@ -43,3 +43,9 @@ var ServiceOrderHistory_1 = require("./entities/ServiceOrderHistory");
|
|
|
43
43
|
Object.defineProperty(exports, "ServiceOrderHistory", { enumerable: true, get: function () { return ServiceOrderHistory_1.ServiceOrderHistory; } });
|
|
44
44
|
var Reminder_1 = require("./entities/Reminder");
|
|
45
45
|
Object.defineProperty(exports, "Reminder", { enumerable: true, get: function () { return Reminder_1.Reminder; } });
|
|
46
|
+
var AssociatePlatform_1 = require("./entities/AssociatePlatform");
|
|
47
|
+
Object.defineProperty(exports, "AssociatePlatform", { enumerable: true, get: function () { return AssociatePlatform_1.AssociatePlatform; } });
|
|
48
|
+
var AssociateRole_1 = require("./entities/AssociateRole");
|
|
49
|
+
Object.defineProperty(exports, "AssociateRole", { enumerable: true, get: function () { return AssociateRole_1.AssociateRole; } });
|
|
50
|
+
var AssociatePermission_1 = require("./entities/AssociatePermission");
|
|
51
|
+
Object.defineProperty(exports, "AssociatePermission", { enumerable: true, get: function () { return AssociatePermission_1.AssociatePermission; } });
|