@asumano/worklip-typeorm-db 1.1.100 → 1.1.102
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/attendance.rules.d.ts +162 -0
- package/dist/attendance.rules.js +249 -0
- package/dist/booking.rules.d.ts +1 -0
- package/dist/booking.rules.js +2 -0
- package/dist/client.link.rules.d.ts +5 -0
- package/dist/client.link.rules.js +3 -1
- package/dist/entities/AssociateNotification.d.ts +14 -0
- package/dist/entities/AssociateNotification.js +74 -0
- package/dist/entities/AssociateSectionFeature.d.ts +7 -0
- package/dist/entities/AssociateSectionFeature.js +42 -0
- package/dist/entities/AttendanceMark.d.ts +26 -0
- package/dist/entities/AttendanceMark.js +155 -0
- package/dist/entities/Client.d.ts +1 -1
- package/dist/entities/Client.js +4 -2
- package/dist/entities/ClientDocumentDispute.d.ts +21 -0
- package/dist/entities/ClientDocumentDispute.js +103 -0
- package/dist/entities/ClientNotification.d.ts +13 -0
- package/dist/entities/ClientNotification.js +73 -0
- package/dist/entities/ClientSession.d.ts +3 -0
- package/dist/entities/ClientSession.js +34 -0
- package/dist/entities/ClientVehicle.d.ts +5 -0
- package/dist/entities/ClientVehicle.js +47 -2
- package/dist/entities/ClientVehicleInvite.d.ts +17 -0
- package/dist/entities/ClientVehicleInvite.js +113 -0
- package/dist/entities/CompanyQuotaAdjustment.d.ts +13 -0
- package/dist/entities/CompanyQuotaAdjustment.js +74 -0
- package/dist/entities/MasterNotification.d.ts +10 -0
- package/dist/entities/MasterNotification.js +61 -0
- package/dist/entities/PypRule.d.ts +19 -0
- package/dist/entities/PypRule.js +105 -0
- package/dist/entities/PypRuleVote.d.ts +10 -0
- package/dist/entities/PypRuleVote.js +60 -0
- package/dist/entities/ReviewTask.d.ts +17 -0
- package/dist/entities/ReviewTask.js +114 -0
- package/dist/entities/ReviewTaskEvent.d.ts +12 -0
- package/dist/entities/ReviewTaskEvent.js +66 -0
- package/dist/entities/ServiceOrder.d.ts +3 -0
- package/dist/entities/ServiceOrder.js +29 -0
- package/dist/entities/ServiceOrderApproval.d.ts +3 -0
- package/dist/entities/ServiceOrderApproval.js +29 -0
- package/dist/entities/SubscriptionAddon.js +1 -1
- package/dist/entities/SubscriptionAddonTemplate.js +1 -1
- package/dist/entities/UsageAlert.js +1 -1
- package/dist/entities/VehicleReport.d.ts +16 -0
- package/dist/entities/VehicleReport.js +83 -0
- package/dist/entities/VehicleVerification.d.ts +20 -0
- package/dist/entities/VehicleVerification.js +102 -0
- package/dist/entities/VisitAiAnalysis.d.ts +18 -0
- package/dist/entities/VisitAiAnalysis.js +93 -0
- package/dist/entities/VisitItemSearch.d.ts +28 -0
- package/dist/entities/VisitItemSearch.js +161 -0
- package/dist/entities/VisitSearchHistory.d.ts +14 -0
- package/dist/entities/VisitSearchHistory.js +80 -0
- package/dist/entities/VisitSearchPerson.d.ts +8 -0
- package/dist/entities/VisitSearchPerson.js +49 -0
- package/dist/entities/WorkshopReader.d.ts +2 -1
- package/dist/entities/WorkshopReader.js +10 -1
- package/dist/entities.index.d.ts +19 -0
- package/dist/entities.index.js +47 -3
- package/dist/entities.views.routes.d.ts +0 -5
- package/dist/entities.views.routes.js +0 -11
- package/dist/feature.codes.d.ts +2 -0
- package/dist/feature.codes.js +5 -0
- package/dist/index.d.ts +3 -7
- package/dist/index.js +18 -11
- package/dist/slow.query.logger.d.ts +16 -0
- package/dist/slow.query.logger.js +24 -0
- package/dist/vehicle.type.icons.d.ts +151 -0
- package/dist/vehicle.type.icons.js +56 -0
- package/dist/vehicle.type.rules.d.ts +25 -0
- package/dist/vehicle.type.rules.js +38 -1
- package/dist/views/ServicesOrderLite.d.ts +70 -0
- package/dist/views/ServicesOrderLite.js +299 -0
- package/dist/visit.history.rules.d.ts +154 -0
- package/dist/visit.history.rules.js +282 -0
- package/dist/visit.summary.d.ts +13 -0
- package/dist/visit.summary.js +11 -3
- package/package.json +3 -5
- package/dist/CustomRepository.d.ts +0 -21
- package/dist/CustomRepository.js +0 -23
- package/dist/filters/AssociatesForTheTable.d.ts +0 -6
- package/dist/filters/AssociatesForTheTable.js +0 -63
- package/dist/filters/ClientsForTheTable.d.ts +0 -6
- package/dist/filters/ClientsForTheTable.js +0 -48
- package/dist/filters/ServicesOrderForTheTable.d.ts +0 -6
- package/dist/filters/ServicesOrderForTheTable.js +0 -205
- package/dist/filters/VehiclesForTheTable.d.ts +0 -6
- package/dist/filters/VehiclesForTheTable.js +0 -48
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type IWorkshopSchedule } from "./workshop.schedule";
|
|
2
|
+
/**
|
|
3
|
+
* DOC: CONTROL DE ASISTENCIA (sql/68): los números de la base y las cuentas del reporte.
|
|
4
|
+
*
|
|
5
|
+
* Vive en la librería por la misma razón que `workshop.schedule.ts`: el API arma el reporte y el
|
|
6
|
+
* front lo pinta (y lo exporta); si cada lado contara a su manera, la llegada tarde de la pantalla
|
|
7
|
+
* y la del archivo no coincidirían.
|
|
8
|
+
*
|
|
9
|
+
* Tres decisiones (2026-10-12):
|
|
10
|
+
* · Entrada o salida la decide el sistema: ALTERNA. Si la última marcación válida es una entrada de
|
|
11
|
+
* hace menos de 16 h, la siguiente es salida; si no, entrada. El almuerzo son dos marcaciones más.
|
|
12
|
+
* · Las marcaciones se guardan CRUDAS y el reporte se calcula al leer: corregir el horario de la sede
|
|
13
|
+
* recalcula el pasado, y nada calculado se queda viejo en la base.
|
|
14
|
+
* · El horario esperado es el de la SEDE (`workshop.details.schedule`). Los turnos por empleado
|
|
15
|
+
* entran después por `resolveExpectedSchedule`, sin tocar el resto.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ATTENDANCE_TYPE: {
|
|
18
|
+
readonly IN: 1;
|
|
19
|
+
readonly OUT: 2;
|
|
20
|
+
};
|
|
21
|
+
export declare const ATTENDANCE_METHOD: {
|
|
22
|
+
readonly BADGE: 1;
|
|
23
|
+
readonly DOCUMENT: 2;
|
|
24
|
+
readonly MANUAL: 3;
|
|
25
|
+
};
|
|
26
|
+
export declare const ATTENDANCE_STATUS: {
|
|
27
|
+
readonly VALID: 1;
|
|
28
|
+
readonly VOIDED: 2;
|
|
29
|
+
readonly UNRESOLVED: 3;
|
|
30
|
+
};
|
|
31
|
+
export declare const READER_PURPOSE: {
|
|
32
|
+
readonly SECTION: 1;
|
|
33
|
+
readonly DOOR: 2;
|
|
34
|
+
};
|
|
35
|
+
export type TAttendanceType = (typeof ATTENDANCE_TYPE)[keyof typeof ATTENDANCE_TYPE];
|
|
36
|
+
export type TAttendanceMethod = (typeof ATTENDANCE_METHOD)[keyof typeof ATTENDANCE_METHOD];
|
|
37
|
+
export type TAttendanceStatus = (typeof ATTENDANCE_STATUS)[keyof typeof ATTENDANCE_STATUS];
|
|
38
|
+
export type TReaderPurpose = (typeof READER_PURPOSE)[keyof typeof READER_PURPOSE];
|
|
39
|
+
export declare const ATTENDANCE_LIMITS: {
|
|
40
|
+
readonly DEBOUNCE_SECONDS: 120;
|
|
41
|
+
readonly OPEN_SHIFT_HOURS: 16;
|
|
42
|
+
readonly MAX_OFFLINE_HOURS: 72;
|
|
43
|
+
readonly MAX_FUTURE_MINUTES: 5;
|
|
44
|
+
readonly DEFAULT_TOLERANCE_MINUTES: 10;
|
|
45
|
+
readonly MAX_TOLERANCE_MINUTES: 120;
|
|
46
|
+
readonly UNRESOLVED_KEEP_DAYS: 30;
|
|
47
|
+
readonly MAX_REPORT_DAYS: 366;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* DOC: Lo que se configura, sin migración: la EMPRESA decide si se marca con cédula y si los empleados
|
|
51
|
+
* ven sus marcaciones (`company.details.attendance`); la SEDE pone la tolerancia y puede cambiar lo
|
|
52
|
+
* de ver las propias (`workshop.details.attendance`; null = lo que diga la empresa).
|
|
53
|
+
*/
|
|
54
|
+
export interface ICompanyAttendanceSettings {
|
|
55
|
+
allow_document: boolean;
|
|
56
|
+
employees_see_own: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface IWorkshopAttendanceSettings {
|
|
59
|
+
tolerance_minutes: number;
|
|
60
|
+
employees_see_own: boolean | null;
|
|
61
|
+
}
|
|
62
|
+
export interface IAttendanceSettings {
|
|
63
|
+
allowDocument: boolean;
|
|
64
|
+
employeesSeeOwn: boolean;
|
|
65
|
+
toleranceMinutes: number;
|
|
66
|
+
}
|
|
67
|
+
export declare const normalizeCompanyAttendance: (raw: unknown) => ICompanyAttendanceSettings;
|
|
68
|
+
export declare const normalizeWorkshopAttendance: (raw: unknown) => IWorkshopAttendanceSettings;
|
|
69
|
+
export declare const getAttendanceSettings: (companyDetails: unknown, workshopDetails: unknown) => IAttendanceSettings;
|
|
70
|
+
export interface IAttendanceLast {
|
|
71
|
+
type: number;
|
|
72
|
+
at: Date | string;
|
|
73
|
+
}
|
|
74
|
+
export declare const isRepeatedTap: (last: IAttendanceLast | null, now: Date) => boolean;
|
|
75
|
+
export declare const nextMarkType: (last: IAttendanceLast | null, now: Date) => TAttendanceType;
|
|
76
|
+
export interface IAttendanceSequenceItem {
|
|
77
|
+
id: number;
|
|
78
|
+
at: Date | string;
|
|
79
|
+
type: number;
|
|
80
|
+
fixed: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* DOC: Vuelve a decidir entrada/salida de una persona en orden de tiempo. Hace falta cuando llegan
|
|
84
|
+
* marcaciones guardadas sin conexión: una que se marcó antes que otras ya guardadas cambia el
|
|
85
|
+
* turno de las que siguen. Devuelve solo las que cambian.
|
|
86
|
+
*/
|
|
87
|
+
export declare const resequenceMarks: (items: IAttendanceSequenceItem[]) => {
|
|
88
|
+
id: number;
|
|
89
|
+
type: TAttendanceType;
|
|
90
|
+
}[];
|
|
91
|
+
export interface IAttendanceMarkInput {
|
|
92
|
+
id: number;
|
|
93
|
+
type: number;
|
|
94
|
+
at: Date | string;
|
|
95
|
+
method?: number;
|
|
96
|
+
offline?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface IAttendanceShift {
|
|
99
|
+
in: string | null;
|
|
100
|
+
out: string | null;
|
|
101
|
+
minutes: number;
|
|
102
|
+
incomplete: boolean;
|
|
103
|
+
open: boolean;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* DOC: Junta las marcaciones válidas de UNA persona en turnos (entrada → salida). Una entrada sin
|
|
107
|
+
* cerrar que recibe otra entrada queda incompleta; una salida sin entrada también.
|
|
108
|
+
*/
|
|
109
|
+
export declare const pairShifts: (marks: IAttendanceMarkInput[], now?: Date) => IAttendanceShift[];
|
|
110
|
+
/**
|
|
111
|
+
* DOC: EL HORARIO ESPERADO de una persona. Hoy es el de la sede; con turnos por empleado, el turno
|
|
112
|
+
* vigente ese día manda sobre el de la sede, y este es el único sitio que cambia.
|
|
113
|
+
*/
|
|
114
|
+
export declare const resolveExpectedSchedule: (input: {
|
|
115
|
+
workshopSchedule: IWorkshopSchedule | null;
|
|
116
|
+
}) => IWorkshopSchedule | null;
|
|
117
|
+
export interface IAttendanceDay {
|
|
118
|
+
day: string;
|
|
119
|
+
ranges: {
|
|
120
|
+
from: number;
|
|
121
|
+
to: number;
|
|
122
|
+
}[];
|
|
123
|
+
expectedMinutes: number;
|
|
124
|
+
workedMinutes: number;
|
|
125
|
+
firstIn: string | null;
|
|
126
|
+
lastOut: string | null;
|
|
127
|
+
lateMinutes: number;
|
|
128
|
+
earlyMinutes: number;
|
|
129
|
+
absent: boolean;
|
|
130
|
+
incomplete: boolean;
|
|
131
|
+
open: boolean;
|
|
132
|
+
shifts: IAttendanceShift[];
|
|
133
|
+
}
|
|
134
|
+
export declare const attendanceDays: (from: string, to: string) => string[];
|
|
135
|
+
/**
|
|
136
|
+
* DOC: EL REPORTE DE UNA PERSONA por día. Cada turno cuenta en el día de su ENTRADA (un turno de
|
|
137
|
+
* noche no se parte en dos). La llegada tarde mira la primera entrada contra el primer tramo; la
|
|
138
|
+
* salida temprana, la última salida contra el último tramo; las dos solo si pasan la tolerancia.
|
|
139
|
+
* Sin horario no hay tarde, temprano ni ausencia: solo horas trabajadas.
|
|
140
|
+
*/
|
|
141
|
+
export declare const summarizeAttendance: (input: {
|
|
142
|
+
marks: IAttendanceMarkInput[];
|
|
143
|
+
from: string;
|
|
144
|
+
to: string;
|
|
145
|
+
schedule: IWorkshopSchedule | null;
|
|
146
|
+
holidays?: Set<string>;
|
|
147
|
+
timeZone?: string | null;
|
|
148
|
+
toleranceMinutes?: number;
|
|
149
|
+
now?: Date;
|
|
150
|
+
}) => IAttendanceDay[];
|
|
151
|
+
export interface IAttendanceTotals {
|
|
152
|
+
workedMinutes: number;
|
|
153
|
+
expectedMinutes: number;
|
|
154
|
+
lateDays: number;
|
|
155
|
+
lateMinutes: number;
|
|
156
|
+
earlyDays: number;
|
|
157
|
+
earlyMinutes: number;
|
|
158
|
+
absentDays: number;
|
|
159
|
+
incompleteDays: number;
|
|
160
|
+
extraMinutes: number;
|
|
161
|
+
}
|
|
162
|
+
export declare const attendanceTotals: (days: IAttendanceDay[]) => IAttendanceTotals;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attendanceTotals = exports.summarizeAttendance = exports.attendanceDays = exports.resolveExpectedSchedule = exports.pairShifts = exports.resequenceMarks = exports.nextMarkType = exports.isRepeatedTap = exports.getAttendanceSettings = exports.normalizeWorkshopAttendance = exports.normalizeCompanyAttendance = exports.ATTENDANCE_LIMITS = exports.READER_PURPOSE = exports.ATTENDANCE_STATUS = exports.ATTENDANCE_METHOD = exports.ATTENDANCE_TYPE = void 0;
|
|
4
|
+
const timezone_1 = require("./timezone");
|
|
5
|
+
const workshop_schedule_1 = require("./workshop.schedule");
|
|
6
|
+
/**
|
|
7
|
+
* DOC: CONTROL DE ASISTENCIA (sql/68): los números de la base y las cuentas del reporte.
|
|
8
|
+
*
|
|
9
|
+
* Vive en la librería por la misma razón que `workshop.schedule.ts`: el API arma el reporte y el
|
|
10
|
+
* front lo pinta (y lo exporta); si cada lado contara a su manera, la llegada tarde de la pantalla
|
|
11
|
+
* y la del archivo no coincidirían.
|
|
12
|
+
*
|
|
13
|
+
* Tres decisiones (2026-10-12):
|
|
14
|
+
* · Entrada o salida la decide el sistema: ALTERNA. Si la última marcación válida es una entrada de
|
|
15
|
+
* hace menos de 16 h, la siguiente es salida; si no, entrada. El almuerzo son dos marcaciones más.
|
|
16
|
+
* · Las marcaciones se guardan CRUDAS y el reporte se calcula al leer: corregir el horario de la sede
|
|
17
|
+
* recalcula el pasado, y nada calculado se queda viejo en la base.
|
|
18
|
+
* · El horario esperado es el de la SEDE (`workshop.details.schedule`). Los turnos por empleado
|
|
19
|
+
* entran después por `resolveExpectedSchedule`, sin tocar el resto.
|
|
20
|
+
*/
|
|
21
|
+
exports.ATTENDANCE_TYPE = { IN: 1, OUT: 2 };
|
|
22
|
+
exports.ATTENDANCE_METHOD = { BADGE: 1, DOCUMENT: 2, MANUAL: 3 };
|
|
23
|
+
exports.ATTENDANCE_STATUS = { VALID: 1, VOIDED: 2, UNRESOLVED: 3 };
|
|
24
|
+
// DOC: Para qué está un lector (`workshop_reader.purpose`).
|
|
25
|
+
exports.READER_PURPOSE = { SECTION: 1, DOOR: 2 };
|
|
26
|
+
exports.ATTENDANCE_LIMITS = {
|
|
27
|
+
// DOC: Un segundo toque de la misma persona dentro de este tiempo es el MISMO toque.
|
|
28
|
+
DEBOUNCE_SECONDS: 120,
|
|
29
|
+
// DOC: Una entrada sin salida por más de esto es un turno sin cerrar: el próximo toque es entrada.
|
|
30
|
+
OPEN_SHIFT_HOURS: 16,
|
|
31
|
+
// DOC: Lo guardado sin conexión se acepta hasta con esta antigüedad; más viejo no se cree.
|
|
32
|
+
MAX_OFFLINE_HOURS: 72,
|
|
33
|
+
// DOC: Un reloj adelantado más que esto delata un aparato mal puesto en hora.
|
|
34
|
+
MAX_FUTURE_MINUTES: 5,
|
|
35
|
+
DEFAULT_TOLERANCE_MINUTES: 10,
|
|
36
|
+
MAX_TOLERANCE_MINUTES: 120,
|
|
37
|
+
// DOC: La cédula o el carné sin reconocer se guardan para revisarlos y se borran después de esto.
|
|
38
|
+
UNRESOLVED_KEEP_DAYS: 30,
|
|
39
|
+
// DOC: Tope de un rango del reporte (un año y un día).
|
|
40
|
+
MAX_REPORT_DAYS: 366,
|
|
41
|
+
};
|
|
42
|
+
const clampTolerance = (value) => {
|
|
43
|
+
const minutes = Math.round(Number(value));
|
|
44
|
+
if (!Number.isFinite(minutes) || minutes < 0)
|
|
45
|
+
return exports.ATTENDANCE_LIMITS.DEFAULT_TOLERANCE_MINUTES;
|
|
46
|
+
return Math.min(minutes, exports.ATTENDANCE_LIMITS.MAX_TOLERANCE_MINUTES);
|
|
47
|
+
};
|
|
48
|
+
const normalizeCompanyAttendance = (raw) => ({
|
|
49
|
+
allow_document: raw?.allow_document === true,
|
|
50
|
+
employees_see_own: raw?.employees_see_own === true,
|
|
51
|
+
});
|
|
52
|
+
exports.normalizeCompanyAttendance = normalizeCompanyAttendance;
|
|
53
|
+
const normalizeWorkshopAttendance = (raw) => {
|
|
54
|
+
const own = raw?.employees_see_own;
|
|
55
|
+
return {
|
|
56
|
+
tolerance_minutes: raw?.tolerance_minutes === undefined || raw?.tolerance_minutes === null
|
|
57
|
+
? exports.ATTENDANCE_LIMITS.DEFAULT_TOLERANCE_MINUTES
|
|
58
|
+
: clampTolerance(raw.tolerance_minutes),
|
|
59
|
+
employees_see_own: own === true || own === false ? own : null,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
exports.normalizeWorkshopAttendance = normalizeWorkshopAttendance;
|
|
63
|
+
// DOC: Lo que aplica en una sede: lo de la empresa, con lo que la sede cambie encima.
|
|
64
|
+
const getAttendanceSettings = (companyDetails, workshopDetails) => {
|
|
65
|
+
const company = (0, exports.normalizeCompanyAttendance)(companyDetails?.attendance);
|
|
66
|
+
const workshop = (0, exports.normalizeWorkshopAttendance)(workshopDetails?.attendance);
|
|
67
|
+
return {
|
|
68
|
+
allowDocument: company.allow_document,
|
|
69
|
+
employeesSeeOwn: workshop.employees_see_own ?? company.employees_see_own,
|
|
70
|
+
toleranceMinutes: workshop.tolerance_minutes,
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
exports.getAttendanceSettings = getAttendanceSettings;
|
|
74
|
+
const time = (value) => (value instanceof Date ? value : new Date(value)).getTime();
|
|
75
|
+
// DOC: ¿Es el mismo toque que el anterior? (dos pasadas seguidas del carné).
|
|
76
|
+
const isRepeatedTap = (last, now) => !!last && now.getTime() - time(last.at) >= 0 && now.getTime() - time(last.at) < exports.ATTENDANCE_LIMITS.DEBOUNCE_SECONDS * 1000;
|
|
77
|
+
exports.isRepeatedTap = isRepeatedTap;
|
|
78
|
+
// DOC: Alterna: tras una entrada de menos de 16 h viene una salida; todo lo demás empieza una entrada.
|
|
79
|
+
const nextMarkType = (last, now) => last &&
|
|
80
|
+
last.type === exports.ATTENDANCE_TYPE.IN &&
|
|
81
|
+
now.getTime() - time(last.at) < exports.ATTENDANCE_LIMITS.OPEN_SHIFT_HOURS * 3600000
|
|
82
|
+
? exports.ATTENDANCE_TYPE.OUT
|
|
83
|
+
: exports.ATTENDANCE_TYPE.IN;
|
|
84
|
+
exports.nextMarkType = nextMarkType;
|
|
85
|
+
/**
|
|
86
|
+
* DOC: Vuelve a decidir entrada/salida de una persona en orden de tiempo. Hace falta cuando llegan
|
|
87
|
+
* marcaciones guardadas sin conexión: una que se marcó antes que otras ya guardadas cambia el
|
|
88
|
+
* turno de las que siguen. Devuelve solo las que cambian.
|
|
89
|
+
*/
|
|
90
|
+
const resequenceMarks = (items) => {
|
|
91
|
+
const sorted = [...items].sort((a, b) => time(a.at) - time(b.at) || a.id - b.id);
|
|
92
|
+
const changes = [];
|
|
93
|
+
let last = null;
|
|
94
|
+
for (const item of sorted) {
|
|
95
|
+
const type = item.fixed ? item.type : (0, exports.nextMarkType)(last, new Date(time(item.at)));
|
|
96
|
+
if (type !== item.type)
|
|
97
|
+
changes.push({ id: item.id, type });
|
|
98
|
+
last = { type, at: item.at };
|
|
99
|
+
}
|
|
100
|
+
return changes;
|
|
101
|
+
};
|
|
102
|
+
exports.resequenceMarks = resequenceMarks;
|
|
103
|
+
/**
|
|
104
|
+
* DOC: Junta las marcaciones válidas de UNA persona en turnos (entrada → salida). Una entrada sin
|
|
105
|
+
* cerrar que recibe otra entrada queda incompleta; una salida sin entrada también.
|
|
106
|
+
*/
|
|
107
|
+
const pairShifts = (marks, now = new Date()) => {
|
|
108
|
+
const sorted = [...marks].sort((a, b) => time(a.at) - time(b.at) || a.id - b.id);
|
|
109
|
+
const shifts = [];
|
|
110
|
+
const maxOpen = exports.ATTENDANCE_LIMITS.OPEN_SHIFT_HOURS * 3600000;
|
|
111
|
+
let open = null;
|
|
112
|
+
const iso = (ms) => new Date(ms).toISOString();
|
|
113
|
+
const closeOpen = () => {
|
|
114
|
+
if (open === null)
|
|
115
|
+
return;
|
|
116
|
+
const stillInside = now.getTime() - open < maxOpen;
|
|
117
|
+
shifts.push({ in: iso(open), out: null, minutes: 0, incomplete: !stillInside, open: stillInside });
|
|
118
|
+
open = null;
|
|
119
|
+
};
|
|
120
|
+
for (const mark of sorted) {
|
|
121
|
+
const at = time(mark.at);
|
|
122
|
+
if (mark.type === exports.ATTENDANCE_TYPE.IN) {
|
|
123
|
+
if (open !== null) {
|
|
124
|
+
shifts.push({ in: iso(open), out: null, minutes: 0, incomplete: true, open: false });
|
|
125
|
+
}
|
|
126
|
+
open = at;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (open !== null && at - open <= maxOpen) {
|
|
130
|
+
shifts.push({ in: iso(open), out: iso(at), minutes: Math.round((at - open) / 60000), incomplete: false, open: false });
|
|
131
|
+
open = null;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
if (open !== null) {
|
|
135
|
+
shifts.push({ in: iso(open), out: null, minutes: 0, incomplete: true, open: false });
|
|
136
|
+
open = null;
|
|
137
|
+
}
|
|
138
|
+
shifts.push({ in: null, out: iso(at), minutes: 0, incomplete: true, open: false });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
closeOpen();
|
|
142
|
+
return shifts;
|
|
143
|
+
};
|
|
144
|
+
exports.pairShifts = pairShifts;
|
|
145
|
+
/**
|
|
146
|
+
* DOC: EL HORARIO ESPERADO de una persona. Hoy es el de la sede; con turnos por empleado, el turno
|
|
147
|
+
* vigente ese día manda sobre el de la sede, y este es el único sitio que cambia.
|
|
148
|
+
*/
|
|
149
|
+
const resolveExpectedSchedule = (input) => input.workshopSchedule;
|
|
150
|
+
exports.resolveExpectedSchedule = resolveExpectedSchedule;
|
|
151
|
+
const addDays = (day, amount) => {
|
|
152
|
+
const date = new Date(`${day}T12:00:00Z`);
|
|
153
|
+
date.setUTCDate(date.getUTCDate() + amount);
|
|
154
|
+
return date.toISOString().slice(0, 10);
|
|
155
|
+
};
|
|
156
|
+
// DOC: Los días de un rango "YYYY-MM-DD" (los dos incluidos), con el tope del reporte.
|
|
157
|
+
const attendanceDays = (from, to) => {
|
|
158
|
+
const days = [];
|
|
159
|
+
for (let day = from; day <= to && days.length < exports.ATTENDANCE_LIMITS.MAX_REPORT_DAYS; day = addDays(day, 1)) {
|
|
160
|
+
days.push(day);
|
|
161
|
+
}
|
|
162
|
+
return days;
|
|
163
|
+
};
|
|
164
|
+
exports.attendanceDays = attendanceDays;
|
|
165
|
+
const minutesOfDay = (iso, timeZone) => {
|
|
166
|
+
const wall = (0, timezone_1.toWallClock)(new Date(iso), timeZone);
|
|
167
|
+
return wall.getHours() * 60 + wall.getMinutes();
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* DOC: EL REPORTE DE UNA PERSONA por día. Cada turno cuenta en el día de su ENTRADA (un turno de
|
|
171
|
+
* noche no se parte en dos). La llegada tarde mira la primera entrada contra el primer tramo; la
|
|
172
|
+
* salida temprana, la última salida contra el último tramo; las dos solo si pasan la tolerancia.
|
|
173
|
+
* Sin horario no hay tarde, temprano ni ausencia: solo horas trabajadas.
|
|
174
|
+
*/
|
|
175
|
+
const summarizeAttendance = (input) => {
|
|
176
|
+
const now = input.now ?? new Date();
|
|
177
|
+
const tolerance = input.toleranceMinutes ?? exports.ATTENDANCE_LIMITS.DEFAULT_TOLERANCE_MINUTES;
|
|
178
|
+
const today = (0, timezone_1.dayIn)(input.timeZone, now);
|
|
179
|
+
const nowMinutes = minutesOfDay(now.toISOString(), input.timeZone);
|
|
180
|
+
const shifts = (0, exports.pairShifts)(input.marks, now);
|
|
181
|
+
const byDay = new Map();
|
|
182
|
+
for (const shift of shifts) {
|
|
183
|
+
const anchor = shift.in ?? shift.out;
|
|
184
|
+
const day = (0, timezone_1.dayIn)(input.timeZone, new Date(anchor));
|
|
185
|
+
byDay.set(day, [...(byDay.get(day) ?? []), shift]);
|
|
186
|
+
}
|
|
187
|
+
return (0, exports.attendanceDays)(input.from, input.to).map((day) => {
|
|
188
|
+
const ranges = (0, workshop_schedule_1.openRangesOnDay)(input.schedule, day, input.holidays ?? new Set());
|
|
189
|
+
const dayShifts = byDay.get(day) ?? [];
|
|
190
|
+
const ins = dayShifts.map((shift) => shift.in).filter(Boolean);
|
|
191
|
+
const outs = dayShifts.map((shift) => shift.out).filter(Boolean);
|
|
192
|
+
const firstIn = ins.length ? ins.reduce((a, b) => (a < b ? a : b)) : null;
|
|
193
|
+
const lastOut = outs.length ? outs.reduce((a, b) => (a > b ? a : b)) : null;
|
|
194
|
+
const open = dayShifts.some((shift) => shift.open);
|
|
195
|
+
let lateMinutes = 0;
|
|
196
|
+
let earlyMinutes = 0;
|
|
197
|
+
if (ranges.length && firstIn) {
|
|
198
|
+
const late = minutesOfDay(firstIn, input.timeZone) - ranges[0].from;
|
|
199
|
+
if (late > tolerance)
|
|
200
|
+
lateMinutes = late;
|
|
201
|
+
}
|
|
202
|
+
// DOC: La salida temprana solo se mide si la última salida cae ESE día y ya no hay nadie adentro.
|
|
203
|
+
if (ranges.length && lastOut && !open && (0, timezone_1.dayIn)(input.timeZone, new Date(lastOut)) === day) {
|
|
204
|
+
const early = ranges[ranges.length - 1].to - minutesOfDay(lastOut, input.timeZone);
|
|
205
|
+
if (early > tolerance)
|
|
206
|
+
earlyMinutes = early;
|
|
207
|
+
}
|
|
208
|
+
const absent = ranges.length > 0 &&
|
|
209
|
+
dayShifts.length === 0 &&
|
|
210
|
+
(day < today || (day === today && nowMinutes >= ranges[ranges.length - 1].to));
|
|
211
|
+
return {
|
|
212
|
+
day,
|
|
213
|
+
ranges,
|
|
214
|
+
expectedMinutes: ranges.reduce((total, range) => total + (range.to - range.from), 0),
|
|
215
|
+
workedMinutes: dayShifts.reduce((total, shift) => total + shift.minutes, 0),
|
|
216
|
+
firstIn,
|
|
217
|
+
lastOut,
|
|
218
|
+
lateMinutes,
|
|
219
|
+
earlyMinutes,
|
|
220
|
+
absent,
|
|
221
|
+
incomplete: dayShifts.some((shift) => shift.incomplete),
|
|
222
|
+
open,
|
|
223
|
+
shifts: dayShifts,
|
|
224
|
+
};
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
exports.summarizeAttendance = summarizeAttendance;
|
|
228
|
+
const attendanceTotals = (days) => days.reduce((total, day) => ({
|
|
229
|
+
workedMinutes: total.workedMinutes + day.workedMinutes,
|
|
230
|
+
expectedMinutes: total.expectedMinutes + day.expectedMinutes,
|
|
231
|
+
lateDays: total.lateDays + (day.lateMinutes > 0 ? 1 : 0),
|
|
232
|
+
lateMinutes: total.lateMinutes + day.lateMinutes,
|
|
233
|
+
earlyDays: total.earlyDays + (day.earlyMinutes > 0 ? 1 : 0),
|
|
234
|
+
earlyMinutes: total.earlyMinutes + day.earlyMinutes,
|
|
235
|
+
absentDays: total.absentDays + (day.absent ? 1 : 0),
|
|
236
|
+
incompleteDays: total.incompleteDays + (day.incomplete ? 1 : 0),
|
|
237
|
+
extraMinutes: total.extraMinutes + (day.expectedMinutes > 0 ? Math.max(0, day.workedMinutes - day.expectedMinutes) : 0),
|
|
238
|
+
}), {
|
|
239
|
+
workedMinutes: 0,
|
|
240
|
+
expectedMinutes: 0,
|
|
241
|
+
lateDays: 0,
|
|
242
|
+
lateMinutes: 0,
|
|
243
|
+
earlyDays: 0,
|
|
244
|
+
earlyMinutes: 0,
|
|
245
|
+
absentDays: 0,
|
|
246
|
+
incompleteDays: 0,
|
|
247
|
+
extraMinutes: 0,
|
|
248
|
+
});
|
|
249
|
+
exports.attendanceTotals = attendanceTotals;
|
package/dist/booking.rules.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare const APPOINTMENT_SOURCE: {
|
|
|
47
47
|
readonly WEB: 2;
|
|
48
48
|
readonly WORKSHOP: 3;
|
|
49
49
|
readonly EMAIL: 4;
|
|
50
|
+
readonly APP: 5;
|
|
50
51
|
};
|
|
51
52
|
export type TAppointmentSource = (typeof APPOINTMENT_SOURCE)[keyof typeof APPOINTMENT_SOURCE];
|
|
52
53
|
export interface IWorkshopBooking {
|
package/dist/booking.rules.js
CHANGED
|
@@ -71,6 +71,8 @@ exports.APPOINTMENT_SOURCE = {
|
|
|
71
71
|
// DOC: Entró por el botón del correo del recordatorio. Va aparte de WEB para poder medir
|
|
72
72
|
// si ese botón vale lo que costó.
|
|
73
73
|
EMAIL: 4,
|
|
74
|
+
// DOC: La agendó el cliente desde la app móvil.
|
|
75
|
+
APP: 5,
|
|
74
76
|
};
|
|
75
77
|
// DOC: Ocho carros al día, cuatro por franja, con un día de anticipación y un mes de horizonte.
|
|
76
78
|
// Es un punto de partida razonable para un taller mediano; nada lo aplica solo.
|
|
@@ -39,4 +39,9 @@ export declare const canCompanySeeFullContact: ({ originCompany, company, linkSt
|
|
|
39
39
|
export declare const canCompanyEditContact: (access: ICompanyContactAccess) => boolean;
|
|
40
40
|
export declare const maskEmail: (email: string | null | undefined) => string | null;
|
|
41
41
|
export declare const maskPhone: (phone: string | null | undefined) => string | null;
|
|
42
|
+
export declare const CLIENT_DOCUMENT_DISPUTE_STATUS: {
|
|
43
|
+
readonly PENDING: 1;
|
|
44
|
+
readonly CONFIRMED: 2;
|
|
45
|
+
readonly CLOSED: 3;
|
|
46
|
+
};
|
|
42
47
|
export {};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//
|
|
6
6
|
// Módulo PURO: sin TypeORM, para que los fronts lo importen por ruta profunda.
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.maskPhone = exports.maskEmail = exports.canCompanyEditContact = exports.canCompanySeeFullContact = exports.CLIENT_VEHICLE_STATUS = exports.CLIENT_VEHICLE_ROLE = exports.COMPANY_LINK_SOURCE = exports.COMPANY_LINK_STATUS = exports.normalizeClientIdentity = exports.CLIENT_IDENTITY_TYPE = void 0;
|
|
8
|
+
exports.CLIENT_DOCUMENT_DISPUTE_STATUS = exports.maskPhone = exports.maskEmail = exports.canCompanyEditContact = exports.canCompanySeeFullContact = exports.CLIENT_VEHICLE_STATUS = exports.CLIENT_VEHICLE_ROLE = exports.COMPANY_LINK_SOURCE = exports.COMPANY_LINK_STATUS = exports.normalizeClientIdentity = exports.CLIENT_IDENTITY_TYPE = void 0;
|
|
9
9
|
// DOC: Con qué se entra a la app. Solo se guardan identidades YA verificadas.
|
|
10
10
|
exports.CLIENT_IDENTITY_TYPE = {
|
|
11
11
|
GOOGLE: 1,
|
|
@@ -93,3 +93,5 @@ const maskPhone = (phone) => {
|
|
|
93
93
|
return `*** *** ${digits.slice(-4)}`;
|
|
94
94
|
};
|
|
95
95
|
exports.maskPhone = maskPhone;
|
|
96
|
+
// DOC: `client_document_dispute.status` (sql/66): la cédula de la app que un taller verificó para otra persona.
|
|
97
|
+
exports.CLIENT_DOCUMENT_DISPUTE_STATUS = { PENDING: 1, CONFIRMED: 2, CLOSED: 3 };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Associate } from "./Associate";
|
|
2
|
+
import { Company } from "./Company";
|
|
3
|
+
import { Workshop } from "./Workshop";
|
|
4
|
+
export declare class AssociateNotification {
|
|
5
|
+
id: number;
|
|
6
|
+
associate: Associate;
|
|
7
|
+
company: Company;
|
|
8
|
+
workshop: Workshop | null;
|
|
9
|
+
kind: string;
|
|
10
|
+
params: Record<string, unknown> | null;
|
|
11
|
+
url: string | null;
|
|
12
|
+
read_at: Date | null;
|
|
13
|
+
created: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AssociateNotification = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Associate_1 = require("./Associate");
|
|
15
|
+
const Company_1 = require("./Company");
|
|
16
|
+
const Workshop_1 = require("./Workshop");
|
|
17
|
+
// DOC: La campana de asociados-web. Una fila por persona: el «leído» es de cada uno. El texto
|
|
18
|
+
// no se guarda; va el tipo y sus datos, y el front lo traduce.
|
|
19
|
+
let AssociateNotification = class AssociateNotification {
|
|
20
|
+
};
|
|
21
|
+
exports.AssociateNotification = AssociateNotification;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], AssociateNotification.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => Associate_1.Associate, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: "associate" }),
|
|
29
|
+
__metadata("design:type", Associate_1.Associate)
|
|
30
|
+
], AssociateNotification.prototype, "associate", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.ManyToOne)(() => Company_1.Company, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
33
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
34
|
+
__metadata("design:type", Company_1.Company)
|
|
35
|
+
], AssociateNotification.prototype, "company", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => Workshop_1.Workshop, { nullable: true, onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
38
|
+
(0, typeorm_1.JoinColumn)({ name: "workshop" }),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], AssociateNotification.prototype, "workshop", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 50, comment: "Tipo de aviso (STAFF_NOTIFICATION_KIND). El front lo traduce." }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AssociateNotification.prototype, "kind", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: "json", nullable: true, default: null, comment: "Datos del texto: placa, cliente, fecha..." }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], AssociateNotification.prototype, "params", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({
|
|
51
|
+
type: "varchar",
|
|
52
|
+
length: 255,
|
|
53
|
+
nullable: true,
|
|
54
|
+
default: null,
|
|
55
|
+
comment: "Pantalla a la que lleva (ruta del front, sin /app).",
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], AssociateNotification.prototype, "url", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ type: "datetime", nullable: true, default: null, comment: "Cuándo lo leyó. NULL = sin leer." }),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], AssociateNotification.prototype, "read_at", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro.", default: () => "CURRENT_TIMESTAMP" }),
|
|
65
|
+
__metadata("design:type", Date)
|
|
66
|
+
], AssociateNotification.prototype, "created", void 0);
|
|
67
|
+
exports.AssociateNotification = AssociateNotification = __decorate([
|
|
68
|
+
(0, typeorm_1.Entity)({
|
|
69
|
+
comment: "Campana de asociados-web: un aviso por persona.",
|
|
70
|
+
name: "associate_notification",
|
|
71
|
+
}),
|
|
72
|
+
(0, typeorm_1.Index)("IDX_associate_notification_inbox", ["associate", "read_at", "id"]),
|
|
73
|
+
(0, typeorm_1.Index)("IDX_associate_notification_created", ["created"])
|
|
74
|
+
], AssociateNotification);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AssociateSectionFeature = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const AssociateSection_1 = require("./AssociateSection");
|
|
15
|
+
const Feature_1 = require("./Feature");
|
|
16
|
+
// DOC: Una sección de permisos que sale con CUALQUIERA de varias funcionalidades (sql/68). El carné y
|
|
17
|
+
// los lectores sirven con las etiquetas NFC o con la asistencia; `associate_section.feature` es
|
|
18
|
+
// una sola, así que esa sección va NULL allá y lista sus funcionalidades acá.
|
|
19
|
+
let AssociateSectionFeature = class AssociateSectionFeature {
|
|
20
|
+
};
|
|
21
|
+
exports.AssociateSectionFeature = AssociateSectionFeature;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: "int", comment: "Número de identificación (ID) único de cada registro." }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], AssociateSectionFeature.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => AssociateSection_1.AssociateSection, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: "section" }),
|
|
29
|
+
__metadata("design:type", AssociateSection_1.AssociateSection)
|
|
30
|
+
], AssociateSectionFeature.prototype, "section", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.ManyToOne)(() => Feature_1.Feature, { onDelete: "CASCADE", onUpdate: "NO ACTION" }),
|
|
33
|
+
(0, typeorm_1.JoinColumn)({ name: "feature" }),
|
|
34
|
+
__metadata("design:type", Feature_1.Feature)
|
|
35
|
+
], AssociateSectionFeature.prototype, "feature", void 0);
|
|
36
|
+
exports.AssociateSectionFeature = AssociateSectionFeature = __decorate([
|
|
37
|
+
(0, typeorm_1.Entity)({
|
|
38
|
+
comment: "Secciones de permisos que salen con cualquiera de varias funcionalidades.",
|
|
39
|
+
name: "associate_section_feature",
|
|
40
|
+
}),
|
|
41
|
+
(0, typeorm_1.Unique)("UQ_associate_section_feature", ["section", "feature"])
|
|
42
|
+
], AssociateSectionFeature);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Company } from "./Company";
|
|
2
|
+
import { Workshop } from "./Workshop";
|
|
3
|
+
import { Associate } from "./Associate";
|
|
4
|
+
import { WorkshopReader } from "./WorkshopReader";
|
|
5
|
+
export declare class AttendanceMark {
|
|
6
|
+
id: number;
|
|
7
|
+
company: Company;
|
|
8
|
+
workshop: Workshop;
|
|
9
|
+
associate: Associate | null;
|
|
10
|
+
reader: WorkshopReader | null;
|
|
11
|
+
type: number;
|
|
12
|
+
method: number;
|
|
13
|
+
status: number;
|
|
14
|
+
marked_at: Date;
|
|
15
|
+
received_at: Date;
|
|
16
|
+
offline: number;
|
|
17
|
+
device_ref: string | null;
|
|
18
|
+
unresolved_value: string | null;
|
|
19
|
+
replaces: AttendanceMark | null;
|
|
20
|
+
note: string | null;
|
|
21
|
+
created_by: Associate | null;
|
|
22
|
+
voided_by: Associate | null;
|
|
23
|
+
voided_at: Date | null;
|
|
24
|
+
void_reason: string | null;
|
|
25
|
+
created: Date;
|
|
26
|
+
}
|