@asumano/worklip-typeorm-db 1.1.91 → 1.1.93
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/AssociateTag.d.ts +31 -0
- package/dist/entities/AssociateTag.js +120 -0
- package/dist/entities/SubscriptionAddon.js +1 -1
- package/dist/entities/SubscriptionAddonTemplate.js +1 -1
- package/dist/entities/UsageAlert.js +1 -1
- package/dist/entities/WorkshopReader.d.ts +38 -0
- package/dist/entities/WorkshopReader.js +169 -0
- package/dist/entities/WorkshopTag.d.ts +29 -0
- package/dist/entities/WorkshopTag.js +160 -0
- package/dist/entities.index.d.ts +3 -0
- package/dist/entities.index.js +10 -1
- package/dist/feature.codes.d.ts +1 -0
- package/dist/feature.codes.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Associate } from "./Associate";
|
|
2
|
+
/**
|
|
3
|
+
* DOC: EL CARNÉ NFC del empleado. Lo lee el lector de la sección en el segundo toque, que es
|
|
4
|
+
* lo que convierte "alguien terminó Latonería" en "Andrés terminó Latonería".
|
|
5
|
+
*
|
|
6
|
+
* ── Por qué no tiene `code` como el llavero ─────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* El llavero tiene que ABRIR LA APP en un celular y para eso necesita una URL escrita adentro.
|
|
9
|
+
* El carné nunca lo lee un celular: solo el lector, y a ese le basta el `uid` de fábrica. Por
|
|
10
|
+
* eso sirve cualquier tarjeta NFC de 13.56 MHz, incluidas las que la empresa ya use para
|
|
11
|
+
* entrar a la oficina.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ Un `uid` se puede clonar: el carné IDENTIFICA, no autentica. Sirve para atribuir
|
|
14
|
+
* trabajo, no para aprobar nada que mueva plata.
|
|
15
|
+
*
|
|
16
|
+
* ── Es de la EMPRESA, no de un taller ───────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* Quien valida el taller es el lector, que ya sabe dónde está colgado: si la persona no está
|
|
19
|
+
* en `workshop_associate` de ese taller, el toque se rechaza. Por eso acá no hay `workshop`.
|
|
20
|
+
*/
|
|
21
|
+
export declare class AssociateTag {
|
|
22
|
+
id: number;
|
|
23
|
+
associate: Associate;
|
|
24
|
+
uid: string;
|
|
25
|
+
last_used: Date | null;
|
|
26
|
+
created: Date;
|
|
27
|
+
created_by: Associate | null;
|
|
28
|
+
updated: Date | null;
|
|
29
|
+
updated_by: Associate | null;
|
|
30
|
+
status: number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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.AssociateTag = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Associate_1 = require("./Associate");
|
|
15
|
+
/**
|
|
16
|
+
* DOC: EL CARNÉ NFC del empleado. Lo lee el lector de la sección en el segundo toque, que es
|
|
17
|
+
* lo que convierte "alguien terminó Latonería" en "Andrés terminó Latonería".
|
|
18
|
+
*
|
|
19
|
+
* ── Por qué no tiene `code` como el llavero ─────────────────────────────────
|
|
20
|
+
*
|
|
21
|
+
* El llavero tiene que ABRIR LA APP en un celular y para eso necesita una URL escrita adentro.
|
|
22
|
+
* El carné nunca lo lee un celular: solo el lector, y a ese le basta el `uid` de fábrica. Por
|
|
23
|
+
* eso sirve cualquier tarjeta NFC de 13.56 MHz, incluidas las que la empresa ya use para
|
|
24
|
+
* entrar a la oficina.
|
|
25
|
+
*
|
|
26
|
+
* ⚠️ Un `uid` se puede clonar: el carné IDENTIFICA, no autentica. Sirve para atribuir
|
|
27
|
+
* trabajo, no para aprobar nada que mueva plata.
|
|
28
|
+
*
|
|
29
|
+
* ── Es de la EMPRESA, no de un taller ───────────────────────────────────────
|
|
30
|
+
*
|
|
31
|
+
* Quien valida el taller es el lector, que ya sabe dónde está colgado: si la persona no está
|
|
32
|
+
* en `workshop_associate` de ese taller, el toque se rechaza. Por eso acá no hay `workshop`.
|
|
33
|
+
*/
|
|
34
|
+
let AssociateTag = class AssociateTag {
|
|
35
|
+
};
|
|
36
|
+
exports.AssociateTag = AssociateTag;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
39
|
+
type: "int",
|
|
40
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], AssociateTag.prototype, "id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.OneToOne)(() => Associate_1.Associate, {
|
|
46
|
+
onDelete: "CASCADE",
|
|
47
|
+
onUpdate: "NO ACTION",
|
|
48
|
+
}),
|
|
49
|
+
(0, typeorm_1.JoinColumn)({ name: "associate" }),
|
|
50
|
+
__metadata("design:type", Associate_1.Associate)
|
|
51
|
+
], AssociateTag.prototype, "associate", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({
|
|
54
|
+
length: 20,
|
|
55
|
+
type: "varchar",
|
|
56
|
+
unique: true,
|
|
57
|
+
comment: "Número de serie de fábrica de la tarjeta, en hexadecimal y sin separadores.",
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], AssociateTag.prototype, "uid", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({
|
|
63
|
+
type: "datetime",
|
|
64
|
+
default: null,
|
|
65
|
+
nullable: true,
|
|
66
|
+
comment: "Último toque registrado con este carné.",
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], AssociateTag.prototype, "last_used", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({
|
|
72
|
+
type: "datetime",
|
|
73
|
+
comment: "Fecha de creación del registro.",
|
|
74
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Date)
|
|
77
|
+
], AssociateTag.prototype, "created", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
|
|
80
|
+
onDelete: "RESTRICT",
|
|
81
|
+
onUpdate: "NO ACTION",
|
|
82
|
+
nullable: true,
|
|
83
|
+
}),
|
|
84
|
+
(0, typeorm_1.JoinColumn)({ name: "created_by" }),
|
|
85
|
+
__metadata("design:type", Object)
|
|
86
|
+
], AssociateTag.prototype, "created_by", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.Column)({
|
|
89
|
+
type: "datetime",
|
|
90
|
+
default: null,
|
|
91
|
+
nullable: true,
|
|
92
|
+
comment: "Fecha de actualización del registro.",
|
|
93
|
+
onUpdate: "CURRENT_TIMESTAMP",
|
|
94
|
+
}),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], AssociateTag.prototype, "updated", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
|
|
99
|
+
onDelete: "RESTRICT",
|
|
100
|
+
onUpdate: "NO ACTION",
|
|
101
|
+
nullable: true,
|
|
102
|
+
}),
|
|
103
|
+
(0, typeorm_1.JoinColumn)({ name: "updated_by" }),
|
|
104
|
+
__metadata("design:type", Object)
|
|
105
|
+
], AssociateTag.prototype, "updated_by", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({
|
|
108
|
+
default: 1,
|
|
109
|
+
type: "int",
|
|
110
|
+
width: 1,
|
|
111
|
+
comment: "¿El carné sirve?\r\n0: Revocado. Se perdió la tarjeta.\r\n1: Activo.",
|
|
112
|
+
}),
|
|
113
|
+
__metadata("design:type", Number)
|
|
114
|
+
], AssociateTag.prototype, "status", void 0);
|
|
115
|
+
exports.AssociateTag = AssociateTag = __decorate([
|
|
116
|
+
(0, typeorm_1.Entity)({
|
|
117
|
+
comment: "Carnés NFC de los empleados. Los lee el lector de la sección para saber quién hizo el trabajo.",
|
|
118
|
+
name: "associate_tag",
|
|
119
|
+
})
|
|
120
|
+
], AssociateTag);
|
|
@@ -43,7 +43,7 @@ __decorate([
|
|
|
43
43
|
__decorate([
|
|
44
44
|
(0, typeorm_1.Column)({
|
|
45
45
|
type: "int",
|
|
46
|
-
comment: "Tipo de complemento de suscripción:\r\n1. STORAGE_GB.\r\n2. WHATSAPP_MESSAGES.\r\n3. EMAIL_MESSAGES.\r\n4. USERS.\r\n5. WORKSHOPS.\r\n6. RETIRADO (eran minutos de notas de voz; NO reutilizar: hay filas vendidas con este valor).\r\n7. VISITS.",
|
|
46
|
+
comment: "Tipo de complemento de suscripción:\r\n1. STORAGE_GB.\r\n2. WHATSAPP_MESSAGES.\r\n3. EMAIL_MESSAGES.\r\n4. USERS.\r\n5. WORKSHOPS.\r\n6. RETIRADO (eran minutos de notas de voz; NO reutilizar: hay filas vendidas con este valor).\r\n7. VISITS.\r\n8. CHATBOT_MESSAGES (respuestas del bot; NO es el 2, que son las notificaciones por plantilla).",
|
|
47
47
|
}),
|
|
48
48
|
__metadata("design:type", Number)
|
|
49
49
|
], SubscriptionAddon.prototype, "addon_type", void 0);
|
|
@@ -51,7 +51,7 @@ __decorate([
|
|
|
51
51
|
__decorate([
|
|
52
52
|
(0, typeorm_1.Column)({
|
|
53
53
|
type: "int",
|
|
54
|
-
comment: "Tipo de recurso:\r\n1. STORAGE_GB.\r\n2. WHATSAPP_MESSAGES.\r\n3. EMAIL_MESSAGES.\r\n4. USERS.\r\n5. WORKSHOPS.",
|
|
54
|
+
comment: "Tipo de recurso:\r\n1. STORAGE_GB.\r\n2. WHATSAPP_MESSAGES.\r\n3. EMAIL_MESSAGES.\r\n4. USERS.\r\n5. WORKSHOPS.\r\n6. RETIRADO (eran minutos de notas de voz; NO reutilizar).\r\n7. VISITS.\r\n8. CHATBOT_MESSAGES (respuestas del bot; NO es el 2, que son las notificaciones por plantilla).",
|
|
55
55
|
}),
|
|
56
56
|
__metadata("design:type", Number)
|
|
57
57
|
], SubscriptionAddonTemplate.prototype, "addon_type", void 0);
|
|
@@ -34,7 +34,7 @@ __decorate([
|
|
|
34
34
|
__decorate([
|
|
35
35
|
(0, typeorm_1.Column)({
|
|
36
36
|
type: "int",
|
|
37
|
-
comment: "Tipo de recurso:\r\n1. STORAGE_GB.\r\n2. WHATSAPP_MESSAGES.\r\n3. EMAIL_MESSAGES.\r\n4. USERS.\r\n5. WORKSHOPS.\r\n6. RETIRADO (eran segundos de notas de voz; NO reutilizar).\r\n7. VISITS.",
|
|
37
|
+
comment: "Tipo de recurso:\r\n1. STORAGE_GB.\r\n2. WHATSAPP_MESSAGES.\r\n3. EMAIL_MESSAGES.\r\n4. USERS.\r\n5. WORKSHOPS.\r\n6. RETIRADO (eran segundos de notas de voz; NO reutilizar).\r\n7. VISITS.\r\n8. CHATBOT_MESSAGES (respuestas del bot; NO es el 2, que son las notificaciones por plantilla).",
|
|
38
38
|
}),
|
|
39
39
|
__metadata("design:type", Number)
|
|
40
40
|
], UsageAlert.prototype, "resource_type", void 0);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Workshop } from "./Workshop";
|
|
2
|
+
import { Section } from "./Section";
|
|
3
|
+
import { Associate } from "./Associate";
|
|
4
|
+
/**
|
|
5
|
+
* DOC: EL LECTOR NFC colgado en una sección del taller, para quien no trabaja con celular.
|
|
6
|
+
*
|
|
7
|
+
* ── Por qué el aparato necesita una fila ────────────────────────────────────
|
|
8
|
+
*
|
|
9
|
+
* No es para cobrarlo —se compra una vez—: es que NO TIENE SESIÓN. Cuando el toque viene de un
|
|
10
|
+
* celular la identidad ya viene en el token del empleado; el lector es una caja en la pared.
|
|
11
|
+
* Esta fila es la que dice de qué taller es, EN QUÉ SECCIÓN está colgado —sin eso el toque de
|
|
12
|
+
* Latonería no sabría que es Latonería— y cuál es su llave.
|
|
13
|
+
*
|
|
14
|
+
* `requireFeature("NFC_TAGS")` no cubre nada de eso: esa pregunta es "¿esta empresa pagó?", no
|
|
15
|
+
* "¿este aparato es legítimo?".
|
|
16
|
+
*
|
|
17
|
+
* ── Vive dormido, y eso manda sobre el diseño del toque ─────────────────────
|
|
18
|
+
*
|
|
19
|
+
* Va por batería, así que no puede recibir nada: el lector HABLA PRIMERO y el servidor nunca
|
|
20
|
+
* lo llama. Todo lo que muestra viaja en la respuesta de ese mismo toque. Y sin señal no lee
|
|
21
|
+
* nada: encolar toques los haría llegar con la hora corrida.
|
|
22
|
+
*/
|
|
23
|
+
export declare class WorkshopReader {
|
|
24
|
+
id: number;
|
|
25
|
+
workshop: Workshop;
|
|
26
|
+
section: Section;
|
|
27
|
+
label: string;
|
|
28
|
+
token_hash: string;
|
|
29
|
+
token_hint: string | null;
|
|
30
|
+
last_seen: Date | null;
|
|
31
|
+
battery: number | null;
|
|
32
|
+
details: any | null;
|
|
33
|
+
created: Date;
|
|
34
|
+
created_by: Associate | null;
|
|
35
|
+
updated: Date | null;
|
|
36
|
+
updated_by: Associate | null;
|
|
37
|
+
status: number;
|
|
38
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
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.WorkshopReader = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Workshop_1 = require("./Workshop");
|
|
15
|
+
const Section_1 = require("./Section");
|
|
16
|
+
const Associate_1 = require("./Associate");
|
|
17
|
+
/**
|
|
18
|
+
* DOC: EL LECTOR NFC colgado en una sección del taller, para quien no trabaja con celular.
|
|
19
|
+
*
|
|
20
|
+
* ── Por qué el aparato necesita una fila ────────────────────────────────────
|
|
21
|
+
*
|
|
22
|
+
* No es para cobrarlo —se compra una vez—: es que NO TIENE SESIÓN. Cuando el toque viene de un
|
|
23
|
+
* celular la identidad ya viene en el token del empleado; el lector es una caja en la pared.
|
|
24
|
+
* Esta fila es la que dice de qué taller es, EN QUÉ SECCIÓN está colgado —sin eso el toque de
|
|
25
|
+
* Latonería no sabría que es Latonería— y cuál es su llave.
|
|
26
|
+
*
|
|
27
|
+
* `requireFeature("NFC_TAGS")` no cubre nada de eso: esa pregunta es "¿esta empresa pagó?", no
|
|
28
|
+
* "¿este aparato es legítimo?".
|
|
29
|
+
*
|
|
30
|
+
* ── Vive dormido, y eso manda sobre el diseño del toque ─────────────────────
|
|
31
|
+
*
|
|
32
|
+
* Va por batería, así que no puede recibir nada: el lector HABLA PRIMERO y el servidor nunca
|
|
33
|
+
* lo llama. Todo lo que muestra viaja en la respuesta de ese mismo toque. Y sin señal no lee
|
|
34
|
+
* nada: encolar toques los haría llegar con la hora corrida.
|
|
35
|
+
*/
|
|
36
|
+
let WorkshopReader = class WorkshopReader {
|
|
37
|
+
};
|
|
38
|
+
exports.WorkshopReader = WorkshopReader;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
41
|
+
type: "int",
|
|
42
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], WorkshopReader.prototype, "id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, {
|
|
48
|
+
onDelete: "CASCADE",
|
|
49
|
+
onUpdate: "NO ACTION",
|
|
50
|
+
}),
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
52
|
+
__metadata("design:type", Workshop_1.Workshop)
|
|
53
|
+
], WorkshopReader.prototype, "workshop", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.ManyToOne)(() => Section_1.Section, {
|
|
56
|
+
onDelete: "RESTRICT",
|
|
57
|
+
onUpdate: "NO ACTION",
|
|
58
|
+
}),
|
|
59
|
+
(0, typeorm_1.JoinColumn)({ name: "section" }),
|
|
60
|
+
__metadata("design:type", Section_1.Section)
|
|
61
|
+
], WorkshopReader.prototype, "section", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({
|
|
64
|
+
length: 50,
|
|
65
|
+
type: "varchar",
|
|
66
|
+
comment: 'Nombre con el que el taller lo reconoce, por ejemplo "Lector de Latonería".',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], WorkshopReader.prototype, "label", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({
|
|
72
|
+
length: 64,
|
|
73
|
+
type: "char",
|
|
74
|
+
unique: true,
|
|
75
|
+
comment: "SHA-256 de la llave del aparato. La llave en claro se muestra una sola vez al registrarlo.",
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], WorkshopReader.prototype, "token_hash", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({
|
|
81
|
+
length: 8,
|
|
82
|
+
type: "varchar",
|
|
83
|
+
default: null,
|
|
84
|
+
nullable: true,
|
|
85
|
+
comment: "Últimos caracteres de la llave, solo para poder distinguir dos lectores en pantalla.",
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], WorkshopReader.prototype, "token_hint", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.Column)({
|
|
91
|
+
type: "datetime",
|
|
92
|
+
default: null,
|
|
93
|
+
nullable: true,
|
|
94
|
+
comment: "Última vez que el aparato habló.",
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], WorkshopReader.prototype, "last_seen", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({
|
|
100
|
+
type: "int",
|
|
101
|
+
width: 3,
|
|
102
|
+
default: null,
|
|
103
|
+
nullable: true,
|
|
104
|
+
comment: "Último porcentaje de batería reportado, de 0 a 100. NULL si nunca ha reportado.",
|
|
105
|
+
}),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], WorkshopReader.prototype, "battery", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({
|
|
110
|
+
type: "json",
|
|
111
|
+
nullable: true,
|
|
112
|
+
default: null,
|
|
113
|
+
comment: "Campo de tipo JSON para lo que necesite el aparato.",
|
|
114
|
+
}),
|
|
115
|
+
__metadata("design:type", Object)
|
|
116
|
+
], WorkshopReader.prototype, "details", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.Column)({
|
|
119
|
+
type: "datetime",
|
|
120
|
+
comment: "Fecha de creación del registro.",
|
|
121
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
122
|
+
}),
|
|
123
|
+
__metadata("design:type", Date)
|
|
124
|
+
], WorkshopReader.prototype, "created", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
|
|
127
|
+
onDelete: "RESTRICT",
|
|
128
|
+
onUpdate: "NO ACTION",
|
|
129
|
+
nullable: true,
|
|
130
|
+
}),
|
|
131
|
+
(0, typeorm_1.JoinColumn)({ name: "created_by" }),
|
|
132
|
+
__metadata("design:type", Object)
|
|
133
|
+
], WorkshopReader.prototype, "created_by", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, typeorm_1.Column)({
|
|
136
|
+
type: "datetime",
|
|
137
|
+
default: null,
|
|
138
|
+
nullable: true,
|
|
139
|
+
comment: "Fecha de actualización del registro.",
|
|
140
|
+
onUpdate: "CURRENT_TIMESTAMP",
|
|
141
|
+
}),
|
|
142
|
+
__metadata("design:type", Object)
|
|
143
|
+
], WorkshopReader.prototype, "updated", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
|
|
146
|
+
onDelete: "RESTRICT",
|
|
147
|
+
onUpdate: "NO ACTION",
|
|
148
|
+
nullable: true,
|
|
149
|
+
}),
|
|
150
|
+
(0, typeorm_1.JoinColumn)({ name: "updated_by" }),
|
|
151
|
+
__metadata("design:type", Object)
|
|
152
|
+
], WorkshopReader.prototype, "updated_by", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, typeorm_1.Column)({
|
|
155
|
+
default: 1,
|
|
156
|
+
type: "int",
|
|
157
|
+
width: 1,
|
|
158
|
+
comment: "¿El lector sigue en servicio?\r\n0: De baja. Se perdió, se dañó o se cambió.\r\n1: Activo.",
|
|
159
|
+
}),
|
|
160
|
+
__metadata("design:type", Number)
|
|
161
|
+
], WorkshopReader.prototype, "status", void 0);
|
|
162
|
+
exports.WorkshopReader = WorkshopReader = __decorate([
|
|
163
|
+
(0, typeorm_1.Index)("IDX_workshop_reader_workshop", ["workshop", "status"]),
|
|
164
|
+
(0, typeorm_1.Index)("IDX_workshop_reader_section", ["section"]),
|
|
165
|
+
(0, typeorm_1.Entity)({
|
|
166
|
+
comment: "Lectores NFC colgados en cada sección del taller, para quien no trabaja con celular.",
|
|
167
|
+
name: "workshop_reader",
|
|
168
|
+
})
|
|
169
|
+
], WorkshopReader);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Workshop } from "./Workshop";
|
|
2
|
+
import { ServiceOrder } from "./ServiceOrder";
|
|
3
|
+
import { Associate } from "./Associate";
|
|
4
|
+
/**
|
|
5
|
+
* DOC: EL LLAVERO NFC que cuelga del carro. Es un ACTIVO DEL TALLER, no una propiedad de la
|
|
6
|
+
* visita: se cuelga, se descuelga y vuelve a servir.
|
|
7
|
+
*
|
|
8
|
+
* ── Dos identificadores, y los dos hacen falta ──────────────────────────────
|
|
9
|
+
*
|
|
10
|
+
* `code` es nuestro y es el que va escrito en el chip como URL: lo único que ve un celular.
|
|
11
|
+
* `uid` es el número de fábrica: lo único que ven el lector USB del mostrador y el lector de
|
|
12
|
+
* la sección, que no entienden de URLs. Guardar uno solo deja ciega la mitad de los aparatos.
|
|
13
|
+
*/
|
|
14
|
+
export declare class WorkshopTag {
|
|
15
|
+
id: number;
|
|
16
|
+
workshop: Workshop;
|
|
17
|
+
code: string;
|
|
18
|
+
uid: string | null;
|
|
19
|
+
service_order: ServiceOrder | null;
|
|
20
|
+
label: string;
|
|
21
|
+
ndef_written: number;
|
|
22
|
+
last_used: Date | null;
|
|
23
|
+
details: any | null;
|
|
24
|
+
created: Date;
|
|
25
|
+
created_by: Associate | null;
|
|
26
|
+
updated: Date | null;
|
|
27
|
+
updated_by: Associate | null;
|
|
28
|
+
status: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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.WorkshopTag = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Workshop_1 = require("./Workshop");
|
|
15
|
+
const ServiceOrder_1 = require("./ServiceOrder");
|
|
16
|
+
const Associate_1 = require("./Associate");
|
|
17
|
+
/**
|
|
18
|
+
* DOC: EL LLAVERO NFC que cuelga del carro. Es un ACTIVO DEL TALLER, no una propiedad de la
|
|
19
|
+
* visita: se cuelga, se descuelga y vuelve a servir.
|
|
20
|
+
*
|
|
21
|
+
* ── Dos identificadores, y los dos hacen falta ──────────────────────────────
|
|
22
|
+
*
|
|
23
|
+
* `code` es nuestro y es el que va escrito en el chip como URL: lo único que ve un celular.
|
|
24
|
+
* `uid` es el número de fábrica: lo único que ven el lector USB del mostrador y el lector de
|
|
25
|
+
* la sección, que no entienden de URLs. Guardar uno solo deja ciega la mitad de los aparatos.
|
|
26
|
+
*/
|
|
27
|
+
let WorkshopTag = class WorkshopTag {
|
|
28
|
+
};
|
|
29
|
+
exports.WorkshopTag = WorkshopTag;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
32
|
+
type: "int",
|
|
33
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], WorkshopTag.prototype, "id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, {
|
|
39
|
+
onDelete: "CASCADE",
|
|
40
|
+
onUpdate: "NO ACTION",
|
|
41
|
+
}),
|
|
42
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
43
|
+
__metadata("design:type", Workshop_1.Workshop)
|
|
44
|
+
], WorkshopTag.prototype, "workshop", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({
|
|
47
|
+
length: 32,
|
|
48
|
+
type: "varchar",
|
|
49
|
+
unique: true,
|
|
50
|
+
comment: "Código aleatorio propio. Es el que va escrito en el chip como URL y el que resuelve el toque del celular.",
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], WorkshopTag.prototype, "code", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({
|
|
56
|
+
length: 20,
|
|
57
|
+
type: "varchar",
|
|
58
|
+
unique: true,
|
|
59
|
+
nullable: true,
|
|
60
|
+
default: null,
|
|
61
|
+
comment: "Número de serie de fábrica del chip, en hexadecimal y sin separadores. NULL mientras no se haya escaneado.",
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], WorkshopTag.prototype, "uid", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.OneToOne)(() => ServiceOrder_1.ServiceOrder, {
|
|
67
|
+
onDelete: "SET NULL",
|
|
68
|
+
onUpdate: "NO ACTION",
|
|
69
|
+
nullable: true,
|
|
70
|
+
}),
|
|
71
|
+
(0, typeorm_1.JoinColumn)({ name: "service_order" }),
|
|
72
|
+
__metadata("design:type", Object)
|
|
73
|
+
], WorkshopTag.prototype, "service_order", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({
|
|
76
|
+
length: 50,
|
|
77
|
+
type: "varchar",
|
|
78
|
+
comment: 'Nombre con el que el taller lo reconoce, por ejemplo "Llavero 047".',
|
|
79
|
+
}),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], WorkshopTag.prototype, "label", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.Column)({
|
|
84
|
+
default: 0,
|
|
85
|
+
type: "tinyint",
|
|
86
|
+
width: 1,
|
|
87
|
+
comment: "¿El chip ya tiene la URL grabada?\r\n0: Solo sirve en los lectores.\r\n1: También abre la app al acercarle un celular.",
|
|
88
|
+
}),
|
|
89
|
+
__metadata("design:type", Number)
|
|
90
|
+
], WorkshopTag.prototype, "ndef_written", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({
|
|
93
|
+
type: "datetime",
|
|
94
|
+
default: null,
|
|
95
|
+
nullable: true,
|
|
96
|
+
comment: "Último toque registrado con este llavero.",
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], WorkshopTag.prototype, "last_used", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({
|
|
102
|
+
type: "json",
|
|
103
|
+
nullable: true,
|
|
104
|
+
default: null,
|
|
105
|
+
comment: "Campo de tipo JSON para lo que necesite el llavero.",
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Object)
|
|
108
|
+
], WorkshopTag.prototype, "details", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.Column)({
|
|
111
|
+
type: "datetime",
|
|
112
|
+
comment: "Fecha de creación del registro.",
|
|
113
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
114
|
+
}),
|
|
115
|
+
__metadata("design:type", Date)
|
|
116
|
+
], WorkshopTag.prototype, "created", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
|
|
119
|
+
onDelete: "RESTRICT",
|
|
120
|
+
onUpdate: "NO ACTION",
|
|
121
|
+
nullable: true,
|
|
122
|
+
}),
|
|
123
|
+
(0, typeorm_1.JoinColumn)({ name: "created_by" }),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], WorkshopTag.prototype, "created_by", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.Column)({
|
|
128
|
+
type: "datetime",
|
|
129
|
+
default: null,
|
|
130
|
+
nullable: true,
|
|
131
|
+
comment: "Fecha de actualización del registro.",
|
|
132
|
+
onUpdate: "CURRENT_TIMESTAMP",
|
|
133
|
+
}),
|
|
134
|
+
__metadata("design:type", Object)
|
|
135
|
+
], WorkshopTag.prototype, "updated", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
|
|
138
|
+
onDelete: "RESTRICT",
|
|
139
|
+
onUpdate: "NO ACTION",
|
|
140
|
+
nullable: true,
|
|
141
|
+
}),
|
|
142
|
+
(0, typeorm_1.JoinColumn)({ name: "updated_by" }),
|
|
143
|
+
__metadata("design:type", Object)
|
|
144
|
+
], WorkshopTag.prototype, "updated_by", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.Column)({
|
|
147
|
+
default: 1,
|
|
148
|
+
type: "int",
|
|
149
|
+
width: 1,
|
|
150
|
+
comment: "¿El llavero sigue en uso?\r\n0: De baja. Se perdió o se dañó.\r\n1: Activo.",
|
|
151
|
+
}),
|
|
152
|
+
__metadata("design:type", Number)
|
|
153
|
+
], WorkshopTag.prototype, "status", void 0);
|
|
154
|
+
exports.WorkshopTag = WorkshopTag = __decorate([
|
|
155
|
+
(0, typeorm_1.Index)("IDX_workshop_tag_workshop", ["workshop", "status"]),
|
|
156
|
+
(0, typeorm_1.Entity)({
|
|
157
|
+
comment: "Llaveros NFC del taller: se cuelgan de un carro mientras dura la visita y se reusan.",
|
|
158
|
+
name: "workshop_tag",
|
|
159
|
+
})
|
|
160
|
+
], WorkshopTag);
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -59,6 +59,9 @@ export { CompanyDiscount } from "./entities/CompanyDiscount";
|
|
|
59
59
|
export { WorkboardStatus } from "./entities/WorkboardStatus";
|
|
60
60
|
export { ServiceOrderStage } from "./entities/ServiceOrderStage";
|
|
61
61
|
export { WorkboardEvent } from "./entities/WorkboardEvent";
|
|
62
|
+
export { WorkshopTag } from "./entities/WorkshopTag";
|
|
63
|
+
export { AssociateTag } from "./entities/AssociateTag";
|
|
64
|
+
export { WorkshopReader } from "./entities/WorkshopReader";
|
|
62
65
|
export { Associates } from "./views/Associates";
|
|
63
66
|
export { ServicesOrder } from "./views/ServicesOrder";
|
|
64
67
|
export { Clients } from "./views/Clients";
|
package/dist/entities.index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BillingInvoice = exports.EmailSuppression = exports.EmailLog = exports.WhatsappLog = exports.ServiceOrderApproval = exports.MediaFile = exports.BillingUsageSnapshot = exports.PaymentMethod = exports.SubscriptionAddon = exports.CompanySubscription = exports.SubscriptionPlan = exports.CountryHoliday = exports.CompanyVehicleType = exports.BrandVehicleType = exports.CompanyBrand = exports.VehicleType = exports.MasterSection = exports.MasterPermission = exports.MasterRole = exports.MasterPlatform = exports.MasterPasswordReset = exports.AssociatePasswordReset = exports.AssociateSection = exports.AssociatePermission = exports.AssociateRole = exports.AssociatePlatform = exports.Reminder = exports.ServiceOrderHistory = exports.ServiceOrder = exports.TemplateSection = exports.SectionItem = exports.Section = exports.Template = exports.Workshop = exports.GlobalTemplateSection = exports.GlobalSectionItem = exports.GlobalSection = exports.GlobalTemplate = exports.AssociateSession = exports.MasterSession = exports.Associate = exports.Client = exports.Master = exports.Vehicle = exports.Brand = exports.Company = exports.City = exports.Region = exports.WhatsappLine = exports.Country = void 0;
|
|
4
|
-
exports.GlobalSectionItems = exports.GlobalSections = exports.GlobalTemplates = exports.SubscriptionAddonTemplates = exports.SubscriptionPlans = exports.Masters = exports.Companies = exports.WorkshopsByAssociate = exports.Workshops = exports.SectionItems = exports.Sections = exports.Templates = exports.Reminders = exports.Vehicles = exports.Clients = exports.ServicesOrder = exports.Associates = exports.WorkboardEvent = exports.ServiceOrderStage = exports.WorkboardStatus = exports.CompanyDiscount = exports.DiscountCode = exports.PlanFeature = exports.CompanyFeature = exports.Feature = exports.UsageAlert = exports.SubscriptionAddonTemplate = exports.PaymentTransaction = void 0;
|
|
4
|
+
exports.GlobalSectionItems = exports.GlobalSections = exports.GlobalTemplates = exports.SubscriptionAddonTemplates = exports.SubscriptionPlans = exports.Masters = exports.Companies = exports.WorkshopsByAssociate = exports.Workshops = exports.SectionItems = exports.Sections = exports.Templates = exports.Reminders = exports.Vehicles = exports.Clients = exports.ServicesOrder = exports.Associates = exports.WorkshopReader = exports.AssociateTag = exports.WorkshopTag = exports.WorkboardEvent = exports.ServiceOrderStage = exports.WorkboardStatus = exports.CompanyDiscount = exports.DiscountCode = exports.PlanFeature = exports.CompanyFeature = exports.Feature = exports.UsageAlert = exports.SubscriptionAddonTemplate = exports.PaymentTransaction = 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 WhatsappLine_1 = require("./entities/WhatsappLine");
|
|
@@ -131,6 +131,15 @@ var ServiceOrderStage_1 = require("./entities/ServiceOrderStage");
|
|
|
131
131
|
Object.defineProperty(exports, "ServiceOrderStage", { enumerable: true, get: function () { return ServiceOrderStage_1.ServiceOrderStage; } });
|
|
132
132
|
var WorkboardEvent_1 = require("./entities/WorkboardEvent");
|
|
133
133
|
Object.defineProperty(exports, "WorkboardEvent", { enumerable: true, get: function () { return WorkboardEvent_1.WorkboardEvent; } });
|
|
134
|
+
// DOC: Etiquetas NFC. El llavero que cuelga del carro, el carné del empleado y el lector de
|
|
135
|
+
// la sección. Las tres SÍ son de la funcionalidad NFC_TAGS, al revés que las del
|
|
136
|
+
// tablero: acá lo que se vende es el toque mismo.
|
|
137
|
+
var WorkshopTag_1 = require("./entities/WorkshopTag");
|
|
138
|
+
Object.defineProperty(exports, "WorkshopTag", { enumerable: true, get: function () { return WorkshopTag_1.WorkshopTag; } });
|
|
139
|
+
var AssociateTag_1 = require("./entities/AssociateTag");
|
|
140
|
+
Object.defineProperty(exports, "AssociateTag", { enumerable: true, get: function () { return AssociateTag_1.AssociateTag; } });
|
|
141
|
+
var WorkshopReader_1 = require("./entities/WorkshopReader");
|
|
142
|
+
Object.defineProperty(exports, "WorkshopReader", { enumerable: true, get: function () { return WorkshopReader_1.WorkshopReader; } });
|
|
134
143
|
var Associates_1 = require("./views/Associates");
|
|
135
144
|
Object.defineProperty(exports, "Associates", { enumerable: true, get: function () { return Associates_1.Associates; } });
|
|
136
145
|
var ServicesOrder_1 = require("./views/ServicesOrder");
|
package/dist/feature.codes.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
export declare const FEATURE_CODE: {
|
|
15
15
|
readonly WORKBOARD: "WORKBOARD";
|
|
16
16
|
readonly WHATSAPP_CHATBOT: "WHATSAPP_CHATBOT";
|
|
17
|
+
readonly NFC_TAGS: "NFC_TAGS";
|
|
17
18
|
};
|
|
18
19
|
export type TFeatureCode = (typeof FEATURE_CODE)[keyof typeof FEATURE_CODE];
|
|
19
20
|
export declare const FEATURE_CODES: TFeatureCode[];
|
package/dist/feature.codes.js
CHANGED
|
@@ -19,6 +19,9 @@ exports.FEATURE_CODE = {
|
|
|
19
19
|
// DOC: El chatbot de WhatsApp. Al contratarlo la empresa pasa a tener su propia línea y
|
|
20
20
|
// TODO se mueve ahí: el bot y las siete plantillas de visitas.
|
|
21
21
|
WHATSAPP_CHATBOT: "WHATSAPP_CHATBOT",
|
|
22
|
+
// DOC: Las etiquetas NFC. Va APARTE del tablero y no adentro: se vende sola, y el chip es
|
|
23
|
+
// hardware que el taller puede comprarnos o traer por su cuenta.
|
|
24
|
+
NFC_TAGS: "NFC_TAGS",
|
|
22
25
|
};
|
|
23
26
|
exports.FEATURE_CODES = Object.values(exports.FEATURE_CODE);
|
|
24
27
|
const isFeatureCode = (code) => exports.FEATURE_CODES.includes(code);
|