@asumano/worklip-typeorm-db 1.1.107 → 1.1.109

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.
Files changed (48) hide show
  1. package/dist/entities/Associate.d.ts +4 -0
  2. package/dist/entities/Associate.js +29 -0
  3. package/dist/entities/AssociatePayRate.d.ts +10 -0
  4. package/dist/entities/AssociatePayRate.js +79 -0
  5. package/dist/entities/GlobalSection.d.ts +1 -0
  6. package/dist/entities/GlobalSection.js +8 -0
  7. package/dist/entities/GlobalTemplateSection.d.ts +1 -0
  8. package/dist/entities/GlobalTemplateSection.js +8 -0
  9. package/dist/entities/JobTitle.d.ts +11 -0
  10. package/dist/entities/JobTitle.js +84 -0
  11. package/dist/entities/PayrollMonthDays.d.ts +10 -0
  12. package/dist/entities/PayrollMonthDays.js +83 -0
  13. package/dist/entities/Section.d.ts +1 -0
  14. package/dist/entities/Section.js +8 -0
  15. package/dist/entities/ServiceOrder.d.ts +8 -0
  16. package/dist/entities/ServiceOrder.js +81 -0
  17. package/dist/entities/ServiceOrderApproval.d.ts +7 -0
  18. package/dist/entities/ServiceOrderApproval.js +63 -0
  19. package/dist/entities/ServiceOrderStage.d.ts +10 -0
  20. package/dist/entities/ServiceOrderStage.js +102 -0
  21. package/dist/entities/TemplateSection.d.ts +1 -0
  22. package/dist/entities/TemplateSection.js +8 -0
  23. package/dist/entities/VisitItemSearch.js +1 -1
  24. package/dist/entities/WorkshopInsurer.d.ts +4 -0
  25. package/dist/entities/WorkshopInsurer.js +40 -0
  26. package/dist/entities.index.d.ts +3 -0
  27. package/dist/entities.index.js +7 -1
  28. package/dist/index.d.ts +4 -0
  29. package/dist/index.js +6 -0
  30. package/dist/rules/associate.profile.rules.d.ts +31 -0
  31. package/dist/rules/associate.profile.rules.js +71 -0
  32. package/dist/rules/badge.card.rules.d.ts +74 -0
  33. package/dist/rules/badge.card.rules.js +125 -0
  34. package/dist/rules/estimate.time.rules.d.ts +24 -0
  35. package/dist/rules/estimate.time.rules.js +56 -0
  36. package/dist/rules/feature.codes.d.ts +1 -0
  37. package/dist/rules/feature.codes.js +2 -0
  38. package/dist/rules/outing.rules.d.ts +10 -13
  39. package/dist/rules/outing.rules.js +13 -24
  40. package/dist/rules/payroll.rules.d.ts +79 -0
  41. package/dist/rules/payroll.rules.js +159 -0
  42. package/dist/rules/template.settings.d.ts +11 -1
  43. package/dist/rules/template.settings.js +52 -15
  44. package/dist/rules/visit.history.rules.d.ts +1 -0
  45. package/dist/rules/visit.history.rules.js +3 -1
  46. package/dist/rules/visit.summary.d.ts +69 -1
  47. package/dist/rules/visit.summary.js +128 -4
  48. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { AssociatePasswordReset, AssociatePermission, Region } from "../entities
2
2
  import { AssociateSession } from "./AssociateSession";
3
3
  import { City } from "./City";
4
4
  import { Company } from "./Company";
5
+ import { JobTitle } from "./JobTitle";
5
6
  import { Reminder } from "./Reminder";
6
7
  import { ServiceOrderHistory } from "./ServiceOrderHistory";
7
8
  import { Workshop } from "./Workshop";
@@ -17,6 +18,9 @@ export declare class Associate {
17
18
  region: Region | null;
18
19
  city: City | null;
19
20
  address: string | null;
21
+ photo: string | null;
22
+ blood_type: number | null;
23
+ job_title: JobTitle | null;
20
24
  password: string;
21
25
  details: any | null;
22
26
  created: Date;
@@ -15,6 +15,7 @@ const entities_views_routes_1 = require("../entities.views.routes");
15
15
  const AssociateSession_1 = require("./AssociateSession");
16
16
  const City_1 = require("./City");
17
17
  const Company_1 = require("./Company");
18
+ const JobTitle_1 = require("./JobTitle");
18
19
  const Reminder_1 = require("./Reminder");
19
20
  const ServiceOrderHistory_1 = require("./ServiceOrderHistory");
20
21
  const Workshop_1 = require("./Workshop");
@@ -112,6 +113,34 @@ __decorate([
112
113
  }),
113
114
  __metadata("design:type", Object)
114
115
  ], Associate.prototype, "address", void 0);
116
+ __decorate([
117
+ (0, typeorm_1.Column)({
118
+ nullable: true,
119
+ default: null,
120
+ type: "varchar",
121
+ length: 255,
122
+ comment: "Llave en R2 de la foto sin fondo (PNG). NULL: sin foto, se muestran las iniciales.",
123
+ }),
124
+ __metadata("design:type", Object)
125
+ ], Associate.prototype, "photo", void 0);
126
+ __decorate([
127
+ (0, typeorm_1.Column)({
128
+ nullable: true,
129
+ default: null,
130
+ type: "int",
131
+ comment: "Tipo de sangre (dato sensible). 1: O+, 2: O-, 3: A+, 4: A-, 5: B+, 6: B-, 7: AB+, 8: AB-. NULL: sin dato.",
132
+ }),
133
+ __metadata("design:type", Object)
134
+ ], Associate.prototype, "blood_type", void 0);
135
+ __decorate([
136
+ (0, typeorm_1.ManyToOne)(() => JobTitle_1.JobTitle, {
137
+ nullable: true,
138
+ onDelete: "SET NULL",
139
+ onUpdate: "NO ACTION",
140
+ }),
141
+ (0, typeorm_1.JoinColumn)({ name: "job_title" }),
142
+ __metadata("design:type", Object)
143
+ ], Associate.prototype, "job_title", void 0);
115
144
  __decorate([
116
145
  (0, typeorm_1.Column)({
117
146
  type: "varchar",
@@ -0,0 +1,10 @@
1
+ import { Associate } from "./Associate";
2
+ export declare class AssociatePayRate {
3
+ associate_id: number;
4
+ associate: Associate;
5
+ pay_unit: number;
6
+ amount: string;
7
+ updated_by: Associate | null;
8
+ created: Date;
9
+ updated: Date | null;
10
+ }
@@ -0,0 +1,79 @@
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.AssociatePayRate = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Associate_1 = require("./Associate");
15
+ // DOC: Tarifa de nómina del empleado (sql/93, funcionalidad PAYROLL). Tabla aparte del usuario para que
16
+ // el sueldo no viaje en ninguna consulta de `associate`: solo la lee quien tiene MANAGE_PAYROLL.
17
+ let AssociatePayRate = class AssociatePayRate {
18
+ };
19
+ exports.AssociatePayRate = AssociatePayRate;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryColumn)({ type: "int", name: "associate" }),
22
+ __metadata("design:type", Number)
23
+ ], AssociatePayRate.prototype, "associate_id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.OneToOne)(() => Associate_1.Associate, {
26
+ onDelete: "CASCADE",
27
+ onUpdate: "NO ACTION",
28
+ }),
29
+ (0, typeorm_1.JoinColumn)({ name: "associate" }),
30
+ __metadata("design:type", Associate_1.Associate)
31
+ ], AssociatePayRate.prototype, "associate", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({
34
+ type: "int",
35
+ comment: "Cómo se le paga.\n1: Por hora.\n2: Por día (no sale de las visitas: se cuentan los días trabajados).\n3: Por pieza o trabajo.",
36
+ }),
37
+ __metadata("design:type", Number)
38
+ ], AssociatePayRate.prototype, "pay_unit", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({
41
+ type: "decimal",
42
+ precision: 14,
43
+ scale: 2,
44
+ comment: "Valor por unidad, en la moneda del país de la empresa.",
45
+ }),
46
+ __metadata("design:type", String)
47
+ ], AssociatePayRate.prototype, "amount", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
50
+ onDelete: "SET NULL",
51
+ onUpdate: "NO ACTION",
52
+ nullable: true,
53
+ }),
54
+ (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
55
+ __metadata("design:type", Object)
56
+ ], AssociatePayRate.prototype, "updated_by", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({
59
+ type: "datetime",
60
+ comment: "Fecha de creación del registro.",
61
+ default: () => "CURRENT_TIMESTAMP",
62
+ }),
63
+ __metadata("design:type", Date)
64
+ ], AssociatePayRate.prototype, "created", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({
67
+ type: "datetime",
68
+ nullable: true,
69
+ default: null,
70
+ comment: "Fecha de actualización del registro.",
71
+ onUpdate: "CURRENT_TIMESTAMP",
72
+ }),
73
+ __metadata("design:type", Object)
74
+ ], AssociatePayRate.prototype, "updated", void 0);
75
+ exports.AssociatePayRate = AssociatePayRate = __decorate([
76
+ (0, typeorm_1.Entity)("associate_pay_rate", {
77
+ comment: "Tarifa de nómina de cada empleado (funcionalidad PAYROLL). Solo informativa.",
78
+ })
79
+ ], AssociatePayRate);
@@ -11,6 +11,7 @@ export declare class GlobalSection {
11
11
  created_by: Master;
12
12
  updated: Date | null;
13
13
  updated_by: Master | null;
14
+ labor_type: number;
14
15
  status: number;
15
16
  global_section_items: GlobalSectionItem[];
16
17
  global_template_sections: GlobalTemplateSection[];
@@ -97,6 +97,14 @@ __decorate([
97
97
  (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
98
98
  __metadata("design:type", Object)
99
99
  ], GlobalSection.prototype, "updated_by", void 0);
100
+ __decorate([
101
+ (0, typeorm_1.Column)({
102
+ default: 1,
103
+ type: "int",
104
+ comment: "Tipo de mano de obra (se copia a la sección del taller).\n1: Carrocería / mecánica (valor hora).\n2: Pintura (valor hora de pintura, si la aseguradora tiene otro).",
105
+ }),
106
+ __metadata("design:type", Number)
107
+ ], GlobalSection.prototype, "labor_type", void 0);
100
108
  __decorate([
101
109
  (0, typeorm_1.Column)({
102
110
  default: 1,
@@ -11,4 +11,5 @@ export declare class GlobalTemplateSection {
11
11
  updated: Date | null;
12
12
  updated_by: Master | null;
13
13
  status: number;
14
+ outing_role: number;
14
15
  }
@@ -94,6 +94,14 @@ __decorate([
94
94
  }),
95
95
  __metadata("design:type", Number)
96
96
  ], GlobalTemplateSection.prototype, "status", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.Column)({
99
+ default: 0,
100
+ type: "int",
101
+ comment: "Papel de la sección en la salida temporal DENTRO de esta plantilla global.\n0: Ninguno.\n1: Ingreso (su copia es el reingreso).\n2: Salida (su copia es la salida temporal).",
102
+ }),
103
+ __metadata("design:type", Number)
104
+ ], GlobalTemplateSection.prototype, "outing_role", void 0);
97
105
  exports.GlobalTemplateSection = GlobalTemplateSection = __decorate([
98
106
  (0, typeorm_1.Entity)({
99
107
  comment: "Enlace entre plantilla global y sección global.",
@@ -0,0 +1,11 @@
1
+ import { Associate } from "./Associate";
2
+ import { Company } from "./Company";
3
+ export declare class JobTitle {
4
+ id: number;
5
+ company: Company;
6
+ name: string;
7
+ status: number;
8
+ created_by: Associate | null;
9
+ created: Date;
10
+ updated: Date | null;
11
+ }
@@ -0,0 +1,84 @@
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.JobTitle = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Associate_1 = require("./Associate");
15
+ const Company_1 = require("./Company");
16
+ // DOC: Cargos de los empleados (sql/85). Por empresa y distintos de los roles de permisos.
17
+ let JobTitle = class JobTitle {
18
+ };
19
+ exports.JobTitle = JobTitle;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)({
22
+ type: "int",
23
+ comment: "Número de identificación (ID) único de cada registro.",
24
+ }),
25
+ __metadata("design:type", Number)
26
+ ], JobTitle.prototype, "id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.ManyToOne)(() => Company_1.Company, {
29
+ onDelete: "CASCADE",
30
+ onUpdate: "NO ACTION",
31
+ }),
32
+ (0, typeorm_1.JoinColumn)({ name: "company" }),
33
+ __metadata("design:type", Company_1.Company)
34
+ ], JobTitle.prototype, "company", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({
37
+ type: "varchar",
38
+ length: 60,
39
+ comment: "Nombre del cargo (Mecánico, Pintor...).",
40
+ }),
41
+ __metadata("design:type", String)
42
+ ], JobTitle.prototype, "name", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({
45
+ default: 1,
46
+ type: "int",
47
+ comment: "1: activo, 0: inactivo (no se ofrece al editar usuarios).",
48
+ }),
49
+ __metadata("design:type", Number)
50
+ ], JobTitle.prototype, "status", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
53
+ nullable: true,
54
+ onDelete: "SET NULL",
55
+ onUpdate: "NO ACTION",
56
+ }),
57
+ (0, typeorm_1.JoinColumn)({ name: "created_by" }),
58
+ __metadata("design:type", Object)
59
+ ], JobTitle.prototype, "created_by", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({
62
+ type: "datetime",
63
+ comment: "Fecha de creación del registro.",
64
+ default: () => "CURRENT_TIMESTAMP",
65
+ }),
66
+ __metadata("design:type", Date)
67
+ ], JobTitle.prototype, "created", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({
70
+ type: "datetime",
71
+ nullable: true,
72
+ default: null,
73
+ comment: "Fecha de actualización del registro.",
74
+ onUpdate: "CURRENT_TIMESTAMP",
75
+ }),
76
+ __metadata("design:type", Object)
77
+ ], JobTitle.prototype, "updated", void 0);
78
+ exports.JobTitle = JobTitle = __decorate([
79
+ (0, typeorm_1.Unique)("UQ_job_title_company_name", ["company", "name"]),
80
+ (0, typeorm_1.Index)("IDX_job_title_company_status", ["company", "status"]),
81
+ (0, typeorm_1.Entity)("job_title", {
82
+ comment: "Cargos de los empleados, por empresa.",
83
+ })
84
+ ], JobTitle);
@@ -0,0 +1,10 @@
1
+ import { Associate } from "./Associate";
2
+ export declare class PayrollMonthDays {
3
+ id: number;
4
+ associate: Associate;
5
+ month: string;
6
+ days: string;
7
+ updated_by: Associate | null;
8
+ created: Date;
9
+ updated: Date | null;
10
+ }
@@ -0,0 +1,83 @@
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.PayrollMonthDays = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Associate_1 = require("./Associate");
15
+ // DOC: Días trabajados en el mes, escritos a mano en el reporte de nómina (sql/93), para el que gana por día.
16
+ // Si existe, reemplaza el conteo de la asistencia.
17
+ let PayrollMonthDays = class PayrollMonthDays {
18
+ };
19
+ exports.PayrollMonthDays = PayrollMonthDays;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)({
22
+ type: "int",
23
+ comment: "Número de identificación (ID) único de cada registro.",
24
+ }),
25
+ __metadata("design:type", Number)
26
+ ], PayrollMonthDays.prototype, "id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
29
+ onDelete: "CASCADE",
30
+ onUpdate: "NO ACTION",
31
+ }),
32
+ (0, typeorm_1.JoinColumn)({ name: "associate" }),
33
+ __metadata("design:type", Associate_1.Associate)
34
+ ], PayrollMonthDays.prototype, "associate", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({
37
+ type: "date",
38
+ comment: "Mes, guardado como su primer día (AAAA-MM-01).",
39
+ }),
40
+ __metadata("design:type", String)
41
+ ], PayrollMonthDays.prototype, "month", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({
44
+ type: "decimal",
45
+ precision: 4,
46
+ scale: 1,
47
+ comment: "Días trabajados en el mes. Reemplaza el conteo de la asistencia.",
48
+ }),
49
+ __metadata("design:type", String)
50
+ ], PayrollMonthDays.prototype, "days", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.ManyToOne)(() => Associate_1.Associate, {
53
+ onDelete: "SET NULL",
54
+ onUpdate: "NO ACTION",
55
+ nullable: true,
56
+ }),
57
+ (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
58
+ __metadata("design:type", Object)
59
+ ], PayrollMonthDays.prototype, "updated_by", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({
62
+ type: "datetime",
63
+ comment: "Fecha de creación del registro.",
64
+ default: () => "CURRENT_TIMESTAMP",
65
+ }),
66
+ __metadata("design:type", Date)
67
+ ], PayrollMonthDays.prototype, "created", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({
70
+ type: "datetime",
71
+ nullable: true,
72
+ default: null,
73
+ comment: "Fecha de actualización del registro.",
74
+ onUpdate: "CURRENT_TIMESTAMP",
75
+ }),
76
+ __metadata("design:type", Object)
77
+ ], PayrollMonthDays.prototype, "updated", void 0);
78
+ exports.PayrollMonthDays = PayrollMonthDays = __decorate([
79
+ (0, typeorm_1.Unique)("UQ_payroll_month_days", ["associate", "month"]),
80
+ (0, typeorm_1.Entity)("payroll_month_days", {
81
+ comment: "Días trabajados por mes de los empleados que ganan por día, escritos en el reporte de nómina.",
82
+ })
83
+ ], PayrollMonthDays);
@@ -14,6 +14,7 @@ export declare class Section {
14
14
  created_by: Associate;
15
15
  updated: Date | null;
16
16
  updated_by: Associate | null;
17
+ labor_type: number;
17
18
  status: number;
18
19
  section_items: SectionItem[];
19
20
  template_sections: TemplateSection[];
@@ -114,6 +114,14 @@ __decorate([
114
114
  (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
115
115
  __metadata("design:type", Object)
116
116
  ], Section.prototype, "updated_by", void 0);
117
+ __decorate([
118
+ (0, typeorm_1.Column)({
119
+ default: 1,
120
+ type: "int",
121
+ comment: "Tipo de mano de obra, para el valor hora de la aseguradora.\n1: Carrocería / mecánica (valor hora).\n2: Pintura (valor hora de pintura, si la aseguradora tiene otro).",
122
+ }),
123
+ __metadata("design:type", Number)
124
+ ], Section.prototype, "labor_type", void 0);
117
125
  __decorate([
118
126
  (0, typeorm_1.Column)({
119
127
  default: 1,
@@ -39,6 +39,10 @@ export declare class ServiceOrder {
39
39
  workboard_status: WorkboardStatus | null;
40
40
  workboard_changed: Date | null;
41
41
  promised_date: Date | null;
42
+ estimated_hours: number | null;
43
+ estimated_unit: number | null;
44
+ initial_estimated_hours: number | null;
45
+ initial_estimated_unit: number | null;
42
46
  /**
43
47
  * DOC: LA CALIFICACIÓN DEL CLIENTE. La deja él mismo desde su informe público, cuando ya
44
48
  * recibió el vehículo, y solo si la plantilla de la visita la pide
@@ -60,6 +64,10 @@ export declare class ServiceOrder {
60
64
  reinspection_of: ServiceOrder | null;
61
65
  insurer: Insurer | null;
62
66
  claim_number: string | null;
67
+ deductible_type: number;
68
+ deductible_percent: number | null;
69
+ deductible_amount: number | null;
70
+ insurer_authorized_amount: number | null;
63
71
  outside_since: Date | null;
64
72
  stages: ServiceOrderStage[];
65
73
  workboard_events: WorkboardEvent[];
@@ -245,6 +245,46 @@ __decorate([
245
245
  }),
246
246
  __metadata("design:type", Object)
247
247
  ], ServiceOrder.prototype, "promised_date", void 0);
248
+ __decorate([
249
+ (0, typeorm_1.Column)({
250
+ type: "decimal",
251
+ precision: 8,
252
+ scale: 2,
253
+ default: null,
254
+ nullable: true,
255
+ comment: "Horas hábiles de trabajo estimadas para el vehículo. NULL: sin estimar.",
256
+ }),
257
+ __metadata("design:type", Object)
258
+ ], ServiceOrder.prototype, "estimated_hours", void 0);
259
+ __decorate([
260
+ (0, typeorm_1.Column)({
261
+ type: "int",
262
+ default: null,
263
+ nullable: true,
264
+ comment: "Unidad en que se escribió el tiempo estimado: 2 horas, 3 días, 4 semanas (TIME_UNIT).",
265
+ }),
266
+ __metadata("design:type", Object)
267
+ ], ServiceOrder.prototype, "estimated_unit", void 0);
268
+ __decorate([
269
+ (0, typeorm_1.Column)({
270
+ type: "decimal",
271
+ precision: 8,
272
+ scale: 2,
273
+ default: null,
274
+ nullable: true,
275
+ comment: "Horas hábiles estimadas AL CREAR la visita. No cambia al editar el estimado. NULL: se creó sin estimar.",
276
+ }),
277
+ __metadata("design:type", Object)
278
+ ], ServiceOrder.prototype, "initial_estimated_hours", void 0);
279
+ __decorate([
280
+ (0, typeorm_1.Column)({
281
+ type: "int",
282
+ default: null,
283
+ nullable: true,
284
+ comment: "Unidad del estimado inicial: 2 horas, 3 días, 4 semanas (TIME_UNIT).",
285
+ }),
286
+ __metadata("design:type", Object)
287
+ ], ServiceOrder.prototype, "initial_estimated_unit", void 0);
248
288
  __decorate([
249
289
  (0, typeorm_1.Column)({
250
290
  type: "tinyint",
@@ -320,6 +360,47 @@ __decorate([
320
360
  }),
321
361
  __metadata("design:type", Object)
322
362
  ], ServiceOrder.prototype, "claim_number", void 0);
363
+ __decorate([
364
+ (0, typeorm_1.Column)({
365
+ type: "int",
366
+ default: 0,
367
+ comment: "Deducible de la aseguradora.\n0: Sin deducible.\n1: Porcentaje de lo aprobado con un mínimo.\n2: Valor fijo.",
368
+ }),
369
+ __metadata("design:type", Number)
370
+ ], ServiceOrder.prototype, "deductible_type", void 0);
371
+ __decorate([
372
+ (0, typeorm_1.Column)({
373
+ type: "decimal",
374
+ precision: 5,
375
+ scale: 2,
376
+ default: null,
377
+ nullable: true,
378
+ comment: "Porcentaje del deducible (0-100) sobre lo aprobado por la aseguradora con IVA. Solo con deductible_type 1.",
379
+ }),
380
+ __metadata("design:type", Object)
381
+ ], ServiceOrder.prototype, "deductible_percent", void 0);
382
+ __decorate([
383
+ (0, typeorm_1.Column)({
384
+ type: "decimal",
385
+ precision: 14,
386
+ scale: 2,
387
+ default: null,
388
+ nullable: true,
389
+ comment: "Con deductible_type 1: el mínimo. Con 2: el valor fijo. En la moneda de la visita.",
390
+ }),
391
+ __metadata("design:type", Object)
392
+ ], ServiceOrder.prototype, "deductible_amount", void 0);
393
+ __decorate([
394
+ (0, typeorm_1.Column)({
395
+ type: "decimal",
396
+ precision: 14,
397
+ scale: 2,
398
+ default: null,
399
+ nullable: true,
400
+ comment: "Valor autorizado en la carta de la aseguradora, con IVA. Opcional: solo se compara con los ítems aprobados por ella; no cambia el total.",
401
+ }),
402
+ __metadata("design:type", Object)
403
+ ], ServiceOrder.prototype, "insurer_authorized_amount", void 0);
323
404
  __decorate([
324
405
  (0, typeorm_1.Column)({
325
406
  type: "datetime",
@@ -19,5 +19,12 @@ export declare class ServiceOrderApproval {
19
19
  client_role: string | null;
20
20
  ip: string | null;
21
21
  user_agent: string | null;
22
+ source: number;
23
+ insurer: number | null;
24
+ associate: number | null;
25
+ verification: number;
26
+ registered_method: number | null;
27
+ evidence: string | null;
28
+ note: string | null;
22
29
  created: Date;
23
30
  }
@@ -171,6 +171,69 @@ __decorate([
171
171
  }),
172
172
  __metadata("design:type", Object)
173
173
  ], ServiceOrderApproval.prototype, "user_agent", void 0);
174
+ __decorate([
175
+ (0, typeorm_1.Column)({
176
+ type: "int",
177
+ default: 1,
178
+ comment: "Quién aprobó: 1 el cliente, 2 la aseguradora (lo marcó el taller).",
179
+ }),
180
+ __metadata("design:type", Number)
181
+ ], ServiceOrderApproval.prototype, "source", void 0);
182
+ __decorate([
183
+ (0, typeorm_1.Column)({
184
+ type: "int",
185
+ default: null,
186
+ nullable: true,
187
+ comment: "Aseguradora que aprobó (solo source = 2).",
188
+ }),
189
+ __metadata("design:type", Object)
190
+ ], ServiceOrderApproval.prototype, "insurer", void 0);
191
+ __decorate([
192
+ (0, typeorm_1.Column)({
193
+ type: "int",
194
+ default: null,
195
+ nullable: true,
196
+ comment: "Empleado que marcó la aprobación: de la aseguradora (source = 2) o la registrada por el taller (verification = 5).",
197
+ }),
198
+ __metadata("design:type", Object)
199
+ ], ServiceOrderApproval.prototype, "associate", void 0);
200
+ __decorate([
201
+ (0, typeorm_1.Column)({
202
+ type: "int",
203
+ default: 0,
204
+ comment: "Cómo confirmó el cliente la aprobación:\n0: Sin verificación (rechazo, aseguradora o antes de sql/91).\n1: Documento.\n2: Código por correo.\n3: Sesión de la app (sin documento).\n4: Número de WhatsApp (verificado por Meta).\n5: Registrada por el taller (con evidencia y nota).",
205
+ }),
206
+ __metadata("design:type", Number)
207
+ ], ServiceOrderApproval.prototype, "verification", void 0);
208
+ __decorate([
209
+ (0, typeorm_1.Column)({
210
+ type: "int",
211
+ default: null,
212
+ nullable: true,
213
+ comment: "Cómo aprobó el cliente cuando lo registra el taller (verification = 5):\n1: Por llamada.\n2: En persona.\n3: Otro.\nNULL: no la registró el taller.",
214
+ }),
215
+ __metadata("design:type", Object)
216
+ ], ServiceOrderApproval.prototype, "registered_method", void 0);
217
+ __decorate([
218
+ (0, typeorm_1.Column)({
219
+ type: "varchar",
220
+ length: 255,
221
+ default: null,
222
+ nullable: true,
223
+ comment: "Llave en R2 de la evidencia (foto, audio, PDF o la firma en pantalla) de la aprobación registrada por el taller.",
224
+ }),
225
+ __metadata("design:type", Object)
226
+ ], ServiceOrderApproval.prototype, "evidence", void 0);
227
+ __decorate([
228
+ (0, typeorm_1.Column)({
229
+ type: "varchar",
230
+ length: 500,
231
+ default: null,
232
+ nullable: true,
233
+ comment: "Nota obligatoria del empleado al registrar la aprobación del cliente.",
234
+ }),
235
+ __metadata("design:type", Object)
236
+ ], ServiceOrderApproval.prototype, "note", void 0);
174
237
  __decorate([
175
238
  (0, typeorm_1.Column)({
176
239
  type: "datetime",
@@ -40,9 +40,19 @@ export declare class ServiceOrderStage {
40
40
  entered: Date | null;
41
41
  finished: Date | null;
42
42
  estimated_hours: number | null;
43
+ estimated_unit: number | null;
43
44
  blocked_reason: string | null;
44
45
  blocked_at: Date | null;
45
46
  blocked_by: Associate | null;
47
+ pay_unit: number | null;
48
+ pay_quantity: string | null;
49
+ pay_rate: string | null;
50
+ pay_amount: string | null;
51
+ income_hours: string | null;
52
+ income_rate: string | null;
53
+ income_amount: string | null;
54
+ payroll_updated_by: Associate | null;
55
+ payroll_updated: Date | null;
46
56
  details: any | null;
47
57
  created: Date;
48
58
  updated: Date | null;