@asumano/worklip-typeorm-db 1.1.13 → 1.1.15
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 +2 -1
- package/dist/entities/Associate.js +4 -0
- package/dist/entities/AssociatePasswordReset.d.ts +10 -0
- package/dist/entities/AssociatePasswordReset.js +77 -0
- package/dist/entities.index.d.ts +1 -0
- package/dist/entities.index.js +3 -1
- package/dist/filters/AssociatesForTheTable.js +6 -3
- package/dist/views/Associates.d.ts +0 -2
- package/dist/views/Associates.js +0 -8
- package/package.json +1 -1
|
@@ -4,7 +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 } from "../entities.views.routes";
|
|
7
|
+
import { AssociatePasswordReset, AssociatePermission } from "../entities.views.routes";
|
|
8
8
|
export declare class Associate {
|
|
9
9
|
id: number;
|
|
10
10
|
code: string;
|
|
@@ -28,4 +28,5 @@ export declare class Associate {
|
|
|
28
28
|
service_order_history: ServiceOrderHistory[];
|
|
29
29
|
reminders: Reminder[];
|
|
30
30
|
permissions: AssociatePermission[];
|
|
31
|
+
passwordResets: AssociatePasswordReset[];
|
|
31
32
|
}
|
|
@@ -207,6 +207,10 @@ __decorate([
|
|
|
207
207
|
}),
|
|
208
208
|
__metadata("design:type", Array)
|
|
209
209
|
], Associate.prototype, "permissions", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
(0, typeorm_1.OneToMany)(() => entities_views_routes_1.AssociatePasswordReset, (passwordReset) => passwordReset.associate),
|
|
212
|
+
__metadata("design:type", Array)
|
|
213
|
+
], Associate.prototype, "passwordResets", void 0);
|
|
210
214
|
exports.Associate = Associate = __decorate([
|
|
211
215
|
(0, typeorm_1.Entity)({
|
|
212
216
|
comment: "Usuarios de los concesionarios/talleres de la plataforma.",
|
|
@@ -0,0 +1,77 @@
|
|
|
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.AssociatePasswordReset = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const __1 = require("..");
|
|
15
|
+
let AssociatePasswordReset = class AssociatePasswordReset {
|
|
16
|
+
};
|
|
17
|
+
exports.AssociatePasswordReset = AssociatePasswordReset;
|
|
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
|
+
], AssociatePasswordReset.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => __1.Associate, (associate) => associate.passwordResets, {
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
onUpdate: "NO ACTION",
|
|
29
|
+
}),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "associate" }),
|
|
31
|
+
__metadata("design:type", __1.Associate)
|
|
32
|
+
], AssociatePasswordReset.prototype, "associate", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({
|
|
35
|
+
length: 255,
|
|
36
|
+
type: "varchar",
|
|
37
|
+
comment: "Token generado para cambiar la contraseña.",
|
|
38
|
+
}),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AssociatePasswordReset.prototype, "token", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
type: "datetime",
|
|
44
|
+
comment: "Cuando expira el token.",
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], AssociatePasswordReset.prototype, "expires_at", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
default: 0,
|
|
51
|
+
type: "int",
|
|
52
|
+
width: 1,
|
|
53
|
+
comment: "Si ya se usó el token de cambio de contraseña.\n1: Ya se usó.\n0: No se ha usado.",
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", Number)
|
|
56
|
+
], AssociatePasswordReset.prototype, "used", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({
|
|
59
|
+
type: "datetime",
|
|
60
|
+
comment: "Fecha de creación del registro.",
|
|
61
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", Date)
|
|
64
|
+
], AssociatePasswordReset.prototype, "created", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({
|
|
67
|
+
type: "datetime",
|
|
68
|
+
nullable: true,
|
|
69
|
+
default: null,
|
|
70
|
+
comment: "Fecha de actualización del registro.",
|
|
71
|
+
onUpdate: "CURRENT_TIMESTAMP",
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], AssociatePasswordReset.prototype, "updated", void 0);
|
|
75
|
+
exports.AssociatePasswordReset = AssociatePasswordReset = __decorate([
|
|
76
|
+
(0, typeorm_1.Entity)("associate_password_reset")
|
|
77
|
+
], AssociatePasswordReset);
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -23,4 +23,5 @@ export { AssociatePlatform } from "./entities/AssociatePlatform";
|
|
|
23
23
|
export { AssociateRole } from "./entities/AssociateRole";
|
|
24
24
|
export { AssociatePermission } from "./entities/AssociatePermission";
|
|
25
25
|
export { AssociateSection } from "./entities/AssociateSection";
|
|
26
|
+
export { AssociatePasswordReset } from "./entities/AssociatePasswordReset";
|
|
26
27
|
export { Associates } from "./views/Associates";
|
package/dist/entities.index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Associates = 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;
|
|
3
|
+
exports.Associates = 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
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");
|
|
@@ -51,5 +51,7 @@ var AssociatePermission_1 = require("./entities/AssociatePermission");
|
|
|
51
51
|
Object.defineProperty(exports, "AssociatePermission", { enumerable: true, get: function () { return AssociatePermission_1.AssociatePermission; } });
|
|
52
52
|
var AssociateSection_1 = require("./entities/AssociateSection");
|
|
53
53
|
Object.defineProperty(exports, "AssociateSection", { enumerable: true, get: function () { return AssociateSection_1.AssociateSection; } });
|
|
54
|
+
var AssociatePasswordReset_1 = require("./entities/AssociatePasswordReset");
|
|
55
|
+
Object.defineProperty(exports, "AssociatePasswordReset", { enumerable: true, get: function () { return AssociatePasswordReset_1.AssociatePasswordReset; } });
|
|
54
56
|
var Associates_1 = require("./views/Associates");
|
|
55
57
|
Object.defineProperty(exports, "Associates", { enumerable: true, get: function () { return Associates_1.Associates; } });
|
|
@@ -26,9 +26,12 @@ async function getAssociatesForTheTable(repository, { company, workshop, status,
|
|
|
26
26
|
}
|
|
27
27
|
// DOC: Filtro por workshop FILTRO POR DEFECTO.
|
|
28
28
|
if (workshop !== null && workshop >= 0) {
|
|
29
|
-
queryBuilder.andWhere(
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
queryBuilder.andWhere(`EXISTS (
|
|
30
|
+
SELECT 1
|
|
31
|
+
FROM workshop_associate wa
|
|
32
|
+
WHERE wa.associate = associates.id
|
|
33
|
+
AND wa.workshop = :workshop
|
|
34
|
+
)`, { workshop });
|
|
32
35
|
}
|
|
33
36
|
// DOC: Filtro por visible FILTRO POR DEFECTO.
|
|
34
37
|
if (visible !== null) {
|
package/dist/views/Associates.js
CHANGED
|
@@ -94,14 +94,6 @@ __decorate([
|
|
|
94
94
|
(0, typeorm_1.ViewColumn)(),
|
|
95
95
|
__metadata("design:type", Number)
|
|
96
96
|
], Associates.prototype, "city_status", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
(0, typeorm_1.ViewColumn)(),
|
|
99
|
-
__metadata("design:type", Number)
|
|
100
|
-
], Associates.prototype, "workshop_id", void 0);
|
|
101
|
-
__decorate([
|
|
102
|
-
(0, typeorm_1.ViewColumn)(),
|
|
103
|
-
__metadata("design:type", String)
|
|
104
|
-
], Associates.prototype, "workshop_name", void 0);
|
|
105
97
|
exports.Associates = Associates = __decorate([
|
|
106
98
|
(0, typeorm_1.ViewEntity)()
|
|
107
99
|
], Associates);
|