@asumano/worklip-typeorm-db 1.1.106 → 1.1.107

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.
@@ -2,6 +2,7 @@ import { Associate } from "./Associate";
2
2
  import { Client } from "./Client";
3
3
  import { Reminder } from "./Reminder";
4
4
  import { ServiceOrder } from "./ServiceOrder";
5
+ import { ServiceOrderOuting } from "./ServiceOrderOuting";
5
6
  import { Template } from "./Template";
6
7
  import { Vehicle } from "./Vehicle";
7
8
  import { Workshop } from "./Workshop";
@@ -25,6 +26,7 @@ export declare class Appointment {
25
26
  template: Template | null;
26
27
  reminder: Reminder | null;
27
28
  service_order: ServiceOrder | null;
29
+ outing: ServiceOrderOuting | null;
28
30
  appointment_date: string;
29
31
  slot: number;
30
32
  status: number;
@@ -15,6 +15,7 @@ const Associate_1 = require("./Associate");
15
15
  const Client_1 = require("./Client");
16
16
  const Reminder_1 = require("./Reminder");
17
17
  const ServiceOrder_1 = require("./ServiceOrder");
18
+ const ServiceOrderOuting_1 = require("./ServiceOrderOuting");
18
19
  const Template_1 = require("./Template");
19
20
  const Vehicle_1 = require("./Vehicle");
20
21
  const Workshop_1 = require("./Workshop");
@@ -102,6 +103,15 @@ __decorate([
102
103
  (0, typeorm_1.JoinColumn)({ name: "service_order" }),
103
104
  __metadata("design:type", Object)
104
105
  ], Appointment.prototype, "service_order", void 0);
106
+ __decorate([
107
+ (0, typeorm_1.ManyToOne)(() => ServiceOrderOuting_1.ServiceOrderOuting, {
108
+ onDelete: "SET NULL",
109
+ onUpdate: "NO ACTION",
110
+ nullable: true,
111
+ }),
112
+ (0, typeorm_1.JoinColumn)({ name: "outing" }),
113
+ __metadata("design:type", Object)
114
+ ], Appointment.prototype, "outing", void 0);
105
115
  __decorate([
106
116
  (0, typeorm_1.Column)({
107
117
  type: "date",
@@ -60,6 +60,7 @@ export declare class ServiceOrder {
60
60
  reinspection_of: ServiceOrder | null;
61
61
  insurer: Insurer | null;
62
62
  claim_number: string | null;
63
+ outside_since: Date | null;
63
64
  stages: ServiceOrderStage[];
64
65
  workboard_events: WorkboardEvent[];
65
66
  service_order_history: ServiceOrderHistory[];
@@ -320,6 +320,15 @@ __decorate([
320
320
  }),
321
321
  __metadata("design:type", Object)
322
322
  ], ServiceOrder.prototype, "claim_number", void 0);
323
+ __decorate([
324
+ (0, typeorm_1.Column)({
325
+ type: "datetime",
326
+ nullable: true,
327
+ default: null,
328
+ comment: "Desde cuándo está el vehículo fuera del taller (salida temporal abierta). NULL: está en el taller.",
329
+ }),
330
+ __metadata("design:type", Object)
331
+ ], ServiceOrder.prototype, "outside_since", void 0);
323
332
  __decorate([
324
333
  (0, typeorm_1.OneToMany)(() => ServiceOrderStage_1.ServiceOrderStage, (stage) => stage.service_order),
325
334
  __metadata("design:type", Array)
@@ -356,7 +365,10 @@ exports.ServiceOrder = ServiceOrder = __decorate([
356
365
  (0, typeorm_1.Index)("UQ_service_order_visit_sequence", ["workshop", "visit_year", "visit_sequence"], { unique: true })
357
366
  // DOC: Para buscar/ordenar por el número dentro de un taller sin escanear la tabla.
358
367
  ,
359
- (0, typeorm_1.Index)("IDX_service_order_visit_number", ["workshop", "visit_number"]),
368
+ (0, typeorm_1.Index)("IDX_service_order_visit_number", ["workshop", "visit_number"])
369
+ // DOC: «Los vehículos fuera del taller de esta sede», para la tabla, el aviso y las métricas.
370
+ ,
371
+ (0, typeorm_1.Index)("IDX_service_order_outside", ["workshop", "outside_since"]),
360
372
  (0, typeorm_1.Entity)({
361
373
  comment: "Órdenes de servicio del concesionario/taller.",
362
374
  name: "service_order",
@@ -0,0 +1,41 @@
1
+ import { Associate } from "./Associate";
2
+ import { Client } from "./Client";
3
+ import { ServiceOrder } from "./ServiceOrder";
4
+ import { WorkboardStatus } from "./WorkboardStatus";
5
+ import { Workshop } from "./Workshop";
6
+ /**
7
+ * DOC: UNA SALIDA TEMPORAL del vehículo con la visita abierta, y su reingreso (sql/84).
8
+ *
9
+ * Lo que se llena (inventario, fotos, firma) va en las COPIAS de las secciones de ingreso y salida
10
+ * dentro de `service_order.data`; esta fila es el registro corto para filtrar, contar y medir sin
11
+ * leer ese JSON. `returned_at` NULL = el vehículo sigue afuera, y `service_order.outside_since` lo
12
+ * repite para la tabla de visitas.
13
+ *
14
+ * Quien se lo lleva o lo trae se guarda COPIADO (nombre y documento) aunque se escoja de la lista
15
+ * de clientes: es la constancia de ese día, y la ficha del cliente puede cambiar después.
16
+ */
17
+ export declare class ServiceOrderOuting {
18
+ id: number;
19
+ service_order: ServiceOrder;
20
+ workshop: Workshop;
21
+ left_at: Date;
22
+ left_by: Associate;
23
+ left_mileage: number | null;
24
+ left_client: Client | null;
25
+ left_person_name: string;
26
+ left_person_document_type: string | null;
27
+ left_person_document: string | null;
28
+ left_section: string | null;
29
+ left_workboard_status: WorkboardStatus | null;
30
+ note: string | null;
31
+ returned_at: Date | null;
32
+ returned_by: Associate | null;
33
+ returned_mileage: number | null;
34
+ returned_client: Client | null;
35
+ returned_person_name: string | null;
36
+ returned_person_document_type: string | null;
37
+ returned_person_document: string | null;
38
+ returned_section: string | null;
39
+ created: Date;
40
+ updated: Date | null;
41
+ }
@@ -0,0 +1,184 @@
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.ServiceOrderOuting = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Associate_1 = require("./Associate");
15
+ const Client_1 = require("./Client");
16
+ const ServiceOrder_1 = require("./ServiceOrder");
17
+ const WorkboardStatus_1 = require("./WorkboardStatus");
18
+ const Workshop_1 = require("./Workshop");
19
+ /**
20
+ * DOC: UNA SALIDA TEMPORAL del vehículo con la visita abierta, y su reingreso (sql/84).
21
+ *
22
+ * Lo que se llena (inventario, fotos, firma) va en las COPIAS de las secciones de ingreso y salida
23
+ * dentro de `service_order.data`; esta fila es el registro corto para filtrar, contar y medir sin
24
+ * leer ese JSON. `returned_at` NULL = el vehículo sigue afuera, y `service_order.outside_since` lo
25
+ * repite para la tabla de visitas.
26
+ *
27
+ * Quien se lo lleva o lo trae se guarda COPIADO (nombre y documento) aunque se escoja de la lista
28
+ * de clientes: es la constancia de ese día, y la ficha del cliente puede cambiar después.
29
+ */
30
+ let ServiceOrderOuting = class ServiceOrderOuting {
31
+ };
32
+ exports.ServiceOrderOuting = ServiceOrderOuting;
33
+ __decorate([
34
+ (0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
35
+ __metadata("design:type", Number)
36
+ ], ServiceOrderOuting.prototype, "id", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.ManyToOne)(() => ServiceOrder_1.ServiceOrder, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
39
+ (0, typeorm_1.JoinColumn)({ name: "service_order" }),
40
+ __metadata("design:type", ServiceOrder_1.ServiceOrder)
41
+ ], ServiceOrderOuting.prototype, "service_order", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
44
+ (0, typeorm_1.JoinColumn)({ name: "workshop" }),
45
+ __metadata("design:type", Workshop_1.Workshop)
46
+ ], ServiceOrderOuting.prototype, "workshop", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: "datetime", default: () => "CURRENT_TIMESTAMP", comment: "Cuándo salió el vehículo del taller." }),
49
+ __metadata("design:type", Date)
50
+ ], ServiceOrderOuting.prototype, "left_at", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "RESTRICT", onUpdate: "NO ACTION" }),
53
+ (0, typeorm_1.JoinColumn)({ name: "left_by" }),
54
+ __metadata("design:type", Associate_1.Associate)
55
+ ], ServiceOrderOuting.prototype, "left_by", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: "int", nullable: true, default: null, comment: "Kilometraje al salir." }),
58
+ __metadata("design:type", Object)
59
+ ], ServiceOrderOuting.prototype, "left_mileage", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.ManyToOne)(() => Client_1.Client, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
62
+ (0, typeorm_1.JoinColumn)({ name: "left_client" }),
63
+ __metadata("design:type", Object)
64
+ ], ServiceOrderOuting.prototype, "left_client", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({
67
+ type: "varchar",
68
+ length: 150,
69
+ comment: "Nombre de quien se lo llevó (copiado del cliente si se escogió de la lista).",
70
+ }),
71
+ __metadata("design:type", String)
72
+ ], ServiceOrderOuting.prototype, "left_person_name", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({
75
+ type: "varchar",
76
+ length: 10,
77
+ nullable: true,
78
+ default: null,
79
+ comment: "Tipo de documento de quien se lo llevó (C.C, PASAPORTE...), como client.document_type.",
80
+ }),
81
+ __metadata("design:type", Object)
82
+ ], ServiceOrderOuting.prototype, "left_person_document_type", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({ type: "varchar", length: 30, nullable: true, default: null, comment: "Documento de quien se lo llevó." }),
85
+ __metadata("design:type", Object)
86
+ ], ServiceOrderOuting.prototype, "left_person_document", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.Column)({
89
+ type: "varchar",
90
+ length: 120,
91
+ nullable: true,
92
+ default: null,
93
+ comment: "Id de la copia de la sección de salida dentro de service_order.data.",
94
+ }),
95
+ __metadata("design:type", Object)
96
+ ], ServiceOrderOuting.prototype, "left_section", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.ManyToOne)(() => WorkboardStatus_1.WorkboardStatus, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
99
+ (0, typeorm_1.JoinColumn)({ name: "left_workboard_status" }),
100
+ __metadata("design:type", Object)
101
+ ], ServiceOrderOuting.prototype, "left_workboard_status", void 0);
102
+ __decorate([
103
+ (0, typeorm_1.Column)({
104
+ type: "varchar",
105
+ length: 500,
106
+ nullable: true,
107
+ default: null,
108
+ comment: "Motivo u observación de la salida (p. ej. esperando repuestos).",
109
+ }),
110
+ __metadata("design:type", Object)
111
+ ], ServiceOrderOuting.prototype, "note", void 0);
112
+ __decorate([
113
+ (0, typeorm_1.Column)({
114
+ type: "datetime",
115
+ nullable: true,
116
+ default: null,
117
+ comment: "Cuándo volvió. NULL: el vehículo sigue fuera del taller.",
118
+ }),
119
+ __metadata("design:type", Object)
120
+ ], ServiceOrderOuting.prototype, "returned_at", void 0);
121
+ __decorate([
122
+ (0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "RESTRICT", onUpdate: "NO ACTION", nullable: true }),
123
+ (0, typeorm_1.JoinColumn)({ name: "returned_by" }),
124
+ __metadata("design:type", Object)
125
+ ], ServiceOrderOuting.prototype, "returned_by", void 0);
126
+ __decorate([
127
+ (0, typeorm_1.Column)({ type: "int", nullable: true, default: null, comment: "Kilometraje al volver." }),
128
+ __metadata("design:type", Object)
129
+ ], ServiceOrderOuting.prototype, "returned_mileage", void 0);
130
+ __decorate([
131
+ (0, typeorm_1.ManyToOne)(() => Client_1.Client, { onDelete: "SET NULL", onUpdate: "NO ACTION", nullable: true }),
132
+ (0, typeorm_1.JoinColumn)({ name: "returned_client" }),
133
+ __metadata("design:type", Object)
134
+ ], ServiceOrderOuting.prototype, "returned_client", void 0);
135
+ __decorate([
136
+ (0, typeorm_1.Column)({ type: "varchar", length: 150, nullable: true, default: null, comment: "Nombre de quien lo trajo." }),
137
+ __metadata("design:type", Object)
138
+ ], ServiceOrderOuting.prototype, "returned_person_name", void 0);
139
+ __decorate([
140
+ (0, typeorm_1.Column)({
141
+ type: "varchar",
142
+ length: 10,
143
+ nullable: true,
144
+ default: null,
145
+ comment: "Tipo de documento de quien lo trajo.",
146
+ }),
147
+ __metadata("design:type", Object)
148
+ ], ServiceOrderOuting.prototype, "returned_person_document_type", void 0);
149
+ __decorate([
150
+ (0, typeorm_1.Column)({ type: "varchar", length: 30, nullable: true, default: null, comment: "Documento de quien lo trajo." }),
151
+ __metadata("design:type", Object)
152
+ ], ServiceOrderOuting.prototype, "returned_person_document", void 0);
153
+ __decorate([
154
+ (0, typeorm_1.Column)({
155
+ type: "varchar",
156
+ length: 120,
157
+ nullable: true,
158
+ default: null,
159
+ comment: "Id de la copia de la sección de ingreso dentro de service_order.data.",
160
+ }),
161
+ __metadata("design:type", Object)
162
+ ], ServiceOrderOuting.prototype, "returned_section", void 0);
163
+ __decorate([
164
+ (0, typeorm_1.Column)({ type: "datetime", default: () => "CURRENT_TIMESTAMP", comment: "Fecha de creación del registro." }),
165
+ __metadata("design:type", Date)
166
+ ], ServiceOrderOuting.prototype, "created", void 0);
167
+ __decorate([
168
+ (0, typeorm_1.Column)({
169
+ type: "datetime",
170
+ nullable: true,
171
+ default: null,
172
+ onUpdate: "CURRENT_TIMESTAMP",
173
+ comment: "Fecha de actualización del registro.",
174
+ }),
175
+ __metadata("design:type", Object)
176
+ ], ServiceOrderOuting.prototype, "updated", void 0);
177
+ exports.ServiceOrderOuting = ServiceOrderOuting = __decorate([
178
+ (0, typeorm_1.Index)("IDX_service_order_outing_order", ["service_order", "returned_at"]),
179
+ (0, typeorm_1.Index)("IDX_service_order_outing_workshop", ["workshop", "returned_at"]),
180
+ (0, typeorm_1.Entity)({
181
+ comment: "Salidas temporales del vehículo con la visita abierta (en pausa) y su reingreso.",
182
+ name: "service_order_outing",
183
+ })
184
+ ], ServiceOrderOuting);
@@ -9,6 +9,7 @@ export declare class ServiceOrderPart {
9
9
  quantity: string;
10
10
  state: number;
11
11
  expected_date: string | null;
12
+ ordered_at: Date | null;
12
13
  received_at: Date | null;
13
14
  received_by: Associate | null;
14
15
  note: string | null;
@@ -89,6 +89,15 @@ __decorate([
89
89
  }),
90
90
  __metadata("design:type", Object)
91
91
  ], ServiceOrderPart.prototype, "expected_date", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.Column)({
94
+ type: "datetime",
95
+ nullable: true,
96
+ default: null,
97
+ comment: "Cuándo pasó a Pedido (o se creó ya pedido). NULL en los anteriores a sql/84: no entran en el promedio de llegada.",
98
+ }),
99
+ __metadata("design:type", Object)
100
+ ], ServiceOrderPart.prototype, "ordered_at", void 0);
92
101
  __decorate([
93
102
  (0, typeorm_1.Column)({
94
103
  type: "datetime",
@@ -86,7 +86,7 @@ __decorate([
86
86
  default: 7,
87
87
  type: "int",
88
88
  width: 1,
89
- comment: "Semántica de sistema del estado:\r\n1: Entrada. Acá nace la visita y acá se configura.\r\n2: En proceso. Cuenta tiempo de trabajo.\r\n3: Bloqueado. Exige motivo y no cuenta como trabajo.\r\n4: Trabajo terminado. Todas las etapas cerradas.\r\n5: Listo para entregar. Ya se le avisó al cliente.\r\n6: Entregado. Terminal, cierra la visita en el tablero.\r\n7: Personalizado. Lo que el taller invente entre medias.",
89
+ comment: "Semántica de sistema del estado:\r\n1: Entrada. Acá nace la visita y acá se configura.\r\n2: En proceso. Cuenta tiempo de trabajo.\r\n3: Bloqueado. Exige motivo y no cuenta como trabajo.\r\n4: Trabajo terminado. Todas las etapas cerradas.\r\n5: Listo para entregar. Ya se le avisó al cliente.\r\n6: Entregado. Terminal, cierra la visita en el tablero.\r\n7: Personalizado. Lo que el taller invente entre medias.\r\n8: Fuera del taller. Salida temporal: la visita está en pausa y no cuenta tiempo.",
90
90
  }),
91
91
  __metadata("design:type", Number)
92
92
  ], WorkboardStatus.prototype, "kind", void 0);
@@ -0,0 +1,9 @@
1
+ import { Associate } from "./Associate";
2
+ import { Workshop } from "./Workshop";
3
+ export declare class WorkshopOutingRecipient {
4
+ id: number;
5
+ workshop: Workshop;
6
+ associate: Associate;
7
+ created: Date;
8
+ created_by: Associate | null;
9
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WorkshopOutingRecipient = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Associate_1 = require("./Associate");
15
+ const Workshop_1 = require("./Workshop");
16
+ // DOC: Quién recibe el aviso periódico de los vehículos fuera del taller (sql/84). Cada cuánto va en
17
+ // `workshop.details.outing_report` (ver `outing.rules.ts`).
18
+ let WorkshopOutingRecipient = class WorkshopOutingRecipient {
19
+ };
20
+ exports.WorkshopOutingRecipient = WorkshopOutingRecipient;
21
+ __decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
23
+ __metadata("design:type", Number)
24
+ ], WorkshopOutingRecipient.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
27
+ (0, typeorm_1.JoinColumn)({ name: "workshop" }),
28
+ __metadata("design:type", Workshop_1.Workshop)
29
+ ], WorkshopOutingRecipient.prototype, "workshop", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
32
+ (0, typeorm_1.JoinColumn)({ name: "associate" }),
33
+ __metadata("design:type", Associate_1.Associate)
34
+ ], WorkshopOutingRecipient.prototype, "associate", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: "datetime", default: () => "CURRENT_TIMESTAMP", comment: "Fecha de creación del registro." }),
37
+ __metadata("design:type", Date)
38
+ ], WorkshopOutingRecipient.prototype, "created", 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: "created_by" }),
42
+ __metadata("design:type", Object)
43
+ ], WorkshopOutingRecipient.prototype, "created_by", void 0);
44
+ exports.WorkshopOutingRecipient = WorkshopOutingRecipient = __decorate([
45
+ (0, typeorm_1.Entity)({
46
+ comment: "Empleados que reciben el aviso periódico de los vehículos fuera del taller.",
47
+ name: "workshop_outing_recipient",
48
+ }),
49
+ (0, typeorm_1.Unique)("UQ_workshop_outing_recipient", ["workshop", "associate"])
50
+ ], WorkshopOutingRecipient);
@@ -84,6 +84,8 @@ export { ReminderTypeCompanyType } from "./entities/ReminderTypeCompanyType";
84
84
  export { VisitResult } from "./entities/VisitResult";
85
85
  export { ServiceOrderObservation } from "./entities/ServiceOrderObservation";
86
86
  export { ServiceOrderPart } from "./entities/ServiceOrderPart";
87
+ export { ServiceOrderOuting } from "./entities/ServiceOrderOuting";
88
+ export { WorkshopOutingRecipient } from "./entities/WorkshopOutingRecipient";
87
89
  export { OfferedService } from "./entities/OfferedService";
88
90
  export { Insurer } from "./entities/Insurer";
89
91
  export { WorkshopOfferedService } from "./entities/WorkshopOfferedService";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AssociateSection = exports.AssociatePermission = exports.AssociateRole = exports.AssociatePlatform = exports.ClientSubscription = exports.ClientPlanLimit = exports.ClientPlan = exports.ClientDocumentDispute = exports.ReviewTaskEvent = exports.ReviewTask = exports.MasterNotification = exports.ClientSession = exports.ClientNotification = exports.ClientIdentity = exports.PypRuleVote = exports.PypRule = exports.VehicleVerification = exports.ClientVehicleInvite = exports.ClientVehicle = exports.CompanyVehicle = exports.CompanyClient = exports.Appointment = exports.DocumentType = exports.ReminderType = 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.AssociateNotification = exports.AssociateSession = exports.MasterSession = exports.Associate = exports.Client = exports.Master = exports.VehicleReport = exports.Vehicle = exports.Brand = exports.Company = exports.City = exports.Region = exports.WhatsappLine = exports.Country = void 0;
4
- exports.MetricEvent = exports.StageMetric = exports.AssociateDailyStats = exports.WorkshopDailyStats = exports.WorkboardEvent = exports.ServiceOrderStage = exports.WorkboardStatus = exports.CompanyDiscount = exports.DiscountCode = exports.WorkshopDisplay = exports.WorkshopInsurer = exports.WorkshopOfferedService = exports.Insurer = exports.OfferedService = exports.ServiceOrderPart = exports.ServiceOrderObservation = exports.VisitResult = exports.ReminderTypeCompanyType = exports.PlanCompanyType = exports.WorkshopCompanyType = exports.CompanyCompanyType = exports.CompanyType = exports.PlanFeature = exports.CompanyFeature = exports.Feature = exports.UsageAlert = exports.SubscriptionAddonTemplate = exports.PaymentTransaction = 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 = void 0;
5
- exports.WorkshopReportInbox = exports.ObdCode = exports.VehicleMeasurement = exports.WorkshopEquipment = exports.EquipmentType = exports.CompanyAiUsage = exports.CompanyQuotaAdjustment = exports.VisitSearchHistory = exports.VisitAiAnalysis = exports.VisitSearchPerson = exports.VisitItemSearch = 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.ServicesOrderLite = exports.ServicesOrder = exports.Associates = exports.AssociateSectionFeature = exports.AttendanceMark = exports.WorkshopReader = exports.AssociateTag = exports.WorkshopTag = void 0;
4
+ exports.AssociateDailyStats = exports.WorkshopDailyStats = exports.WorkboardEvent = exports.ServiceOrderStage = exports.WorkboardStatus = exports.CompanyDiscount = exports.DiscountCode = exports.WorkshopDisplay = exports.WorkshopInsurer = exports.WorkshopOfferedService = exports.Insurer = exports.OfferedService = exports.WorkshopOutingRecipient = exports.ServiceOrderOuting = exports.ServiceOrderPart = exports.ServiceOrderObservation = exports.VisitResult = exports.ReminderTypeCompanyType = exports.PlanCompanyType = exports.WorkshopCompanyType = exports.CompanyCompanyType = exports.CompanyType = exports.PlanFeature = exports.CompanyFeature = exports.Feature = exports.UsageAlert = exports.SubscriptionAddonTemplate = exports.PaymentTransaction = 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 = void 0;
5
+ exports.WorkshopReportInbox = exports.ObdCode = exports.VehicleMeasurement = exports.WorkshopEquipment = exports.EquipmentType = exports.CompanyAiUsage = exports.CompanyQuotaAdjustment = exports.VisitSearchHistory = exports.VisitAiAnalysis = exports.VisitSearchPerson = exports.VisitItemSearch = 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.ServicesOrderLite = exports.ServicesOrder = exports.Associates = exports.AssociateSectionFeature = exports.AttendanceMark = exports.WorkshopReader = exports.AssociateTag = exports.WorkshopTag = exports.MetricEvent = exports.StageMetric = void 0;
6
6
  var Country_1 = require("./entities/Country");
7
7
  Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
8
8
  var WhatsappLine_1 = require("./entities/WhatsappLine");
@@ -188,6 +188,10 @@ var ServiceOrderObservation_1 = require("./entities/ServiceOrderObservation");
188
188
  Object.defineProperty(exports, "ServiceOrderObservation", { enumerable: true, get: function () { return ServiceOrderObservation_1.ServiceOrderObservation; } });
189
189
  var ServiceOrderPart_1 = require("./entities/ServiceOrderPart");
190
190
  Object.defineProperty(exports, "ServiceOrderPart", { enumerable: true, get: function () { return ServiceOrderPart_1.ServiceOrderPart; } });
191
+ var ServiceOrderOuting_1 = require("./entities/ServiceOrderOuting");
192
+ Object.defineProperty(exports, "ServiceOrderOuting", { enumerable: true, get: function () { return ServiceOrderOuting_1.ServiceOrderOuting; } });
193
+ var WorkshopOutingRecipient_1 = require("./entities/WorkshopOutingRecipient");
194
+ Object.defineProperty(exports, "WorkshopOutingRecipient", { enumerable: true, get: function () { return WorkshopOutingRecipient_1.WorkshopOutingRecipient; } });
191
195
  var OfferedService_1 = require("./entities/OfferedService");
192
196
  Object.defineProperty(exports, "OfferedService", { enumerable: true, get: function () { return OfferedService_1.OfferedService; } });
193
197
  var Insurer_1 = require("./entities/Insurer");
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from "./rules/parts.rules";
24
24
  export * from "./rules/offered.service.rules";
25
25
  export * from "./rules/visit.history.rules";
26
26
  export * from "./rules/equipment.rules";
27
+ export * from "./rules/outing.rules";
27
28
  export declare function createDataBaseSource(): DataSource;
28
29
  export declare function showEntityName<T extends ObjectLiteral>(entity: EntityTarget<T>): Promise<Repository<T>>;
29
30
  export declare function callStoredProcedureName(storedProcedure: any, elements: any): Promise<any>;
package/dist/index.js CHANGED
@@ -124,6 +124,8 @@ __exportStar(require("./rules/offered.service.rules"), exports);
124
124
  __exportStar(require("./rules/visit.history.rules"), exports);
125
125
  // DOC: Mediciones de equipos (sql/81): formato de cada lectura, estado sugerido, VIN y cupo.
126
126
  __exportStar(require("./rules/equipment.rules"), exports);
127
+ // DOC: Salida temporal (sql/84): sección de ingreso/salida, días afuera y el aviso periódico.
128
+ __exportStar(require("./rules/outing.rules"), exports);
127
129
  let connection = null;
128
130
  // DOC: Inicialización en curso. Se memoriza la PROMESA y no el resultado porque el patrón
129
131
  // "si no está inicializada, inicialízala" tiene una carrera en el arranque en frío: dos
@@ -24,6 +24,7 @@ export declare const REPORT_KEY: {
24
24
  readonly STATUS: "status";
25
25
  readonly PROMISED: "promised";
26
26
  readonly SATISFACTION: "satisfaction";
27
+ readonly OUTING: "outing";
27
28
  readonly REMINDERS: "reminders";
28
29
  readonly CLIENTS: "clients";
29
30
  readonly MONEY: "money";
@@ -31,6 +31,8 @@ exports.REPORT_KEY = {
31
31
  STATUS: "status",
32
32
  PROMISED: "promised",
33
33
  SATISFACTION: "satisfaction",
34
+ // DOC: Salida temporal y demora de repuestos (sql/84). Para todos los planes.
35
+ OUTING: "outing",
34
36
  REMINDERS: "reminders",
35
37
  CLIENTS: "clients",
36
38
  MONEY: "money",
@@ -47,6 +49,7 @@ exports.REPORT_CATALOG = {
47
49
  status: { permission: exports.REPORT_PERMISSION.VISITS, feature: null },
48
50
  promised: { permission: exports.REPORT_PERMISSION.VISITS, feature: null },
49
51
  satisfaction: { permission: exports.REPORT_PERMISSION.VISITS, feature: null },
52
+ outing: { permission: exports.REPORT_PERMISSION.VISITS, feature: null },
50
53
  reminders: { permission: exports.REPORT_PERMISSION.VISITS, feature: null },
51
54
  clients: { permission: exports.REPORT_PERMISSION.VISITS, feature: null },
52
55
  money: { permission: exports.REPORT_PERMISSION.MONEY, feature: null },
@@ -0,0 +1,52 @@
1
+ /**
2
+ * DOC: Qué papel cumple una sección en la salida temporal (`section.details.outing_role`).
3
+ *
4
+ * Al sacar el vehículo se agrega a la visita una COPIA de la sección de salida, y al reingresarlo
5
+ * una de la de ingreso. Va en `details` y no en una columna, igual que `workboard_stage`.
6
+ */
7
+ export declare const OUTING_ROLE: {
8
+ /** La sección de ingreso: su copia es el «Reingreso». */
9
+ readonly ENTRY: 1;
10
+ /** La sección de salida: su copia es la «Salida temporal». La original queda para la entrega final. */
11
+ readonly EXIT: 2;
12
+ };
13
+ export type TOutingRole = (typeof OUTING_ROLE)[keyof typeof OUTING_ROLE];
14
+ export interface ISectionOutingDetails {
15
+ outing_role?: TOutingRole | number | null;
16
+ }
17
+ /** DOC: El papel de la sección, o `null` si no es de ingreso ni de salida. */
18
+ export declare const getOutingRole: (details: ISectionOutingDetails | null | undefined) => TOutingRole | null;
19
+ export declare const withOutingRole: <T extends object>(details: T | null | undefined, role: TOutingRole | null) => (T & ISectionOutingDetails) | null;
20
+ /**
21
+ * DOC: La sección de la plantilla que se copia para ese papel: la PRIMERA activa en orden. Si el
22
+ * taller marcó dos como de salida, gana la primera; sin ninguna, `null` y el vehículo no se puede
23
+ * sacar hasta configurar la plantilla.
24
+ */
25
+ export declare const findOutingSection: <T extends {
26
+ details?: ISectionOutingDetails | null;
27
+ order?: number;
28
+ status?: number;
29
+ }>(sections: T[], role: TOutingRole) => T | null;
30
+ export declare const outsideDays: (leftAt: Date | string, now?: Date) => number;
31
+ /**
32
+ * DOC: El aviso periódico de vehículos afuera (`workshop.details.outing_report`). Quiénes lo
33
+ * reciben van en `workshop_outing_recipient`; acá solo cada cuánto y cuándo salió el último.
34
+ */
35
+ export interface IOutingReportSettings {
36
+ every_days?: number | null;
37
+ last_sent_at?: string | null;
38
+ }
39
+ export declare const OUTING_REPORT_MIN_DAYS = 1;
40
+ export declare const OUTING_REPORT_MAX_DAYS = 30;
41
+ /** DOC: Cada cuántos días, o `null` si está apagado o el valor guardado no sirve. */
42
+ export declare const getOutingReportDays: (details: {
43
+ outing_report?: IOutingReportSettings | null;
44
+ } | null | undefined) => number | null;
45
+ export declare const withOutingReportDays: <T extends {
46
+ outing_report?: IOutingReportSettings | null;
47
+ }>(details: T | null | undefined, days: number | null) => T;
48
+ /**
49
+ * DOC: ¿Ya toca mandar el aviso? Sin envío anterior, sí. Se compara con medio día de holgura: el
50
+ * job corre una vez al día y, si un día corrió unos minutos antes, no debe saltarse el aviso.
51
+ */
52
+ export declare const isOutingReportDue: (settings: IOutingReportSettings | null | undefined, now?: Date) => boolean;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ // DOC: Reglas de la SALIDA TEMPORAL (sql/84): el vehículo se va del taller con la visita abierta
3
+ // (en pausa) y vuelve con un reingreso. Módulo PURO, como `workboard.rules.ts`: el API las
4
+ // hace cumplir y los fronts las usan para pintar.
5
+ //
6
+ // ⚠️ Importarlo desde el módulo hoja en los fronts:
7
+ // import { OUTING_ROLE } from "@asumano/worklip-typeorm-db/dist/rules/outing.rules";
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.isOutingReportDue = exports.withOutingReportDays = exports.getOutingReportDays = exports.OUTING_REPORT_MAX_DAYS = exports.OUTING_REPORT_MIN_DAYS = exports.outsideDays = exports.findOutingSection = exports.withOutingRole = exports.getOutingRole = exports.OUTING_ROLE = void 0;
10
+ /**
11
+ * DOC: Qué papel cumple una sección en la salida temporal (`section.details.outing_role`).
12
+ *
13
+ * Al sacar el vehículo se agrega a la visita una COPIA de la sección de salida, y al reingresarlo
14
+ * una de la de ingreso. Va en `details` y no en una columna, igual que `workboard_stage`.
15
+ */
16
+ exports.OUTING_ROLE = {
17
+ /** La sección de ingreso: su copia es el «Reingreso». */
18
+ ENTRY: 1,
19
+ /** La sección de salida: su copia es la «Salida temporal». La original queda para la entrega final. */
20
+ EXIT: 2,
21
+ };
22
+ /** DOC: El papel de la sección, o `null` si no es de ingreso ni de salida. */
23
+ const getOutingRole = (details) => {
24
+ const role = Number(details?.outing_role);
25
+ return role === exports.OUTING_ROLE.ENTRY || role === exports.OUTING_ROLE.EXIT ? role : null;
26
+ };
27
+ exports.getOutingRole = getOutingRole;
28
+ // DOC: Espejo de `withWorkboardStage`: deja `details` listo para guardar sin pisar lo demás, y
29
+ // devuelve `null` si queda vacío para no dejar `{}` en la base.
30
+ const withOutingRole = (details, role) => {
31
+ const next = { ...(details ?? {}) };
32
+ if (role === exports.OUTING_ROLE.ENTRY || role === exports.OUTING_ROLE.EXIT)
33
+ next.outing_role = role;
34
+ else
35
+ delete next.outing_role;
36
+ return Object.keys(next).length > 0 ? next : null;
37
+ };
38
+ exports.withOutingRole = withOutingRole;
39
+ /**
40
+ * DOC: La sección de la plantilla que se copia para ese papel: la PRIMERA activa en orden. Si el
41
+ * taller marcó dos como de salida, gana la primera; sin ninguna, `null` y el vehículo no se puede
42
+ * sacar hasta configurar la plantilla.
43
+ */
44
+ const findOutingSection = (sections, role) => [...sections]
45
+ .filter((section) => section.status !== 0 && (0, exports.getOutingRole)(section.details) === role)
46
+ .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))[0] ?? null;
47
+ exports.findOutingSection = findOutingSection;
48
+ // DOC: Cuántos días lleva afuera, contados por días completos. Medio día afuera es 0: lo que el
49
+ // taller pregunta es «¿cuántos días lleva?», no las horas.
50
+ const outsideDays = (leftAt, now = new Date()) => Math.max(0, Math.floor((now.getTime() - new Date(leftAt).getTime()) / 86400000));
51
+ exports.outsideDays = outsideDays;
52
+ exports.OUTING_REPORT_MIN_DAYS = 1;
53
+ exports.OUTING_REPORT_MAX_DAYS = 30;
54
+ /** DOC: Cada cuántos días, o `null` si está apagado o el valor guardado no sirve. */
55
+ const getOutingReportDays = (details) => {
56
+ const days = Number(details?.outing_report?.every_days);
57
+ return Number.isInteger(days) && days >= exports.OUTING_REPORT_MIN_DAYS && days <= exports.OUTING_REPORT_MAX_DAYS
58
+ ? days
59
+ : null;
60
+ };
61
+ exports.getOutingReportDays = getOutingReportDays;
62
+ // DOC: Deja `details` de la sede con la frecuencia nueva sin pisar lo demás. `null` lo apaga y
63
+ // conserva `last_sent_at`, para que volver a prenderlo no dispare un aviso inmediato de más.
64
+ const withOutingReportDays = (details, days) => {
65
+ const valid = (0, exports.getOutingReportDays)({ outing_report: { every_days: days } });
66
+ return {
67
+ ...(details ?? {}),
68
+ outing_report: { ...(details?.outing_report ?? {}), every_days: valid },
69
+ };
70
+ };
71
+ exports.withOutingReportDays = withOutingReportDays;
72
+ /**
73
+ * DOC: ¿Ya toca mandar el aviso? Sin envío anterior, sí. Se compara con medio día de holgura: el
74
+ * job corre una vez al día y, si un día corrió unos minutos antes, no debe saltarse el aviso.
75
+ */
76
+ const isOutingReportDue = (settings, now = new Date()) => {
77
+ const days = (0, exports.getOutingReportDays)({ outing_report: settings });
78
+ if (!days)
79
+ return false;
80
+ if (!settings?.last_sent_at)
81
+ return true;
82
+ const last = new Date(settings.last_sent_at).getTime();
83
+ if (Number.isNaN(last))
84
+ return true;
85
+ return now.getTime() - last >= days * 86400000 - 43200000;
86
+ };
87
+ exports.isOutingReportDue = isOutingReportDue;
@@ -75,6 +75,18 @@ export interface IVisitSection {
75
75
  * la plantilla: cambiar la bandera después no reescribe el porcentaje de una visita cerrada.
76
76
  */
77
77
  no_checklist?: boolean;
78
+ /**
79
+ * DOC: Esta sección es la COPIA que agregó una salida temporal (sql/84): «Salida temporal N» o
80
+ * «Reingreso N». La pone el API, nunca el navegador. `role` es OUTING_ROLE (1 ingreso, 2
81
+ * salida), `number` la salida a la que pertenece y `outing` el id de `service_order_outing`.
82
+ */
83
+ outing?: IVisitSectionOuting | null;
84
+ }
85
+ export interface IVisitSectionOuting {
86
+ role: 1 | 2;
87
+ number: number;
88
+ outing: number;
89
+ source: number;
78
90
  }
79
91
  export interface IVisitSignature {
80
92
  image: string;
@@ -25,6 +25,11 @@ export declare const WORKBOARD_STATUS_KIND: {
25
25
  readonly DELIVERED: 6;
26
26
  /** Personalizado. Lo que el taller invente entre medias. Este sí se borra. */
27
27
  readonly CUSTOM: 7;
28
+ /**
29
+ * Fuera del taller (sql/84). Salida temporal: la visita está en pausa y no cuenta tiempo.
30
+ * ⚠️ Es mayor que 4 pero NO es una columna final: usar `isFinalWorkboardKind`, no `kind >= 4`.
31
+ */
32
+ readonly OUTSIDE: 8;
28
33
  };
29
34
  export type TWorkboardStatusKind = (typeof WORKBOARD_STATUS_KIND)[keyof typeof WORKBOARD_STATUS_KIND];
30
35
  /**
@@ -32,6 +37,12 @@ export type TWorkboardStatusKind = (typeof WORKBOARD_STATUS_KIND)[keyof typeof W
32
37
  * `CUSTOM` no está: ese lo crea el taller.
33
38
  */
34
39
  export declare const SEEDED_WORKBOARD_KINDS: readonly TWorkboardStatusKind[];
40
+ /**
41
+ * DOC: ¿Es una columna de cierre (Finalizado, Por entregar, Entregado o una del taller después
42
+ * de ellas)? Reemplaza al `kind >= FINISHED` de antes, que con «Fuera del taller» (8) la habría
43
+ * tratado como final: etapa 1000+ y escondida del tablero al día siguiente.
44
+ */
45
+ export declare const isFinalWorkboardKind: (kind: number) => boolean;
35
46
  /**
36
47
  * DOC: El estado del trabajo en una etapa (`service_order_stage.state`).
37
48
  *
@@ -12,7 +12,7 @@
12
12
  // Desde el barrel arrastra TypeORM, dotenv y `crypto` al navegador y rompe el build de
13
13
  // producción. El typecheck NO lo detecta: solo `pnpm build`.
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.nextStageAfter = exports.canMoveStage = exports.withWorkboardStage = exports.isWorkboardStage = exports.isFinalStageOrder = exports.finalStageOrder = exports.FINAL_STAGE_ORDER_OFFSET = exports.WORKBOARD_SOURCE = exports.WORKBOARD_EVENT_TYPE = exports.VISIBLE_STAGE_STATES = exports.STAGE_STATE = exports.SEEDED_WORKBOARD_KINDS = exports.WORKBOARD_STATUS_KIND = void 0;
15
+ exports.nextStageAfter = exports.canMoveStage = exports.withWorkboardStage = exports.isWorkboardStage = exports.isFinalStageOrder = exports.finalStageOrder = exports.FINAL_STAGE_ORDER_OFFSET = exports.WORKBOARD_SOURCE = exports.WORKBOARD_EVENT_TYPE = exports.VISIBLE_STAGE_STATES = exports.STAGE_STATE = exports.isFinalWorkboardKind = exports.SEEDED_WORKBOARD_KINDS = exports.WORKBOARD_STATUS_KIND = void 0;
16
16
  /**
17
17
  * DOC: La semántica de sistema de una columna del tablero (`workboard_status.kind`).
18
18
  *
@@ -40,6 +40,11 @@ exports.WORKBOARD_STATUS_KIND = {
40
40
  DELIVERED: 6,
41
41
  /** Personalizado. Lo que el taller invente entre medias. Este sí se borra. */
42
42
  CUSTOM: 7,
43
+ /**
44
+ * Fuera del taller (sql/84). Salida temporal: la visita está en pausa y no cuenta tiempo.
45
+ * ⚠️ Es mayor que 4 pero NO es una columna final: usar `isFinalWorkboardKind`, no `kind >= 4`.
46
+ */
47
+ OUTSIDE: 8,
43
48
  };
44
49
  /**
45
50
  * DOC: Los `kind` que se siembran al crear un taller, en el orden en que quedan las columnas.
@@ -52,7 +57,15 @@ exports.SEEDED_WORKBOARD_KINDS = [
52
57
  exports.WORKBOARD_STATUS_KIND.FINISHED,
53
58
  exports.WORKBOARD_STATUS_KIND.READY,
54
59
  exports.WORKBOARD_STATUS_KIND.DELIVERED,
60
+ exports.WORKBOARD_STATUS_KIND.OUTSIDE,
55
61
  ];
62
+ /**
63
+ * DOC: ¿Es una columna de cierre (Finalizado, Por entregar, Entregado o una del taller después
64
+ * de ellas)? Reemplaza al `kind >= FINISHED` de antes, que con «Fuera del taller» (8) la habría
65
+ * tratado como final: etapa 1000+ y escondida del tablero al día siguiente.
66
+ */
67
+ const isFinalWorkboardKind = (kind) => kind >= exports.WORKBOARD_STATUS_KIND.FINISHED && kind !== exports.WORKBOARD_STATUS_KIND.OUTSIDE;
68
+ exports.isFinalWorkboardKind = isFinalWorkboardKind;
56
69
  /**
57
70
  * DOC: El estado del trabajo en una etapa (`service_order_stage.state`).
58
71
  *
@@ -74,6 +74,7 @@ export declare class ServicesOrder {
74
74
  insurer_name: string | null;
75
75
  insurer_details: any | null;
76
76
  claim_number: string | null;
77
+ outside_since: Date | null;
77
78
  history_count: number;
78
79
  reminder_count: number;
79
80
  }
@@ -314,6 +314,10 @@ __decorate([
314
314
  (0, typeorm_1.ViewColumn)(),
315
315
  __metadata("design:type", Object)
316
316
  ], ServicesOrder.prototype, "claim_number", void 0);
317
+ __decorate([
318
+ (0, typeorm_1.ViewColumn)(),
319
+ __metadata("design:type", Object)
320
+ ], ServicesOrder.prototype, "outside_since", void 0);
317
321
  __decorate([
318
322
  (0, typeorm_1.ViewColumn)(),
319
323
  __metadata("design:type", Number)
@@ -67,4 +67,5 @@ export declare class ServicesOrderLite {
67
67
  reinspection_of: number | null;
68
68
  insurer: number | null;
69
69
  claim_number: string | null;
70
+ outside_since: Date | null;
70
71
  }
@@ -292,6 +292,10 @@ __decorate([
292
292
  (0, typeorm_1.ViewColumn)(),
293
293
  __metadata("design:type", Object)
294
294
  ], ServicesOrderLite.prototype, "claim_number", void 0);
295
+ __decorate([
296
+ (0, typeorm_1.ViewColumn)(),
297
+ __metadata("design:type", Object)
298
+ ], ServicesOrderLite.prototype, "outside_since", void 0);
295
299
  exports.ServicesOrderLite = ServicesOrderLite = __decorate([
296
300
  (0, typeorm_1.ViewEntity)({
297
301
  name: "services_order_lite",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asumano/worklip-typeorm-db",
3
- "version": "1.1.106",
3
+ "version": "1.1.107",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },