@asumano/worklip-typeorm-db 1.1.101 → 1.1.103
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/AssociateNotification.d.ts +14 -0
- package/dist/entities/AssociateNotification.js +74 -0
- package/dist/entities/AssociateSectionFeature.d.ts +7 -0
- package/dist/entities/AssociateSectionFeature.js +42 -0
- package/dist/entities/AttendanceMark.d.ts +26 -0
- package/dist/entities/AttendanceMark.js +155 -0
- package/dist/entities/Client.d.ts +1 -1
- package/dist/entities/Client.js +4 -2
- package/dist/entities/ClientDocumentDispute.d.ts +21 -0
- package/dist/entities/ClientDocumentDispute.js +103 -0
- package/dist/entities/ClientNotification.d.ts +13 -0
- package/dist/entities/ClientNotification.js +73 -0
- package/dist/entities/ClientSession.d.ts +3 -0
- package/dist/entities/ClientSession.js +34 -0
- package/dist/entities/ClientVehicle.d.ts +5 -0
- package/dist/entities/ClientVehicle.js +47 -2
- package/dist/entities/ClientVehicleInvite.d.ts +17 -0
- package/dist/entities/ClientVehicleInvite.js +113 -0
- package/dist/entities/CompanyQuotaAdjustment.d.ts +13 -0
- package/dist/entities/CompanyQuotaAdjustment.js +74 -0
- package/dist/entities/MasterNotification.d.ts +10 -0
- package/dist/entities/MasterNotification.js +61 -0
- package/dist/entities/PypRule.d.ts +19 -0
- package/dist/entities/PypRule.js +105 -0
- package/dist/entities/PypRuleVote.d.ts +10 -0
- package/dist/entities/PypRuleVote.js +60 -0
- package/dist/entities/ReviewTask.d.ts +17 -0
- package/dist/entities/ReviewTask.js +114 -0
- package/dist/entities/ReviewTaskEvent.d.ts +12 -0
- package/dist/entities/ReviewTaskEvent.js +66 -0
- package/dist/entities/ServiceOrder.d.ts +3 -0
- package/dist/entities/ServiceOrder.js +29 -0
- package/dist/entities/ServiceOrderApproval.d.ts +3 -0
- package/dist/entities/ServiceOrderApproval.js +29 -0
- package/dist/entities/SubscriptionAddon.js +1 -1
- package/dist/entities/SubscriptionAddonTemplate.js +1 -1
- package/dist/entities/Template.d.ts +1 -1
- package/dist/entities/UsageAlert.js +1 -1
- package/dist/entities/VehicleReport.d.ts +16 -0
- package/dist/entities/VehicleReport.js +83 -0
- package/dist/entities/VehicleVerification.d.ts +20 -0
- package/dist/entities/VehicleVerification.js +102 -0
- package/dist/entities/VisitAiAnalysis.d.ts +18 -0
- package/dist/entities/VisitAiAnalysis.js +93 -0
- package/dist/entities/VisitItemSearch.d.ts +28 -0
- package/dist/entities/VisitItemSearch.js +161 -0
- package/dist/entities/VisitSearchHistory.d.ts +14 -0
- package/dist/entities/VisitSearchHistory.js +80 -0
- package/dist/entities/VisitSearchPerson.d.ts +8 -0
- package/dist/entities/VisitSearchPerson.js +49 -0
- package/dist/entities/WorkshopReader.d.ts +2 -1
- package/dist/entities/WorkshopReader.js +10 -1
- package/dist/entities.index.d.ts +19 -0
- package/dist/entities.index.js +47 -3
- package/dist/entities.views.routes.d.ts +0 -5
- package/dist/entities.views.routes.js +0 -11
- package/dist/index.d.ts +23 -28
- package/dist/index.js +39 -33
- package/dist/rules/attendance.rules.d.ts +162 -0
- package/dist/rules/attendance.rules.js +249 -0
- package/dist/{booking.rules.d.ts → rules/booking.rules.d.ts} +1 -1
- package/dist/{booking.rules.js → rules/booking.rules.js} +1 -1
- package/dist/{chatbot.rules.d.ts → rules/chatbot.rules.d.ts} +1 -1
- package/dist/{chatbot.rules.js → rules/chatbot.rules.js} +1 -1
- package/dist/{client.link.rules.d.ts → rules/client.link.rules.d.ts} +5 -0
- package/dist/{client.link.rules.js → rules/client.link.rules.js} +3 -1
- package/dist/{dashboard.rules.d.ts → rules/dashboard.rules.d.ts} +1 -1
- package/dist/{dashboard.rules.js → rules/dashboard.rules.js} +1 -1
- package/dist/{feature.codes.d.ts → rules/feature.codes.d.ts} +2 -0
- package/dist/{feature.codes.js → rules/feature.codes.js} +5 -0
- package/dist/rules/vehicle.type.rules.d.ts +40 -0
- package/dist/rules/vehicle.type.rules.js +72 -0
- package/dist/rules/visit.history.rules.d.ts +154 -0
- package/dist/rules/visit.history.rules.js +282 -0
- package/dist/{visit.summary.d.ts → rules/visit.summary.d.ts} +13 -0
- package/dist/{visit.summary.js → rules/visit.summary.js} +11 -3
- package/dist/{workboard.rules.js → rules/workboard.rules.js} +1 -1
- package/dist/slow.query.logger.d.ts +16 -0
- package/dist/slow.query.logger.js +24 -0
- package/dist/views/ServicesOrderLite.d.ts +70 -0
- package/dist/views/ServicesOrderLite.js +299 -0
- package/dist/views/Templates.d.ts +1 -1
- package/package.json +3 -5
- package/dist/CustomRepository.d.ts +0 -21
- package/dist/CustomRepository.js +0 -23
- package/dist/filters/AssociatesForTheTable.d.ts +0 -6
- package/dist/filters/AssociatesForTheTable.js +0 -63
- package/dist/filters/ClientsForTheTable.d.ts +0 -6
- package/dist/filters/ClientsForTheTable.js +0 -48
- package/dist/filters/ServicesOrderForTheTable.d.ts +0 -6
- package/dist/filters/ServicesOrderForTheTable.js +0 -205
- package/dist/filters/VehiclesForTheTable.d.ts +0 -6
- package/dist/filters/VehiclesForTheTable.js +0 -48
- package/dist/vehicle.type.rules.d.ts +0 -16
- package/dist/vehicle.type.rules.js +0 -35
- /package/dist/{client.plan.rules.d.ts → rules/client.plan.rules.d.ts} +0 -0
- /package/dist/{client.plan.rules.js → rules/client.plan.rules.js} +0 -0
- /package/dist/{company.legal.d.ts → rules/company.legal.d.ts} +0 -0
- /package/dist/{company.legal.js → rules/company.legal.js} +0 -0
- /package/dist/{company.type.rules.d.ts → rules/company.type.rules.d.ts} +0 -0
- /package/dist/{company.type.rules.js → rules/company.type.rules.js} +0 -0
- /package/dist/{discount.rules.d.ts → rules/discount.rules.d.ts} +0 -0
- /package/dist/{discount.rules.js → rules/discount.rules.js} +0 -0
- /package/dist/{feature.scope.d.ts → rules/feature.scope.d.ts} +0 -0
- /package/dist/{feature.scope.js → rules/feature.scope.js} +0 -0
- /package/dist/{inspection.rules.d.ts → rules/inspection.rules.d.ts} +0 -0
- /package/dist/{inspection.rules.js → rules/inspection.rules.js} +0 -0
- /package/dist/{offered.service.rules.d.ts → rules/offered.service.rules.d.ts} +0 -0
- /package/dist/{offered.service.rules.js → rules/offered.service.rules.js} +0 -0
- /package/dist/{parts.rules.d.ts → rules/parts.rules.d.ts} +0 -0
- /package/dist/{parts.rules.js → rules/parts.rules.js} +0 -0
- /package/dist/{reminder.rules.d.ts → rules/reminder.rules.d.ts} +0 -0
- /package/dist/{reminder.rules.js → rules/reminder.rules.js} +0 -0
- /package/dist/{template.settings.d.ts → rules/template.settings.d.ts} +0 -0
- /package/dist/{template.settings.js → rules/template.settings.js} +0 -0
- /package/dist/{timezone.d.ts → rules/timezone.d.ts} +0 -0
- /package/dist/{timezone.js → rules/timezone.js} +0 -0
- /package/dist/{vehicle.type.icons.d.ts → rules/vehicle.type.icons.d.ts} +0 -0
- /package/dist/{vehicle.type.icons.js → rules/vehicle.type.icons.js} +0 -0
- /package/dist/{workboard.rules.d.ts → rules/workboard.rules.d.ts} +0 -0
- /package/dist/{workshop.schedule.d.ts → rules/workshop.schedule.d.ts} +0 -0
- /package/dist/{workshop.schedule.js → rules/workshop.schedule.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Associate } from "./Associate";
|
|
2
|
+
import { Company } from "./Company";
|
|
3
|
+
import { Workshop } from "./Workshop";
|
|
4
|
+
export declare class AssociateNotification {
|
|
5
|
+
id: number;
|
|
6
|
+
associate: Associate;
|
|
7
|
+
company: Company;
|
|
8
|
+
workshop: Workshop | null;
|
|
9
|
+
kind: string;
|
|
10
|
+
params: Record<string, unknown> | null;
|
|
11
|
+
url: string | null;
|
|
12
|
+
read_at: Date | null;
|
|
13
|
+
created: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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.AssociateNotification = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Associate_1 = require("./Associate");
|
|
15
|
+
const Company_1 = require("./Company");
|
|
16
|
+
const Workshop_1 = require("./Workshop");
|
|
17
|
+
// DOC: La campana de asociados-web. Una fila por persona: el «leído» es de cada uno. El texto
|
|
18
|
+
// no se guarda; va el tipo y sus datos, y el front lo traduce.
|
|
19
|
+
let AssociateNotification = class AssociateNotification {
|
|
20
|
+
};
|
|
21
|
+
exports.AssociateNotification = AssociateNotification;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], AssociateNotification.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: "associate" }),
|
|
29
|
+
__metadata("design:type", Associate_1.Associate)
|
|
30
|
+
], AssociateNotification.prototype, "associate", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
33
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
34
|
+
__metadata("design:type", Company_1.Company)
|
|
35
|
+
], AssociateNotification.prototype, "company", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, { nullable: true, onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
38
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], AssociateNotification.prototype, "workshop", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 50, comment: "Tipo de aviso (STAFF_NOTIFICATION_KIND). El front lo traduce." }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AssociateNotification.prototype, "kind", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: "json", nullable: true, default: null, comment: "Datos del texto: placa, cliente, fecha..." }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], AssociateNotification.prototype, "params", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({
|
|
51
|
+
type: "varchar",
|
|
52
|
+
length: 255,
|
|
53
|
+
nullable: true,
|
|
54
|
+
default: null,
|
|
55
|
+
comment: "Pantalla a la que lleva (ruta del front, sin /app).",
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], AssociateNotification.prototype, "url", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ type: "datetime", nullable: true, default: null, comment: "Cuándo lo leyó. NULL = sin leer." }),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], AssociateNotification.prototype, "read_at", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro.", default: () => "CURRENT_TIMESTAMP" }),
|
|
65
|
+
__metadata("design:type", Date)
|
|
66
|
+
], AssociateNotification.prototype, "created", void 0);
|
|
67
|
+
exports.AssociateNotification = AssociateNotification = __decorate([
|
|
68
|
+
(0, typeorm_1.Entity)({
|
|
69
|
+
comment: "Campana de asociados-web: un aviso por persona.",
|
|
70
|
+
name: "associate_notification",
|
|
71
|
+
}),
|
|
72
|
+
(0, typeorm_1.Index)("IDX_associate_notification_inbox", ["associate", "read_at", "id"]),
|
|
73
|
+
(0, typeorm_1.Index)("IDX_associate_notification_created", ["created"])
|
|
74
|
+
], AssociateNotification);
|
|
@@ -0,0 +1,42 @@
|
|
|
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.AssociateSectionFeature = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const AssociateSection_1 = require("./AssociateSection");
|
|
15
|
+
const Feature_1 = require("./Feature");
|
|
16
|
+
// DOC: Una sección de permisos que sale con CUALQUIERA de varias funcionalidades (sql/68). El carné y
|
|
17
|
+
// los lectores sirven con las etiquetas NFC o con la asistencia; `associate_section.feature` es
|
|
18
|
+
// una sola, así que esa sección va NULL allá y lista sus funcionalidades acá.
|
|
19
|
+
let AssociateSectionFeature = class AssociateSectionFeature {
|
|
20
|
+
};
|
|
21
|
+
exports.AssociateSectionFeature = AssociateSectionFeature;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], AssociateSectionFeature.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => AssociateSection_1.AssociateSection, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: "section" }),
|
|
29
|
+
__metadata("design:type", AssociateSection_1.AssociateSection)
|
|
30
|
+
], AssociateSectionFeature.prototype, "section", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.ManyToOne)(() => Feature_1.Feature, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
33
|
+
(0, typeorm_1.JoinColumn)({ name: "feature" }),
|
|
34
|
+
__metadata("design:type", Feature_1.Feature)
|
|
35
|
+
], AssociateSectionFeature.prototype, "feature", void 0);
|
|
36
|
+
exports.AssociateSectionFeature = AssociateSectionFeature = __decorate([
|
|
37
|
+
(0, typeorm_1.Entity)({
|
|
38
|
+
comment: "Secciones de permisos que salen con cualquiera de varias funcionalidades.",
|
|
39
|
+
name: "associate_section_feature",
|
|
40
|
+
}),
|
|
41
|
+
(0, typeorm_1.Unique)("UQ_associate_section_feature", ["section", "feature"])
|
|
42
|
+
], AssociateSectionFeature);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Company } from "./Company";
|
|
2
|
+
import { Workshop } from "./Workshop";
|
|
3
|
+
import { Associate } from "./Associate";
|
|
4
|
+
import { WorkshopReader } from "./WorkshopReader";
|
|
5
|
+
export declare class AttendanceMark {
|
|
6
|
+
id: number;
|
|
7
|
+
company: Company;
|
|
8
|
+
workshop: Workshop;
|
|
9
|
+
associate: Associate | null;
|
|
10
|
+
reader: WorkshopReader | null;
|
|
11
|
+
type: number;
|
|
12
|
+
method: number;
|
|
13
|
+
status: number;
|
|
14
|
+
marked_at: Date;
|
|
15
|
+
received_at: Date;
|
|
16
|
+
offline: number;
|
|
17
|
+
device_ref: string | null;
|
|
18
|
+
unresolved_value: string | null;
|
|
19
|
+
replaces: AttendanceMark | null;
|
|
20
|
+
note: string | null;
|
|
21
|
+
created_by: Associate | null;
|
|
22
|
+
voided_by: Associate | null;
|
|
23
|
+
voided_at: Date | null;
|
|
24
|
+
void_reason: string | null;
|
|
25
|
+
created: Date;
|
|
26
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
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.AttendanceMark = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Company_1 = require("./Company");
|
|
15
|
+
const Workshop_1 = require("./Workshop");
|
|
16
|
+
const Associate_1 = require("./Associate");
|
|
17
|
+
const WorkshopReader_1 = require("./WorkshopReader");
|
|
18
|
+
// DOC: CONTROL DE ASISTENCIA (sql/68): cada entrada o salida que marca un empleado en el lector de la
|
|
19
|
+
// PUERTA (con el carné o la cédula) o que registra a mano alguien con permiso. No se editan:
|
|
20
|
+
// corregir es anularla (status 2, con motivo) y crear otra con `replaces`. Los números de
|
|
21
|
+
// `type`, `method` y `status` viven en attendance.rules.ts.
|
|
22
|
+
let AttendanceMark = class AttendanceMark {
|
|
23
|
+
};
|
|
24
|
+
exports.AttendanceMark = AttendanceMark;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], AttendanceMark.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
32
|
+
__metadata("design:type", Company_1.Company)
|
|
33
|
+
], AttendanceMark.prototype, "company", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
36
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
37
|
+
__metadata("design:type", Workshop_1.Workshop)
|
|
38
|
+
], AttendanceMark.prototype, "workshop", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
|
|
41
|
+
(0, typeorm_1.JoinColumn)({ name: "associate" }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], AttendanceMark.prototype, "associate", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.ManyToOne)(() => WorkshopReader_1.WorkshopReader, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
|
|
46
|
+
(0, typeorm_1.JoinColumn)({ name: "reader" }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], AttendanceMark.prototype, "reader", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: "int", comment: "Qué marca:\r\n1: Entrada.\r\n2: Salida." }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], AttendanceMark.prototype, "type", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
type: "int",
|
|
56
|
+
comment: "Cómo se marcó:\r\n1: Con el carné.\r\n2: Con la cédula (olvidó el carné).\r\n3: A mano, por una persona con permiso.",
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], AttendanceMark.prototype, "method", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({
|
|
62
|
+
type: "int",
|
|
63
|
+
default: 1,
|
|
64
|
+
comment: "Estado:\r\n1: Válida.\r\n2: Anulada (corregida o borrada, con motivo).\r\n3: Sin reconocer (cédula o carné que no es de nadie).",
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], AttendanceMark.prototype, "status", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: "datetime", comment: "El momento real de la marcación, en UTC." }),
|
|
70
|
+
__metadata("design:type", Date)
|
|
71
|
+
], AttendanceMark.prototype, "marked_at", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({
|
|
74
|
+
type: "datetime",
|
|
75
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
76
|
+
comment: "Cuándo llegó al servidor (difiere de marked_at si se subió sin conexión).",
|
|
77
|
+
}),
|
|
78
|
+
__metadata("design:type", Date)
|
|
79
|
+
], AttendanceMark.prototype, "received_at", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({
|
|
82
|
+
type: "tinyint",
|
|
83
|
+
width: 1,
|
|
84
|
+
default: 0,
|
|
85
|
+
comment: "¿Se guardó en el aparato sin internet y se subió después?\r\n0: No.\r\n1: Sí.",
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Number)
|
|
88
|
+
], AttendanceMark.prototype, "offline", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.Column)({
|
|
91
|
+
type: "varchar",
|
|
92
|
+
length: 40,
|
|
93
|
+
nullable: true,
|
|
94
|
+
default: null,
|
|
95
|
+
comment: "Identificador que le puso el aparato a la marcación guardada sin conexión.",
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Object)
|
|
98
|
+
], AttendanceMark.prototype, "device_ref", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({
|
|
101
|
+
type: "varchar",
|
|
102
|
+
length: 20,
|
|
103
|
+
nullable: true,
|
|
104
|
+
default: null,
|
|
105
|
+
comment: "La cédula o el carné sin reconocer, para revisarlo. Se borra al resolverla o a los 30 días.",
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Object)
|
|
108
|
+
], AttendanceMark.prototype, "unresolved_value", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.ManyToOne)(() => AttendanceMark, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
|
|
111
|
+
(0, typeorm_1.JoinColumn)({ name: "replaces" }),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], AttendanceMark.prototype, "replaces", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({
|
|
116
|
+
type: "varchar",
|
|
117
|
+
length: 255,
|
|
118
|
+
nullable: true,
|
|
119
|
+
default: null,
|
|
120
|
+
comment: "Motivo de la marcación a mano o de la corrección.",
|
|
121
|
+
}),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], AttendanceMark.prototype, "note", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
|
|
126
|
+
(0, typeorm_1.JoinColumn)({ name: "created_by" }),
|
|
127
|
+
__metadata("design:type", Object)
|
|
128
|
+
], AttendanceMark.prototype, "created_by", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
|
|
131
|
+
(0, typeorm_1.JoinColumn)({ name: "voided_by" }),
|
|
132
|
+
__metadata("design:type", Object)
|
|
133
|
+
], AttendanceMark.prototype, "voided_by", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, typeorm_1.Column)({ type: "datetime", nullable: true, default: null, comment: "Cuándo se anuló." }),
|
|
136
|
+
__metadata("design:type", Object)
|
|
137
|
+
], AttendanceMark.prototype, "voided_at", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true, default: null, comment: "Por qué se anuló." }),
|
|
140
|
+
__metadata("design:type", Object)
|
|
141
|
+
], AttendanceMark.prototype, "void_reason", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro.", default: () => "CURRENT_TIMESTAMP" }),
|
|
144
|
+
__metadata("design:type", Date)
|
|
145
|
+
], AttendanceMark.prototype, "created", void 0);
|
|
146
|
+
exports.AttendanceMark = AttendanceMark = __decorate([
|
|
147
|
+
(0, typeorm_1.Entity)({
|
|
148
|
+
comment: "Marcaciones de entrada y salida de los empleados (control de asistencia).",
|
|
149
|
+
name: "attendance_mark",
|
|
150
|
+
}),
|
|
151
|
+
(0, typeorm_1.Unique)("UQ_attendance_mark_device", ["reader", "device_ref"]),
|
|
152
|
+
(0, typeorm_1.Index)("IDX_attendance_mark_associate", ["associate", "marked_at"]),
|
|
153
|
+
(0, typeorm_1.Index)("IDX_attendance_mark_workshop", ["workshop", "marked_at"]),
|
|
154
|
+
(0, typeorm_1.Index)("IDX_attendance_mark_company", ["company", "status", "marked_at"])
|
|
155
|
+
], AttendanceMark);
|
|
@@ -10,7 +10,7 @@ import { ClientSession } from "./ClientSession";
|
|
|
10
10
|
import { ClientSubscription } from "./ClientSubscription";
|
|
11
11
|
export declare class Client {
|
|
12
12
|
id: number;
|
|
13
|
-
document: string;
|
|
13
|
+
document: string | null;
|
|
14
14
|
document_type: string;
|
|
15
15
|
company: Company | null;
|
|
16
16
|
created_by: Associate | null;
|
package/dist/entities/Client.js
CHANGED
|
@@ -37,9 +37,11 @@ __decorate([
|
|
|
37
37
|
(0, typeorm_1.Column)({
|
|
38
38
|
type: "varchar",
|
|
39
39
|
length: 14,
|
|
40
|
-
|
|
40
|
+
nullable: true,
|
|
41
|
+
default: null,
|
|
42
|
+
comment: "Número de documento del cliente. Obligatorio al crear (app o taller); NULL solo si la cuenta de la app lo perdió en una disputa y debe escribirlo de nuevo.",
|
|
41
43
|
}),
|
|
42
|
-
__metadata("design:type",
|
|
44
|
+
__metadata("design:type", Object)
|
|
43
45
|
], Client.prototype, "document", void 0);
|
|
44
46
|
__decorate([
|
|
45
47
|
(0, typeorm_1.Column)({
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Associate } from "./Associate";
|
|
2
|
+
import { Client } from "./Client";
|
|
3
|
+
import { Company } from "./Company";
|
|
4
|
+
import { Master } from "./Master";
|
|
5
|
+
import { Workshop } from "./Workshop";
|
|
6
|
+
export declare class ClientDocumentDispute {
|
|
7
|
+
id: number;
|
|
8
|
+
document_type: string;
|
|
9
|
+
document: string;
|
|
10
|
+
app_client: Client | null;
|
|
11
|
+
workshop_client: Client | null;
|
|
12
|
+
company: Company | null;
|
|
13
|
+
workshop: Workshop | null;
|
|
14
|
+
associate: Associate | null;
|
|
15
|
+
details: any | null;
|
|
16
|
+
status: number;
|
|
17
|
+
resolution_note: string | null;
|
|
18
|
+
resolved_by: Master | null;
|
|
19
|
+
resolved: Date | null;
|
|
20
|
+
created: Date;
|
|
21
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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.ClientDocumentDispute = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Associate_1 = require("./Associate");
|
|
15
|
+
const Client_1 = require("./Client");
|
|
16
|
+
const Company_1 = require("./Company");
|
|
17
|
+
const Master_1 = require("./Master");
|
|
18
|
+
const Workshop_1 = require("./Workshop");
|
|
19
|
+
// DOC: DOCUMENTO EN DISPUTA (sql/66): una cédula registrada solo desde la app que un asesor verificó en
|
|
20
|
+
// persona para otra persona (el contacto no coincidía). La cuenta de la app queda sin documento y la
|
|
21
|
+
// persona del taller recibe su ficha; el panel revisa el caso en Validaciones. Estados en
|
|
22
|
+
// CLIENT_DOCUMENT_DISPUTE_STATUS (client.link.rules).
|
|
23
|
+
let ClientDocumentDispute = class ClientDocumentDispute {
|
|
24
|
+
};
|
|
25
|
+
exports.ClientDocumentDispute = ClientDocumentDispute;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], ClientDocumentDispute.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 10, comment: "Tipo del documento en disputa." }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ClientDocumentDispute.prototype, "document_type", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 14, comment: "Número del documento en disputa." }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ClientDocumentDispute.prototype, "document", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToOne)(() => Client_1.Client, { onDelete: "SET NULL", nullable: true }),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: "app_client" }),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], ClientDocumentDispute.prototype, "app_client", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.ManyToOne)(() => Client_1.Client, { onDelete: "SET NULL", nullable: true }),
|
|
45
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop_client" }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], ClientDocumentDispute.prototype, "workshop_client", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, { onDelete: "SET NULL", nullable: true }),
|
|
50
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], ClientDocumentDispute.prototype, "company", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, { onDelete: "SET NULL", nullable: true }),
|
|
55
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], ClientDocumentDispute.prototype, "workshop", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "SET NULL", nullable: true }),
|
|
60
|
+
(0, typeorm_1.JoinColumn)({ name: "associate" }),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], ClientDocumentDispute.prototype, "associate", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({
|
|
65
|
+
type: "json",
|
|
66
|
+
nullable: true,
|
|
67
|
+
comment: "Copia para el panel: contacto de la cuenta de la app y el que dio la persona en el taller.",
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], ClientDocumentDispute.prototype, "details", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({
|
|
73
|
+
type: "int",
|
|
74
|
+
default: 1,
|
|
75
|
+
comment: "Estado:\r\n1: Pendiente.\r\n2: Confirmada (el del taller es el dueño).\r\n3: Cerrada sin cambios (se corrigió con soporte).",
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", Number)
|
|
78
|
+
], ClientDocumentDispute.prototype, "status", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true, default: null, comment: "Nota de quien resolvió." }),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], ClientDocumentDispute.prototype, "resolution_note", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.ManyToOne)(() => Master_1.Master, { onDelete: "SET NULL", nullable: true }),
|
|
85
|
+
(0, typeorm_1.JoinColumn)({ name: "resolved_by" }),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], ClientDocumentDispute.prototype, "resolved_by", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({ type: "datetime", nullable: true, default: null, comment: "Cuándo se resolvió." }),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], ClientDocumentDispute.prototype, "resolved", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro.", default: () => "CURRENT_TIMESTAMP" }),
|
|
94
|
+
__metadata("design:type", Date)
|
|
95
|
+
], ClientDocumentDispute.prototype, "created", void 0);
|
|
96
|
+
exports.ClientDocumentDispute = ClientDocumentDispute = __decorate([
|
|
97
|
+
(0, typeorm_1.Entity)({
|
|
98
|
+
comment: "Documentos en disputa: una cédula registrada en la app que un taller verificó en persona para otra persona.",
|
|
99
|
+
name: "client_document_dispute",
|
|
100
|
+
}),
|
|
101
|
+
(0, typeorm_1.Index)("IDX_client_document_dispute_status", ["status", "created"]),
|
|
102
|
+
(0, typeorm_1.Index)("IDX_client_document_dispute_app_client", ["app_client"])
|
|
103
|
+
], ClientDocumentDispute);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Client } from "./Client";
|
|
2
|
+
import { Vehicle } from "./Vehicle";
|
|
3
|
+
export declare class ClientNotification {
|
|
4
|
+
id: number;
|
|
5
|
+
client: Client;
|
|
6
|
+
vehicle: Vehicle | null;
|
|
7
|
+
kind: string;
|
|
8
|
+
params: Record<string, unknown> | null;
|
|
9
|
+
url: string | null;
|
|
10
|
+
read_at: Date | null;
|
|
11
|
+
deleted_at: Date | null;
|
|
12
|
+
created: Date;
|
|
13
|
+
}
|
|
@@ -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.ClientNotification = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Client_1 = require("./Client");
|
|
15
|
+
const Vehicle_1 = require("./Vehicle");
|
|
16
|
+
// DOC: La pestaña «Avisos» de la app del cliente: cada push que se le manda (o que se le habría
|
|
17
|
+
// mandado sin celular registrado). El texto NO se guarda: va la plantilla y sus datos, y el
|
|
18
|
+
// API lo arma en el idioma de la app al listarlo.
|
|
19
|
+
let ClientNotification = class ClientNotification {
|
|
20
|
+
};
|
|
21
|
+
exports.ClientNotification = ClientNotification;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], ClientNotification.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => Client_1.Client, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: "client" }),
|
|
29
|
+
__metadata("design:type", Client_1.Client)
|
|
30
|
+
], ClientNotification.prototype, "client", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.ManyToOne)(() => Vehicle_1.Vehicle, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
|
|
33
|
+
(0, typeorm_1.JoinColumn)({ name: "vehicle" }),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], ClientNotification.prototype, "vehicle", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 50, comment: "Plantilla del aviso (PUSH_MESSAGES del API)." }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ClientNotification.prototype, "kind", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: "json", nullable: true, default: null, comment: "Datos del texto: placa, taller, fecha..." }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], ClientNotification.prototype, "params", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({
|
|
46
|
+
type: "varchar",
|
|
47
|
+
length: 255,
|
|
48
|
+
nullable: true,
|
|
49
|
+
default: null,
|
|
50
|
+
comment: "Pantalla de la app a la que lleva (ruta de Expo Router).",
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], ClientNotification.prototype, "url", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: "datetime", nullable: true, default: null, comment: "Cuándo lo leyó. NULL = sin leer." }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], ClientNotification.prototype, "read_at", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: "datetime", nullable: true, default: null, comment: "Cuándo lo eliminó el cliente. NULL = visible." }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], ClientNotification.prototype, "deleted_at", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro.", default: () => "CURRENT_TIMESTAMP" }),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], ClientNotification.prototype, "created", void 0);
|
|
66
|
+
exports.ClientNotification = ClientNotification = __decorate([
|
|
67
|
+
(0, typeorm_1.Entity)({
|
|
68
|
+
comment: "Avisos de la app del cliente (historial de los push).",
|
|
69
|
+
name: "client_notification",
|
|
70
|
+
}),
|
|
71
|
+
(0, typeorm_1.Index)("IDX_client_notification_inbox", ["client", "read_at", "id"]),
|
|
72
|
+
(0, typeorm_1.Index)("IDX_client_notification_created", ["created"])
|
|
73
|
+
], ClientNotification);
|
|
@@ -3,9 +3,12 @@ export declare class ClientSession {
|
|
|
3
3
|
id: number;
|
|
4
4
|
client: Client;
|
|
5
5
|
token_hash: string;
|
|
6
|
+
prev_token_hash: string | null;
|
|
7
|
+
rotated: Date | null;
|
|
6
8
|
platform: number;
|
|
7
9
|
device: string | null;
|
|
8
10
|
push_token: string | null;
|
|
11
|
+
push_language: string | null;
|
|
9
12
|
ip_address: string | null;
|
|
10
13
|
expires: Date;
|
|
11
14
|
revoked: Date | null;
|
|
@@ -40,6 +40,25 @@ __decorate([
|
|
|
40
40
|
}),
|
|
41
41
|
__metadata("design:type", String)
|
|
42
42
|
], ClientSession.prototype, "token_hash", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({
|
|
45
|
+
type: "char",
|
|
46
|
+
length: 64,
|
|
47
|
+
nullable: true,
|
|
48
|
+
default: null,
|
|
49
|
+
comment: "SHA-256 del token de refresco anterior, para detectar si alguien lo reusa.",
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], ClientSession.prototype, "prev_token_hash", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
type: "datetime",
|
|
56
|
+
nullable: true,
|
|
57
|
+
default: null,
|
|
58
|
+
comment: "Cuándo se rotó el token por última vez (la gracia para el anterior cuenta desde acá).",
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], ClientSession.prototype, "rotated", void 0);
|
|
43
62
|
__decorate([
|
|
44
63
|
(0, typeorm_1.Column)({
|
|
45
64
|
type: "int",
|
|
@@ -69,6 +88,16 @@ __decorate([
|
|
|
69
88
|
}),
|
|
70
89
|
__metadata("design:type", Object)
|
|
71
90
|
], ClientSession.prototype, "push_token", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({
|
|
93
|
+
type: "varchar",
|
|
94
|
+
length: 5,
|
|
95
|
+
nullable: true,
|
|
96
|
+
default: null,
|
|
97
|
+
comment: "Idioma de los avisos push de este dispositivo (es, en).",
|
|
98
|
+
}),
|
|
99
|
+
__metadata("design:type", Object)
|
|
100
|
+
], ClientSession.prototype, "push_language", void 0);
|
|
72
101
|
__decorate([
|
|
73
102
|
(0, typeorm_1.Column)({
|
|
74
103
|
type: "varchar",
|
|
@@ -118,4 +147,9 @@ exports.ClientSession = ClientSession = __decorate([
|
|
|
118
147
|
name: "client_session",
|
|
119
148
|
}),
|
|
120
149
|
(0, typeorm_1.Unique)("UQ_client_session_token", ["token_hash"])
|
|
150
|
+
// DOC: Para la purga nocturna (sql/65): cerradas por `revoked`, vencidas por `expires`.
|
|
151
|
+
,
|
|
152
|
+
(0, typeorm_1.Index)("IDX_client_session_revoked", ["revoked"]),
|
|
153
|
+
(0, typeorm_1.Index)("IDX_client_session_expires", ["expires"]),
|
|
154
|
+
(0, typeorm_1.Index)("IDX_client_session_prev_token", ["prev_token_hash"])
|
|
121
155
|
], ClientSession);
|
|
@@ -11,6 +11,11 @@ export declare class ClientVehicle {
|
|
|
11
11
|
created_by: Associate | null;
|
|
12
12
|
started: Date;
|
|
13
13
|
ended: Date | null;
|
|
14
|
+
suspended: number;
|
|
15
|
+
can_act: number;
|
|
16
|
+
can_book: number;
|
|
17
|
+
receives_notices: number;
|
|
18
|
+
verified: number;
|
|
14
19
|
active_owner: number | null;
|
|
15
20
|
active_client: number | null;
|
|
16
21
|
created: Date;
|