@asumano/worklip-typeorm-db 1.0.0 → 1.1.0
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 +29 -0
- package/dist/entities/Associate.js +197 -0
- package/dist/entities/AssociateSession.d.ts +12 -0
- package/dist/entities/AssociateSession.js +97 -0
- package/dist/entities/Brand.d.ts +7 -0
- package/dist/entities/Brand.js +46 -0
- package/dist/entities/City.d.ts +15 -0
- package/dist/entities/City.js +68 -0
- package/dist/entities/Client.d.ts +17 -0
- package/dist/entities/Client.js +107 -0
- package/dist/entities/Company.d.ts +15 -0
- package/dist/entities/Company.js +77 -0
- package/dist/entities/Country.d.ts +2 -0
- package/dist/entities/Country.js +5 -0
- package/dist/entities/GlobalTemplate.d.ts +10 -0
- package/dist/entities/GlobalTemplate.js +78 -0
- package/dist/entities/GlobalTemplateSection.d.ts +13 -0
- package/dist/entities/GlobalTemplateSection.js +95 -0
- package/dist/entities/GlobalTemplateSectionItem.d.ts +11 -0
- package/dist/entities/GlobalTemplateSectionItem.js +90 -0
- package/dist/entities/Master.d.ts +20 -0
- package/dist/entities/Master.js +153 -0
- package/dist/entities/MasterSession.d.ts +12 -0
- package/dist/entities/MasterSession.js +97 -0
- package/dist/entities/Region.d.ts +9 -0
- package/dist/entities/Region.js +59 -0
- package/dist/entities/Reminder.d.ts +15 -0
- package/dist/entities/Reminder.js +96 -0
- package/dist/entities/ServiceOrder.d.ts +18 -0
- package/dist/entities/ServiceOrder.js +115 -0
- package/dist/entities/ServiceOrderHistory.d.ts +9 -0
- package/dist/entities/ServiceOrderHistory.js +64 -0
- package/dist/entities/Template.d.ts +14 -0
- package/dist/entities/Template.js +91 -0
- package/dist/entities/TemplateSection.d.ts +13 -0
- package/dist/entities/TemplateSection.js +95 -0
- package/dist/entities/TemplateSectionItem.d.ts +11 -0
- package/dist/entities/TemplateSectionItem.js +90 -0
- package/dist/entities/Vehicle.d.ts +15 -0
- package/dist/entities/Vehicle.js +83 -0
- package/dist/entities/Workshop.d.ts +24 -0
- package/dist/entities/Workshop.js +156 -0
- package/dist/entities.index.d.ts +20 -0
- package/dist/entities.index.js +41 -1
- package/dist/entities.views.routes.d.ts +1 -0
- package/dist/entities.views.routes.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/package.json +10 -2
- package/ormconfig.json +0 -10
- package/src/entities/Country.ts +0 -56
- package/src/entities.index.ts +0 -1
- package/src/index.ts +0 -72
- package/src/types.ts +0 -1
- package/tsconfig.json +0 -20
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export declare class Associate {
|
|
8
|
+
id: number;
|
|
9
|
+
code: string;
|
|
10
|
+
company: Company;
|
|
11
|
+
document: string;
|
|
12
|
+
name: string;
|
|
13
|
+
surname: string;
|
|
14
|
+
email: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
city: City;
|
|
17
|
+
address: string | null;
|
|
18
|
+
password: string;
|
|
19
|
+
details: any | null;
|
|
20
|
+
created: Date;
|
|
21
|
+
updated: Date | null;
|
|
22
|
+
owner: number;
|
|
23
|
+
status: number;
|
|
24
|
+
visible: number;
|
|
25
|
+
associate_sessions: AssociateSession[];
|
|
26
|
+
workshops_associated: Workshop[];
|
|
27
|
+
service_order_history: ServiceOrderHistory[];
|
|
28
|
+
reminders: Reminder[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
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
|
+
let Associate = class Associate {
|
|
21
|
+
};
|
|
22
|
+
exports.Associate = Associate;
|
|
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
|
+
], Associate.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({
|
|
32
|
+
length: 15,
|
|
33
|
+
type: "varchar",
|
|
34
|
+
unique: true,
|
|
35
|
+
comment: "Código único del usuario.",
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Associate.prototype, "code", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, (company) => company.associates, {
|
|
41
|
+
onDelete: "CASCADE",
|
|
42
|
+
onUpdate: "NO ACTION",
|
|
43
|
+
}),
|
|
44
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
45
|
+
__metadata("design:type", Company_1.Company)
|
|
46
|
+
], Associate.prototype, "company", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({
|
|
49
|
+
type: "varchar",
|
|
50
|
+
length: 14,
|
|
51
|
+
unique: true,
|
|
52
|
+
comment: "Número de documento del usuario.",
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], Associate.prototype, "document", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del usuario." }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], Associate.prototype, "name", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({
|
|
62
|
+
length: 50,
|
|
63
|
+
type: "varchar",
|
|
64
|
+
comment: "Apellidos del usuario.",
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], Associate.prototype, "surname", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({
|
|
70
|
+
type: "varchar",
|
|
71
|
+
length: 100,
|
|
72
|
+
unique: true,
|
|
73
|
+
comment: "Correo electrónico del usuario.",
|
|
74
|
+
}),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], Associate.prototype, "email", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({
|
|
79
|
+
type: "varchar",
|
|
80
|
+
length: 12,
|
|
81
|
+
unique: true,
|
|
82
|
+
comment: "Número de celular del usuario.",
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], Associate.prototype, "phone", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.ManyToOne)(() => City_1.City, (city) => city.associates, {
|
|
88
|
+
onDelete: "RESTRICT",
|
|
89
|
+
onUpdate: "NO ACTION",
|
|
90
|
+
}),
|
|
91
|
+
(0, typeorm_1.JoinColumn)({ name: "city" }),
|
|
92
|
+
__metadata("design:type", City_1.City)
|
|
93
|
+
], Associate.prototype, "city", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.Column)({
|
|
96
|
+
nullable: true,
|
|
97
|
+
default: null,
|
|
98
|
+
type: "varchar",
|
|
99
|
+
length: 100,
|
|
100
|
+
comment: "Dirección del usuario.",
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], Associate.prototype, "address", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({
|
|
106
|
+
type: "varchar",
|
|
107
|
+
length: 255,
|
|
108
|
+
comment: "Contraseña almacenada tipo SHA256 del usuario.",
|
|
109
|
+
}),
|
|
110
|
+
__metadata("design:type", String)
|
|
111
|
+
], Associate.prototype, "password", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({
|
|
114
|
+
type: "json",
|
|
115
|
+
nullable: true,
|
|
116
|
+
default: null,
|
|
117
|
+
comment: "Campo de tipo JSON donde se guarda información necesaria para el usuario.",
|
|
118
|
+
}),
|
|
119
|
+
__metadata("design:type", Object)
|
|
120
|
+
], Associate.prototype, "details", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, typeorm_1.Column)({
|
|
123
|
+
type: "datetime",
|
|
124
|
+
comment: "Fecha de creación del registro.",
|
|
125
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
126
|
+
}),
|
|
127
|
+
__metadata("design:type", Date)
|
|
128
|
+
], Associate.prototype, "created", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, typeorm_1.Column)({
|
|
131
|
+
type: "datetime",
|
|
132
|
+
nullable: true,
|
|
133
|
+
default: null,
|
|
134
|
+
comment: "Fecha de actualización del registro.",
|
|
135
|
+
onUpdate: "CURRENT_TIMESTAMP",
|
|
136
|
+
}),
|
|
137
|
+
__metadata("design:type", Object)
|
|
138
|
+
], Associate.prototype, "updated", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, typeorm_1.Column)({
|
|
141
|
+
default: 0,
|
|
142
|
+
type: "int",
|
|
143
|
+
width: 1,
|
|
144
|
+
comment: "En este campo sabemos sí el usuario que está en la tabla es dueño de una empresa/company en la plataforma.",
|
|
145
|
+
}),
|
|
146
|
+
__metadata("design:type", Number)
|
|
147
|
+
], Associate.prototype, "owner", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, typeorm_1.Column)({
|
|
150
|
+
default: 1,
|
|
151
|
+
type: "int",
|
|
152
|
+
width: 1,
|
|
153
|
+
comment: "¿El usuario tiene acceso a la plataforma?:\n1. Activo: El usuario tiene acceso.\n0. Inactivo: El usuario no tiene acceso a la plataforma.",
|
|
154
|
+
}),
|
|
155
|
+
__metadata("design:type", Number)
|
|
156
|
+
], Associate.prototype, "status", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, typeorm_1.Column)({
|
|
159
|
+
default: 1,
|
|
160
|
+
type: "int",
|
|
161
|
+
width: 1,
|
|
162
|
+
comment: "Es el estado para verificar si se envía en la papelera o no.",
|
|
163
|
+
}),
|
|
164
|
+
__metadata("design:type", Number)
|
|
165
|
+
], Associate.prototype, "visible", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, typeorm_1.OneToMany)(() => AssociateSession_1.AssociateSession, (associateSession) => associateSession.associate),
|
|
168
|
+
__metadata("design:type", Array)
|
|
169
|
+
], Associate.prototype, "associate_sessions", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, typeorm_1.ManyToMany)(() => Workshop_1.Workshop, (workshop) => workshop.associates),
|
|
172
|
+
(0, typeorm_1.JoinTable)({
|
|
173
|
+
name: "workshop_associate",
|
|
174
|
+
joinColumn: {
|
|
175
|
+
name: "associate",
|
|
176
|
+
referencedColumnName: "id",
|
|
177
|
+
},
|
|
178
|
+
inverseJoinColumn: {
|
|
179
|
+
name: "workshop",
|
|
180
|
+
referencedColumnName: "id",
|
|
181
|
+
},
|
|
182
|
+
}),
|
|
183
|
+
__metadata("design:type", Array)
|
|
184
|
+
], Associate.prototype, "workshops_associated", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, typeorm_1.OneToMany)(() => ServiceOrderHistory_1.ServiceOrderHistory, (serviceOrderHistory) => serviceOrderHistory.associate),
|
|
187
|
+
__metadata("design:type", Array)
|
|
188
|
+
], Associate.prototype, "service_order_history", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, typeorm_1.OneToMany)(() => Reminder_1.Reminder, (reminder) => reminder.associate),
|
|
191
|
+
__metadata("design:type", Array)
|
|
192
|
+
], Associate.prototype, "reminders", void 0);
|
|
193
|
+
exports.Associate = Associate = __decorate([
|
|
194
|
+
(0, typeorm_1.Entity)({
|
|
195
|
+
comment: "Usuarios de los concesionarios/talleres de la plataforma.",
|
|
196
|
+
})
|
|
197
|
+
], Associate);
|
|
@@ -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,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);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Region } from "./Region";
|
|
2
|
+
import { Master } from "./Master";
|
|
3
|
+
import { Client } from "./Client";
|
|
4
|
+
import { Associate } from "./Associate";
|
|
5
|
+
import { Workshop } from "./Workshop";
|
|
6
|
+
export declare class City {
|
|
7
|
+
id: number;
|
|
8
|
+
region: Region;
|
|
9
|
+
name: string;
|
|
10
|
+
status: number;
|
|
11
|
+
masters: Master[];
|
|
12
|
+
clients: Client[];
|
|
13
|
+
associates: Associate[];
|
|
14
|
+
workshops: Workshop[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.City = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Region_1 = require("./Region");
|
|
15
|
+
const Master_1 = require("./Master");
|
|
16
|
+
const Client_1 = require("./Client");
|
|
17
|
+
const Associate_1 = require("./Associate");
|
|
18
|
+
const Workshop_1 = require("./Workshop");
|
|
19
|
+
let City = class City {
|
|
20
|
+
};
|
|
21
|
+
exports.City = City;
|
|
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
|
+
], City.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => Region_1.Region, (region) => region.cities, {
|
|
31
|
+
onDelete: "RESTRICT",
|
|
32
|
+
onUpdate: "RESTRICT",
|
|
33
|
+
}),
|
|
34
|
+
(0, typeorm_1.JoinColumn)({ name: "region" }),
|
|
35
|
+
__metadata("design:type", Region_1.Region)
|
|
36
|
+
], City.prototype, "region", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre de la ciudad." }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], City.prototype, "name", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
default: 1,
|
|
44
|
+
type: "int",
|
|
45
|
+
width: 1,
|
|
46
|
+
comment: "Estado de la ciudad, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], City.prototype, "status", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.OneToMany)(() => Master_1.Master, (master) => master.city),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], City.prototype, "masters", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.OneToMany)(() => Client_1.Client, (client) => client.city),
|
|
56
|
+
__metadata("design:type", Array)
|
|
57
|
+
], City.prototype, "clients", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.OneToMany)(() => Associate_1.Associate, (associate) => associate.city),
|
|
60
|
+
__metadata("design:type", Array)
|
|
61
|
+
], City.prototype, "associates", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.OneToMany)(() => Workshop_1.Workshop, (workshop) => workshop.city),
|
|
64
|
+
__metadata("design:type", Array)
|
|
65
|
+
], City.prototype, "workshops", void 0);
|
|
66
|
+
exports.City = City = __decorate([
|
|
67
|
+
(0, typeorm_1.Entity)({ comment: "Ciudades donde está visible la plataforma." })
|
|
68
|
+
], City);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { City } from "./City";
|
|
2
|
+
import { Company } from "./Company";
|
|
3
|
+
import { ServiceOrder } from "./ServiceOrder";
|
|
4
|
+
import { Reminder } from "./Reminder";
|
|
5
|
+
export declare class Client {
|
|
6
|
+
id: number;
|
|
7
|
+
document: string;
|
|
8
|
+
company: Company;
|
|
9
|
+
name: string;
|
|
10
|
+
surname: string;
|
|
11
|
+
email: string;
|
|
12
|
+
phone: string;
|
|
13
|
+
city: City;
|
|
14
|
+
details: any | null;
|
|
15
|
+
service_orders: ServiceOrder[];
|
|
16
|
+
reminders: Reminder[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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.Client = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const City_1 = require("./City");
|
|
15
|
+
const Company_1 = require("./Company");
|
|
16
|
+
const ServiceOrder_1 = require("./ServiceOrder");
|
|
17
|
+
const Reminder_1 = require("./Reminder");
|
|
18
|
+
let Client = class Client {
|
|
19
|
+
};
|
|
20
|
+
exports.Client = Client;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
23
|
+
type: "int",
|
|
24
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
25
|
+
}),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], Client.prototype, "id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({
|
|
30
|
+
type: "varchar",
|
|
31
|
+
length: 14,
|
|
32
|
+
comment: "Número de documento del cliente.",
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Client.prototype, "document", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, (company) => company.clients, {
|
|
38
|
+
onDelete: "CASCADE",
|
|
39
|
+
onUpdate: "NO ACTION",
|
|
40
|
+
}),
|
|
41
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
42
|
+
__metadata("design:type", Company_1.Company)
|
|
43
|
+
], Client.prototype, "company", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del cliente." }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], Client.prototype, "name", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
length: 50,
|
|
51
|
+
type: "varchar",
|
|
52
|
+
comment: "Apellidos del cliente.",
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], Client.prototype, "surname", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({
|
|
58
|
+
type: "varchar",
|
|
59
|
+
length: 100,
|
|
60
|
+
comment: "Correo electrónico del cliente.",
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], Client.prototype, "email", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({
|
|
66
|
+
type: "varchar",
|
|
67
|
+
length: 12,
|
|
68
|
+
comment: "Número de celular del cliente.",
|
|
69
|
+
}),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], Client.prototype, "phone", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.ManyToOne)(() => City_1.City, (city) => city.clients, {
|
|
74
|
+
onDelete: "RESTRICT",
|
|
75
|
+
onUpdate: "NO ACTION",
|
|
76
|
+
}),
|
|
77
|
+
(0, typeorm_1.JoinColumn)({ name: "city" }),
|
|
78
|
+
__metadata("design:type", City_1.City)
|
|
79
|
+
], Client.prototype, "city", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({
|
|
82
|
+
type: "json",
|
|
83
|
+
nullable: true,
|
|
84
|
+
default: null,
|
|
85
|
+
comment: "Campo de tipo JSON donde se guarda información necesaria para el cliente.",
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], Client.prototype, "details", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.OneToMany)(() => ServiceOrder_1.ServiceOrder, (serviceOrder) => serviceOrder.client),
|
|
91
|
+
__metadata("design:type", Array)
|
|
92
|
+
], Client.prototype, "service_orders", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.OneToMany)(() => Reminder_1.Reminder, (reminder) => reminder.client),
|
|
95
|
+
__metadata("design:type", Array)
|
|
96
|
+
], Client.prototype, "reminders", void 0);
|
|
97
|
+
exports.Client = Client = __decorate([
|
|
98
|
+
(0, typeorm_1.Entity)({
|
|
99
|
+
comment: "Clientes de los concesionarios/talleres de la plataforma.",
|
|
100
|
+
}),
|
|
101
|
+
(0, typeorm_1.Unique)("unique_document_email_phone_company", [
|
|
102
|
+
"document",
|
|
103
|
+
"email",
|
|
104
|
+
"phone",
|
|
105
|
+
"company",
|
|
106
|
+
])
|
|
107
|
+
], Client);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Vehicle } from "./Vehicle";
|
|
2
|
+
import { Client } from "./Client";
|
|
3
|
+
import { Associate } from "./Associate";
|
|
4
|
+
import { Workshop } from "./Workshop";
|
|
5
|
+
export declare class Company {
|
|
6
|
+
id: number;
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
details: any | null;
|
|
10
|
+
status: number;
|
|
11
|
+
vehicles: Vehicle[];
|
|
12
|
+
clients: Client[];
|
|
13
|
+
associates: Associate[];
|
|
14
|
+
workshops: Workshop[];
|
|
15
|
+
}
|