@asumano/worklip-typeorm-db 1.1.53 → 1.1.55
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.d.ts +2 -1
- package/dist/entities/Company.js +4 -0
- package/dist/entities/CompanyVehicleType.d.ts +7 -0
- package/dist/entities/CompanyVehicleType.js +50 -0
- package/dist/entities/Master.d.ts +2 -0
- package/dist/entities/Master.js +16 -0
- package/dist/entities/MasterPermission.d.ts +11 -0
- package/dist/entities/MasterPermission.js +79 -0
- package/dist/entities/MasterPlatform.d.ts +10 -0
- package/dist/entities/MasterPlatform.js +83 -0
- package/dist/entities/MasterRole.d.ts +8 -0
- package/dist/entities/MasterRole.js +70 -0
- package/dist/entities/MasterSection.d.ts +10 -0
- package/dist/entities/MasterSection.js +73 -0
- package/dist/entities/VehicleType.d.ts +2 -0
- package/dist/entities/VehicleType.js +5 -0
- package/dist/entities.index.d.ts +5 -0
- package/dist/entities.index.js +12 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Vehicle } from "./Vehicle";
|
|
|
2
2
|
import { Client } from "./Client";
|
|
3
3
|
import { Associate } from "./Associate";
|
|
4
4
|
import { Workshop } from "./Workshop";
|
|
5
|
-
import { BillingInvoice, BillingUsageSnapshot, CompanyBrand, CompanySubscription, Country, EmailLog, MediaFile, PaymentMethod, ServiceOrderApproval, UsageAlert, WhatsappLog } from "..";
|
|
5
|
+
import { BillingInvoice, BillingUsageSnapshot, CompanyBrand, CompanySubscription, CompanyVehicleType, Country, EmailLog, MediaFile, PaymentMethod, ServiceOrderApproval, UsageAlert, WhatsappLog } from "..";
|
|
6
6
|
export declare class Company {
|
|
7
7
|
id: number;
|
|
8
8
|
country: Country;
|
|
@@ -15,6 +15,7 @@ export declare class Company {
|
|
|
15
15
|
associates: Associate[];
|
|
16
16
|
workshops: Workshop[];
|
|
17
17
|
companyBrands: CompanyBrand[];
|
|
18
|
+
companyVehicleTypes: CompanyVehicleType[];
|
|
18
19
|
payment_methods: PaymentMethod[];
|
|
19
20
|
billing_usage_snapshots: BillingUsageSnapshot[];
|
|
20
21
|
media_files: MediaFile[];
|
package/dist/entities/Company.js
CHANGED
|
@@ -85,6 +85,10 @@ __decorate([
|
|
|
85
85
|
(0, typeorm_1.OneToMany)(() => __1.CompanyBrand, (companyBrand) => companyBrand.company),
|
|
86
86
|
__metadata("design:type", Array)
|
|
87
87
|
], Company.prototype, "companyBrands", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.OneToMany)(() => __1.CompanyVehicleType, (companyVehicleType) => companyVehicleType.company),
|
|
90
|
+
__metadata("design:type", Array)
|
|
91
|
+
], Company.prototype, "companyVehicleTypes", void 0);
|
|
88
92
|
__decorate([
|
|
89
93
|
(0, typeorm_1.OneToMany)(() => __1.PaymentMethod, (paymentMethod) => paymentMethod.company),
|
|
90
94
|
__metadata("design:type", Array)
|
|
@@ -0,0 +1,50 @@
|
|
|
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.CompanyVehicleType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Company_1 = require("./Company");
|
|
15
|
+
const VehicleType_1 = require("./VehicleType");
|
|
16
|
+
let CompanyVehicleType = class CompanyVehicleType {
|
|
17
|
+
};
|
|
18
|
+
exports.CompanyVehicleType = CompanyVehicleType;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
+
type: "int",
|
|
22
|
+
comment: "ID único de cada registro.",
|
|
23
|
+
}),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], CompanyVehicleType.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, (company) => company.companyVehicleTypes, {
|
|
28
|
+
onDelete: "CASCADE",
|
|
29
|
+
onUpdate: "NO ACTION",
|
|
30
|
+
}),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
32
|
+
__metadata("design:type", Company_1.Company)
|
|
33
|
+
], CompanyVehicleType.prototype, "company", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(() => VehicleType_1.VehicleType, (vehicleType) => vehicleType.companyVehicleTypes, {
|
|
36
|
+
onDelete: "RESTRICT",
|
|
37
|
+
onUpdate: "NO ACTION",
|
|
38
|
+
}),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: "vehicle_type" }),
|
|
40
|
+
__metadata("design:type", VehicleType_1.VehicleType)
|
|
41
|
+
], CompanyVehicleType.prototype, "vehicle_type", void 0);
|
|
42
|
+
exports.CompanyVehicleType = CompanyVehicleType = __decorate([
|
|
43
|
+
(0, typeorm_1.Entity)({
|
|
44
|
+
name: "company_vehicle_type",
|
|
45
|
+
comment: "Relación entre los tipos de vehículos y los concesionarios/talleres, hay unos concesionarios/talleres que solo manejan ciertos tipos de vehículos.",
|
|
46
|
+
}),
|
|
47
|
+
(0, typeorm_1.Index)("UQ_company_vehicle_type", ["company", "vehicle_type"], {
|
|
48
|
+
unique: true,
|
|
49
|
+
})
|
|
50
|
+
], CompanyVehicleType);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { City } from "./City";
|
|
2
|
+
import { MasterPermission } from "./MasterPermission";
|
|
2
3
|
import { MasterSession } from "./MasterSession";
|
|
3
4
|
export declare class Master {
|
|
4
5
|
id: number;
|
|
@@ -17,4 +18,5 @@ export declare class Master {
|
|
|
17
18
|
status: number;
|
|
18
19
|
visible: number;
|
|
19
20
|
master_sessions: MasterSession[];
|
|
21
|
+
permissions: MasterPermission[];
|
|
20
22
|
}
|
package/dist/entities/Master.js
CHANGED
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Master = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const City_1 = require("./City");
|
|
15
|
+
const MasterPermission_1 = require("./MasterPermission");
|
|
15
16
|
const MasterSession_1 = require("./MasterSession");
|
|
16
17
|
let Master = class Master {
|
|
17
18
|
};
|
|
@@ -146,6 +147,21 @@ __decorate([
|
|
|
146
147
|
(0, typeorm_1.OneToMany)(() => MasterSession_1.MasterSession, (masterSession) => masterSession.master),
|
|
147
148
|
__metadata("design:type", Array)
|
|
148
149
|
], Master.prototype, "master_sessions", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, typeorm_1.ManyToMany)(() => MasterPermission_1.MasterPermission, (permission) => permission.masters),
|
|
152
|
+
(0, typeorm_1.JoinTable)({
|
|
153
|
+
name: "master_assigned_permission",
|
|
154
|
+
joinColumn: {
|
|
155
|
+
name: "master",
|
|
156
|
+
referencedColumnName: "id",
|
|
157
|
+
},
|
|
158
|
+
inverseJoinColumn: {
|
|
159
|
+
name: "permission",
|
|
160
|
+
referencedColumnName: "id",
|
|
161
|
+
},
|
|
162
|
+
}),
|
|
163
|
+
__metadata("design:type", Array)
|
|
164
|
+
], Master.prototype, "permissions", void 0);
|
|
149
165
|
exports.Master = Master = __decorate([
|
|
150
166
|
(0, typeorm_1.Entity)({
|
|
151
167
|
comment: "Usuarios tipo administrador de la plataforma.",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Master, MasterRole, MasterSection } from "../entities.views.routes";
|
|
2
|
+
export declare class MasterPermission {
|
|
3
|
+
id: number;
|
|
4
|
+
section: MasterSection;
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
status: number;
|
|
9
|
+
roles: MasterRole[];
|
|
10
|
+
masters: Master[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.MasterPermission = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const entities_views_routes_1 = require("../entities.views.routes");
|
|
15
|
+
// DOC: Espejo de AssociatePermission para la plataforma administrativa.
|
|
16
|
+
// `name` es el string que valida el backend (convención ACCIÓN_SECCIÓN,
|
|
17
|
+
// p. ej. VIEW_COMPANY / CREATE_COMPANY) y el que consume el front desde
|
|
18
|
+
// global/permissions.ts.
|
|
19
|
+
let MasterPermission = class MasterPermission {
|
|
20
|
+
};
|
|
21
|
+
exports.MasterPermission = MasterPermission;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
24
|
+
type: "int",
|
|
25
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
26
|
+
}),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], MasterPermission.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => entities_views_routes_1.MasterSection, (section) => section.permissions, {
|
|
31
|
+
onDelete: "CASCADE",
|
|
32
|
+
onUpdate: "NO ACTION",
|
|
33
|
+
}),
|
|
34
|
+
(0, typeorm_1.JoinColumn)({ name: "section" }),
|
|
35
|
+
__metadata("design:type", entities_views_routes_1.MasterSection)
|
|
36
|
+
], MasterPermission.prototype, "section", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del permiso." }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], MasterPermission.prototype, "name", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
length: 100,
|
|
44
|
+
type: "varchar",
|
|
45
|
+
comment: "Nombre que se va a mostrar en la página.",
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], MasterPermission.prototype, "label", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({
|
|
51
|
+
length: 30,
|
|
52
|
+
type: "varchar",
|
|
53
|
+
comment: "Icono que se va a mostrar en la página.",
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], MasterPermission.prototype, "icon", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({
|
|
59
|
+
default: 1,
|
|
60
|
+
type: "int",
|
|
61
|
+
width: 1,
|
|
62
|
+
comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Number)
|
|
65
|
+
], MasterPermission.prototype, "status", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.ManyToMany)(() => entities_views_routes_1.MasterRole, (role) => role.permissions),
|
|
68
|
+
__metadata("design:type", Array)
|
|
69
|
+
], MasterPermission.prototype, "roles", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.ManyToMany)(() => entities_views_routes_1.Master, (master) => master.permissions),
|
|
72
|
+
__metadata("design:type", Array)
|
|
73
|
+
], MasterPermission.prototype, "masters", void 0);
|
|
74
|
+
exports.MasterPermission = MasterPermission = __decorate([
|
|
75
|
+
(0, typeorm_1.Entity)({
|
|
76
|
+
comment: "Permisos que va a tener el administrador.",
|
|
77
|
+
name: "master_permission",
|
|
78
|
+
})
|
|
79
|
+
], MasterPermission);
|
|
@@ -0,0 +1,83 @@
|
|
|
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.MasterPlatform = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const entities_views_routes_1 = require("../entities.views.routes");
|
|
15
|
+
// DOC: Espejo de AssociatePlatform para la PLATAFORMA ADMINISTRATIVA. Se
|
|
16
|
+
// mantienen tablas separadas (master_*) en vez de reutilizar las de
|
|
17
|
+
// asociados porque son dos universos distintos: los permisos del operativo
|
|
18
|
+
// (visitas, talleres, plantillas) no tienen sentido para un administrador,
|
|
19
|
+
// y mezclarlos obligaría a filtrar por tipo de usuario en cada consulta.
|
|
20
|
+
let MasterPlatform = class MasterPlatform {
|
|
21
|
+
};
|
|
22
|
+
exports.MasterPlatform = MasterPlatform;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
25
|
+
type: "int",
|
|
26
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
27
|
+
}),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], MasterPlatform.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre de la plataforma." }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], MasterPlatform.prototype, "name", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({
|
|
36
|
+
length: 50,
|
|
37
|
+
type: "varchar",
|
|
38
|
+
comment: "Nombre que se va a mostrar en la página.",
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], MasterPlatform.prototype, "label", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({
|
|
44
|
+
length: 30,
|
|
45
|
+
type: "varchar",
|
|
46
|
+
comment: "Icono que se va a mostrar en la página.",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], MasterPlatform.prototype, "icon", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({
|
|
52
|
+
default: 1,
|
|
53
|
+
type: "int",
|
|
54
|
+
width: 1,
|
|
55
|
+
comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], MasterPlatform.prototype, "status", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.OneToMany)(() => entities_views_routes_1.MasterRole, (role) => role.platform),
|
|
61
|
+
__metadata("design:type", Array)
|
|
62
|
+
], MasterPlatform.prototype, "roles", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.ManyToMany)(() => entities_views_routes_1.MasterSection, (section) => section.platforms),
|
|
65
|
+
(0, typeorm_1.JoinTable)({
|
|
66
|
+
name: "master_platform_section",
|
|
67
|
+
joinColumn: {
|
|
68
|
+
name: "platform",
|
|
69
|
+
referencedColumnName: "id",
|
|
70
|
+
},
|
|
71
|
+
inverseJoinColumn: {
|
|
72
|
+
name: "section",
|
|
73
|
+
referencedColumnName: "id",
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Array)
|
|
77
|
+
], MasterPlatform.prototype, "sections", void 0);
|
|
78
|
+
exports.MasterPlatform = MasterPlatform = __decorate([
|
|
79
|
+
(0, typeorm_1.Entity)({
|
|
80
|
+
comment: "Plataformas que va a tener el administrador.",
|
|
81
|
+
name: "master_platform",
|
|
82
|
+
})
|
|
83
|
+
], MasterPlatform);
|
|
@@ -0,0 +1,70 @@
|
|
|
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.MasterRole = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const entities_views_routes_1 = require("../entities.views.routes");
|
|
15
|
+
// DOC: Espejo de AssociateRole para la plataforma administrativa. El rol es una
|
|
16
|
+
// PLANTILLA de permisos: al crear un administrador se copian los permisos
|
|
17
|
+
// del rol a master_assigned_permission, que es lo que de verdad valida el
|
|
18
|
+
// backend (igual que en asociados).
|
|
19
|
+
let MasterRole = class MasterRole {
|
|
20
|
+
};
|
|
21
|
+
exports.MasterRole = MasterRole;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
24
|
+
type: "int",
|
|
25
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
26
|
+
}),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], MasterRole.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => entities_views_routes_1.MasterPlatform, (platform) => platform.roles, {
|
|
31
|
+
onDelete: "CASCADE",
|
|
32
|
+
onUpdate: "NO ACTION",
|
|
33
|
+
}),
|
|
34
|
+
(0, typeorm_1.JoinColumn)({ name: "platform" }),
|
|
35
|
+
__metadata("design:type", entities_views_routes_1.MasterPlatform)
|
|
36
|
+
], MasterRole.prototype, "platform", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del rol." }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], MasterRole.prototype, "name", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
default: 1,
|
|
44
|
+
type: "int",
|
|
45
|
+
width: 1,
|
|
46
|
+
comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], MasterRole.prototype, "status", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToMany)(() => entities_views_routes_1.MasterPermission, (permission) => permission.roles),
|
|
52
|
+
(0, typeorm_1.JoinTable)({
|
|
53
|
+
name: "master_role_permission",
|
|
54
|
+
joinColumn: {
|
|
55
|
+
name: "role",
|
|
56
|
+
referencedColumnName: "id",
|
|
57
|
+
},
|
|
58
|
+
inverseJoinColumn: {
|
|
59
|
+
name: "permission",
|
|
60
|
+
referencedColumnName: "id",
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", Array)
|
|
64
|
+
], MasterRole.prototype, "permissions", void 0);
|
|
65
|
+
exports.MasterRole = MasterRole = __decorate([
|
|
66
|
+
(0, typeorm_1.Entity)({
|
|
67
|
+
comment: "Roles que va a tener el administrador.",
|
|
68
|
+
name: "master_role",
|
|
69
|
+
})
|
|
70
|
+
], MasterRole);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MasterPermission, MasterPlatform } from "../entities.views.routes";
|
|
2
|
+
export declare class MasterSection {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
status: number;
|
|
8
|
+
platforms: MasterPlatform[];
|
|
9
|
+
permissions: MasterPermission[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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.MasterSection = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const entities_views_routes_1 = require("../entities.views.routes");
|
|
15
|
+
// DOC: Espejo de AssociateSection para la plataforma administrativa.
|
|
16
|
+
// Sección = agrupación de permisos (p. ej. EMPRESAS, PLANES, ADMINISTRADORES).
|
|
17
|
+
//
|
|
18
|
+
// Nota: el @JoinTable de la relación con plataformas vive en MasterPlatform
|
|
19
|
+
// (lado dueño). En AssociateSection está declarado en AMBOS lados, lo cual
|
|
20
|
+
// es redundante; aquí se deja solo en uno.
|
|
21
|
+
let MasterSection = class MasterSection {
|
|
22
|
+
};
|
|
23
|
+
exports.MasterSection = MasterSection;
|
|
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
|
+
], MasterSection.prototype, "id", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre de la sección." }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], MasterSection.prototype, "name", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({
|
|
37
|
+
length: 100,
|
|
38
|
+
type: "varchar",
|
|
39
|
+
comment: "Nombre que se va a mostrar en la página.",
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], MasterSection.prototype, "label", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({
|
|
45
|
+
length: 30,
|
|
46
|
+
type: "varchar",
|
|
47
|
+
comment: "Icono que se va a mostrar en la página.",
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], MasterSection.prototype, "icon", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({
|
|
53
|
+
default: 1,
|
|
54
|
+
type: "int",
|
|
55
|
+
width: 1,
|
|
56
|
+
comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], MasterSection.prototype, "status", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.ManyToMany)(() => entities_views_routes_1.MasterPlatform, (platform) => platform.sections),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], MasterSection.prototype, "platforms", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.OneToMany)(() => entities_views_routes_1.MasterPermission, (permission) => permission.section),
|
|
66
|
+
__metadata("design:type", Array)
|
|
67
|
+
], MasterSection.prototype, "permissions", void 0);
|
|
68
|
+
exports.MasterSection = MasterSection = __decorate([
|
|
69
|
+
(0, typeorm_1.Entity)({
|
|
70
|
+
comment: "Secciones que va a tener el administrador.",
|
|
71
|
+
name: "master_section",
|
|
72
|
+
})
|
|
73
|
+
], MasterSection);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CompanyVehicleType } from "./CompanyVehicleType";
|
|
1
2
|
import { GlobalTemplate } from "./GlobalTemplate";
|
|
2
3
|
import { Template } from "./Template";
|
|
3
4
|
import { Vehicle } from "./Vehicle";
|
|
@@ -9,4 +10,5 @@ export declare class VehicleType {
|
|
|
9
10
|
vehicle_types: Vehicle[];
|
|
10
11
|
vehicle_types_template: Template[];
|
|
11
12
|
vehicle_types_global_template: GlobalTemplate[];
|
|
13
|
+
companyVehicleTypes: CompanyVehicleType[];
|
|
12
14
|
}
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.VehicleType = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
|
+
const CompanyVehicleType_1 = require("./CompanyVehicleType");
|
|
14
15
|
const GlobalTemplate_1 = require("./GlobalTemplate");
|
|
15
16
|
const Template_1 = require("./Template");
|
|
16
17
|
const Vehicle_1 = require("./Vehicle");
|
|
@@ -62,6 +63,10 @@ __decorate([
|
|
|
62
63
|
(0, typeorm_1.OneToMany)(() => GlobalTemplate_1.GlobalTemplate, (globalTemplate) => globalTemplate.vehicle_type),
|
|
63
64
|
__metadata("design:type", Array)
|
|
64
65
|
], VehicleType.prototype, "vehicle_types_global_template", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.OneToMany)(() => CompanyVehicleType_1.CompanyVehicleType, (companyVehicleType) => companyVehicleType.vehicle_type),
|
|
68
|
+
__metadata("design:type", Array)
|
|
69
|
+
], VehicleType.prototype, "companyVehicleTypes", void 0);
|
|
65
70
|
exports.VehicleType = VehicleType = __decorate([
|
|
66
71
|
(0, typeorm_1.Entity)({
|
|
67
72
|
comment: "Tabla creada para agregar los tipos de vehículos que va a manejar el concesionario/taller.",
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -24,8 +24,13 @@ export { AssociateRole } from "./entities/AssociateRole";
|
|
|
24
24
|
export { AssociatePermission } from "./entities/AssociatePermission";
|
|
25
25
|
export { AssociateSection } from "./entities/AssociateSection";
|
|
26
26
|
export { AssociatePasswordReset } from "./entities/AssociatePasswordReset";
|
|
27
|
+
export { MasterPlatform } from "./entities/MasterPlatform";
|
|
28
|
+
export { MasterRole } from "./entities/MasterRole";
|
|
29
|
+
export { MasterPermission } from "./entities/MasterPermission";
|
|
30
|
+
export { MasterSection } from "./entities/MasterSection";
|
|
27
31
|
export { VehicleType } from "./entities/VehicleType";
|
|
28
32
|
export { CompanyBrand } from "./entities/CompanyBrand";
|
|
33
|
+
export { CompanyVehicleType } from "./entities/CompanyVehicleType";
|
|
29
34
|
export { CountryHoliday } from "./entities/CountryHoliday";
|
|
30
35
|
export { SubscriptionPlan } from "./entities/SubscriptionPlan";
|
|
31
36
|
export { CompanySubscription } from "./entities/CompanySubscription";
|
package/dist/entities.index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.WorkshopsByAssociate = exports.Workshops = void 0;
|
|
3
|
+
exports.Clients = exports.ServicesOrder = exports.Associates = exports.UsageAlert = exports.SubscriptionAddonTemplate = exports.PaymentTransaction = exports.BillingInvoice = exports.EmailLog = exports.WhatsappLog = exports.ServiceOrderApproval = exports.MediaFile = exports.BillingUsageSnapshot = exports.PaymentMethod = exports.SubscriptionAddon = exports.CompanySubscription = exports.SubscriptionPlan = exports.CountryHoliday = exports.CompanyVehicleType = exports.CompanyBrand = exports.VehicleType = exports.MasterSection = exports.MasterPermission = exports.MasterRole = exports.MasterPlatform = exports.AssociatePasswordReset = exports.AssociateSection = 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
|
+
exports.WorkshopsByAssociate = exports.Workshops = exports.TemplateSectionItems = exports.TemplateSections = exports.Templates = exports.Reminders = exports.Vehicles = void 0;
|
|
5
5
|
var Country_1 = require("./entities/Country");
|
|
6
6
|
Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
|
|
7
7
|
var Region_1 = require("./entities/Region");
|
|
@@ -54,10 +54,20 @@ var AssociateSection_1 = require("./entities/AssociateSection");
|
|
|
54
54
|
Object.defineProperty(exports, "AssociateSection", { enumerable: true, get: function () { return AssociateSection_1.AssociateSection; } });
|
|
55
55
|
var AssociatePasswordReset_1 = require("./entities/AssociatePasswordReset");
|
|
56
56
|
Object.defineProperty(exports, "AssociatePasswordReset", { enumerable: true, get: function () { return AssociatePasswordReset_1.AssociatePasswordReset; } });
|
|
57
|
+
var MasterPlatform_1 = require("./entities/MasterPlatform");
|
|
58
|
+
Object.defineProperty(exports, "MasterPlatform", { enumerable: true, get: function () { return MasterPlatform_1.MasterPlatform; } });
|
|
59
|
+
var MasterRole_1 = require("./entities/MasterRole");
|
|
60
|
+
Object.defineProperty(exports, "MasterRole", { enumerable: true, get: function () { return MasterRole_1.MasterRole; } });
|
|
61
|
+
var MasterPermission_1 = require("./entities/MasterPermission");
|
|
62
|
+
Object.defineProperty(exports, "MasterPermission", { enumerable: true, get: function () { return MasterPermission_1.MasterPermission; } });
|
|
63
|
+
var MasterSection_1 = require("./entities/MasterSection");
|
|
64
|
+
Object.defineProperty(exports, "MasterSection", { enumerable: true, get: function () { return MasterSection_1.MasterSection; } });
|
|
57
65
|
var VehicleType_1 = require("./entities/VehicleType");
|
|
58
66
|
Object.defineProperty(exports, "VehicleType", { enumerable: true, get: function () { return VehicleType_1.VehicleType; } });
|
|
59
67
|
var CompanyBrand_1 = require("./entities/CompanyBrand");
|
|
60
68
|
Object.defineProperty(exports, "CompanyBrand", { enumerable: true, get: function () { return CompanyBrand_1.CompanyBrand; } });
|
|
69
|
+
var CompanyVehicleType_1 = require("./entities/CompanyVehicleType");
|
|
70
|
+
Object.defineProperty(exports, "CompanyVehicleType", { enumerable: true, get: function () { return CompanyVehicleType_1.CompanyVehicleType; } });
|
|
61
71
|
var CountryHoliday_1 = require("./entities/CountryHoliday");
|
|
62
72
|
Object.defineProperty(exports, "CountryHoliday", { enumerable: true, get: function () { return CountryHoliday_1.CountryHoliday; } });
|
|
63
73
|
var SubscriptionPlan_1 = require("./entities/SubscriptionPlan");
|