hvp-shared 6.51.0 → 6.53.0

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.
@@ -14,7 +14,8 @@ export declare enum WebAppRole {
14
14
  manager = "Gerente",
15
15
  collaborator = "Colaborador",
16
16
  user = "User",
17
- guest = "Invitado"
17
+ guest = "Invitado",
18
+ no_access = "Sin acceso"
18
19
  }
19
20
  /**
20
21
  * Educational Degree
@@ -19,6 +19,7 @@ var WebAppRole;
19
19
  WebAppRole["collaborator"] = "Colaborador";
20
20
  WebAppRole["user"] = "User";
21
21
  WebAppRole["guest"] = "Invitado";
22
+ WebAppRole["no_access"] = "Sin acceso";
22
23
  })(WebAppRole || (exports.WebAppRole = WebAppRole = {}));
23
24
  /**
24
25
  * Educational Degree
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Employment Enums — HR Model Restructuring (GH10)
3
+ *
4
+ * New enums for the restructured Employment model.
5
+ * All enums follow the new standard: snake_case values + LABELS objects.
6
+ *
7
+ * @see .claude/rules/enums.md for conventions
8
+ */
9
+ /**
10
+ * Classifies the nature of the employment relationship.
11
+ *
12
+ * Each type has a defined set of defaults for compensation, IMSS,
13
+ * stamping mode, and schedule. See EMPLOYMENT_TYPE_DEFAULTS.
14
+ */
15
+ export declare enum EmploymentType {
16
+ payroll = "payroll",
17
+ payroll_draft = "payroll_draft",
18
+ intern = "intern",
19
+ hourly_agreed = "hourly_agreed",
20
+ casual = "casual",
21
+ contractor = "contractor",
22
+ coverage_only = "coverage_only"
23
+ }
24
+ export declare const EMPLOYMENT_TYPE_LABELS: Record<EmploymentType, string>;
25
+ /**
26
+ * How the collaborator is compensated.
27
+ */
28
+ export declare enum CompensationType {
29
+ salary = "salary",
30
+ hourly = "hourly",
31
+ per_service = "per_service",
32
+ none = "none"
33
+ }
34
+ export declare const COMPENSATION_TYPE_LABELS: Record<CompensationType, string>;
35
+ /**
36
+ * How the CFDI nómina is stamped for this employment.
37
+ *
38
+ * - ordinary: Full CFDI with real income (PAYROLL type)
39
+ * - nominal: CFDI with minimum wage for IMSS purposes (CASUAL, COVERAGE_ONLY)
40
+ * - none: No CFDI stamping (PAYROLL_DRAFT, INTERN, CONTRACTOR)
41
+ */
42
+ export declare enum PayrollStampingMode {
43
+ ordinary = "ordinary",
44
+ nominal = "nominal",
45
+ none = "none"
46
+ }
47
+ export declare const PAYROLL_STAMPING_MODE_LABELS: Record<PayrollStampingMode, string>;
48
+ /**
49
+ * What kind of schedule the employment follows.
50
+ *
51
+ * Also determines shift coverage: FIXED schedule = covers shifts.
52
+ */
53
+ export declare enum ScheduleType {
54
+ fixed = "fixed",
55
+ flexible = "flexible",
56
+ on_demand = "on_demand",
57
+ none = "none"
58
+ }
59
+ export declare const SCHEDULE_TYPE_LABELS: Record<ScheduleType, string>;
60
+ /**
61
+ * Source of attendance tracking for this employment.
62
+ *
63
+ * Replaces backend-only HRAttendanceSource enum.
64
+ */
65
+ export declare enum AttendanceSource {
66
+ attendance_records = "attendance_records",
67
+ activity_register = "activity_register",
68
+ none = "none"
69
+ }
70
+ export declare const ATTENDANCE_SOURCE_LABELS: Record<AttendanceSource, string>;
71
+ /**
72
+ * Default field values when creating a new Employment by type.
73
+ *
74
+ * These are pre-filled in the form and can be overridden by the user.
75
+ */
76
+ export interface EmploymentTypeDefaults {
77
+ compensationType: CompensationType;
78
+ hasCommissions: boolean;
79
+ hasImss: boolean;
80
+ payrollStampingMode: PayrollStampingMode;
81
+ scheduleType: ScheduleType;
82
+ maxWeeklyHours: number;
83
+ attendanceSource: AttendanceSource;
84
+ }
85
+ export declare const EMPLOYMENT_TYPE_DEFAULTS: Record<EmploymentType, EmploymentTypeDefaults>;
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ /**
3
+ * Employment Enums — HR Model Restructuring (GH10)
4
+ *
5
+ * New enums for the restructured Employment model.
6
+ * All enums follow the new standard: snake_case values + LABELS objects.
7
+ *
8
+ * @see .claude/rules/enums.md for conventions
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.EMPLOYMENT_TYPE_DEFAULTS = exports.ATTENDANCE_SOURCE_LABELS = exports.AttendanceSource = exports.SCHEDULE_TYPE_LABELS = exports.ScheduleType = exports.PAYROLL_STAMPING_MODE_LABELS = exports.PayrollStampingMode = exports.COMPENSATION_TYPE_LABELS = exports.CompensationType = exports.EMPLOYMENT_TYPE_LABELS = exports.EmploymentType = void 0;
12
+ // ─── Employment Type ─────────────────────────────────────────────────────────
13
+ /**
14
+ * Classifies the nature of the employment relationship.
15
+ *
16
+ * Each type has a defined set of defaults for compensation, IMSS,
17
+ * stamping mode, and schedule. See EMPLOYMENT_TYPE_DEFAULTS.
18
+ */
19
+ var EmploymentType;
20
+ (function (EmploymentType) {
21
+ EmploymentType["payroll"] = "payroll";
22
+ EmploymentType["payroll_draft"] = "payroll_draft";
23
+ EmploymentType["intern"] = "intern";
24
+ EmploymentType["hourly_agreed"] = "hourly_agreed";
25
+ EmploymentType["casual"] = "casual";
26
+ EmploymentType["contractor"] = "contractor";
27
+ EmploymentType["coverage_only"] = "coverage_only";
28
+ })(EmploymentType || (exports.EmploymentType = EmploymentType = {}));
29
+ exports.EMPLOYMENT_TYPE_LABELS = {
30
+ [EmploymentType.payroll]: "Nómina",
31
+ [EmploymentType.payroll_draft]: "Nómina simplificada",
32
+ [EmploymentType.intern]: "Practicante",
33
+ [EmploymentType.hourly_agreed]: "Horas convenidas",
34
+ [EmploymentType.casual]: "Eventual",
35
+ [EmploymentType.contractor]: "Contratista",
36
+ [EmploymentType.coverage_only]: "Solo cobertura",
37
+ };
38
+ // ─── Compensation Type ───────────────────────────────────────────────────────
39
+ /**
40
+ * How the collaborator is compensated.
41
+ */
42
+ var CompensationType;
43
+ (function (CompensationType) {
44
+ CompensationType["salary"] = "salary";
45
+ CompensationType["hourly"] = "hourly";
46
+ CompensationType["per_service"] = "per_service";
47
+ CompensationType["none"] = "none";
48
+ })(CompensationType || (exports.CompensationType = CompensationType = {}));
49
+ exports.COMPENSATION_TYPE_LABELS = {
50
+ [CompensationType.salary]: "Salario",
51
+ [CompensationType.hourly]: "Por hora",
52
+ [CompensationType.per_service]: "Por servicio",
53
+ [CompensationType.none]: "Sin compensación",
54
+ };
55
+ // ─── Payroll Stamping Mode ───────────────────────────────────────────────────
56
+ /**
57
+ * How the CFDI nómina is stamped for this employment.
58
+ *
59
+ * - ordinary: Full CFDI with real income (PAYROLL type)
60
+ * - nominal: CFDI with minimum wage for IMSS purposes (CASUAL, COVERAGE_ONLY)
61
+ * - none: No CFDI stamping (PAYROLL_DRAFT, INTERN, CONTRACTOR)
62
+ */
63
+ var PayrollStampingMode;
64
+ (function (PayrollStampingMode) {
65
+ PayrollStampingMode["ordinary"] = "ordinary";
66
+ PayrollStampingMode["nominal"] = "nominal";
67
+ PayrollStampingMode["none"] = "none";
68
+ })(PayrollStampingMode || (exports.PayrollStampingMode = PayrollStampingMode = {}));
69
+ exports.PAYROLL_STAMPING_MODE_LABELS = {
70
+ [PayrollStampingMode.ordinary]: "Ordinario",
71
+ [PayrollStampingMode.nominal]: "Nominal",
72
+ [PayrollStampingMode.none]: "Sin timbrado",
73
+ };
74
+ // ─── Schedule Type ───────────────────────────────────────────────────────────
75
+ /**
76
+ * What kind of schedule the employment follows.
77
+ *
78
+ * Also determines shift coverage: FIXED schedule = covers shifts.
79
+ */
80
+ var ScheduleType;
81
+ (function (ScheduleType) {
82
+ ScheduleType["fixed"] = "fixed";
83
+ ScheduleType["flexible"] = "flexible";
84
+ ScheduleType["on_demand"] = "on_demand";
85
+ ScheduleType["none"] = "none";
86
+ })(ScheduleType || (exports.ScheduleType = ScheduleType = {}));
87
+ exports.SCHEDULE_TYPE_LABELS = {
88
+ [ScheduleType.fixed]: "Fijo",
89
+ [ScheduleType.flexible]: "Flexible",
90
+ [ScheduleType.on_demand]: "Bajo demanda",
91
+ [ScheduleType.none]: "Sin horario",
92
+ };
93
+ // ─── Attendance Source ────────────────────────────────────────────────────────
94
+ /**
95
+ * Source of attendance tracking for this employment.
96
+ *
97
+ * Replaces backend-only HRAttendanceSource enum.
98
+ */
99
+ var AttendanceSource;
100
+ (function (AttendanceSource) {
101
+ AttendanceSource["attendance_records"] = "attendance_records";
102
+ AttendanceSource["activity_register"] = "activity_register";
103
+ AttendanceSource["none"] = "none";
104
+ })(AttendanceSource || (exports.AttendanceSource = AttendanceSource = {}));
105
+ exports.ATTENDANCE_SOURCE_LABELS = {
106
+ [AttendanceSource.attendance_records]: "Registro de asistencia",
107
+ [AttendanceSource.activity_register]: "Registro de actividades",
108
+ [AttendanceSource.none]: "Sin registro",
109
+ };
110
+ exports.EMPLOYMENT_TYPE_DEFAULTS = {
111
+ [EmploymentType.payroll]: {
112
+ compensationType: CompensationType.salary,
113
+ hasCommissions: true,
114
+ hasImss: true,
115
+ payrollStampingMode: PayrollStampingMode.ordinary,
116
+ scheduleType: ScheduleType.fixed,
117
+ maxWeeklyHours: 48,
118
+ attendanceSource: AttendanceSource.attendance_records,
119
+ },
120
+ [EmploymentType.payroll_draft]: {
121
+ compensationType: CompensationType.salary,
122
+ hasCommissions: true,
123
+ hasImss: false,
124
+ payrollStampingMode: PayrollStampingMode.none,
125
+ scheduleType: ScheduleType.fixed,
126
+ maxWeeklyHours: 48,
127
+ attendanceSource: AttendanceSource.attendance_records,
128
+ },
129
+ [EmploymentType.intern]: {
130
+ compensationType: CompensationType.hourly,
131
+ hasCommissions: true,
132
+ hasImss: false,
133
+ payrollStampingMode: PayrollStampingMode.none,
134
+ scheduleType: ScheduleType.fixed,
135
+ maxWeeklyHours: 36,
136
+ attendanceSource: AttendanceSource.activity_register,
137
+ },
138
+ [EmploymentType.hourly_agreed]: {
139
+ compensationType: CompensationType.hourly,
140
+ hasCommissions: true,
141
+ hasImss: false,
142
+ payrollStampingMode: PayrollStampingMode.none,
143
+ scheduleType: ScheduleType.fixed,
144
+ maxWeeklyHours: 48,
145
+ attendanceSource: AttendanceSource.attendance_records,
146
+ },
147
+ [EmploymentType.casual]: {
148
+ compensationType: CompensationType.hourly,
149
+ hasCommissions: true,
150
+ hasImss: false,
151
+ payrollStampingMode: PayrollStampingMode.nominal,
152
+ scheduleType: ScheduleType.none,
153
+ maxWeeklyHours: 48,
154
+ attendanceSource: AttendanceSource.activity_register,
155
+ },
156
+ [EmploymentType.contractor]: {
157
+ compensationType: CompensationType.none,
158
+ hasCommissions: true,
159
+ hasImss: false,
160
+ payrollStampingMode: PayrollStampingMode.none,
161
+ scheduleType: ScheduleType.none,
162
+ maxWeeklyHours: 48,
163
+ attendanceSource: AttendanceSource.none,
164
+ },
165
+ [EmploymentType.coverage_only]: {
166
+ compensationType: CompensationType.none,
167
+ hasCommissions: false,
168
+ hasImss: false,
169
+ payrollStampingMode: PayrollStampingMode.nominal,
170
+ scheduleType: ScheduleType.none,
171
+ maxWeeklyHours: 48,
172
+ attendanceSource: AttendanceSource.none,
173
+ },
174
+ };
@@ -14,4 +14,7 @@ export * from './job-category.constants';
14
14
  export * from './special-collaborators.constants';
15
15
  export * from './commissions.constants';
16
16
  export * from './hr.enums';
17
+ export * from './employment.enums';
17
18
  export * from './qvet-cash-flow.enums';
19
+ export * from './time-off.enums';
20
+ export * from './time-off.constants';
@@ -30,4 +30,7 @@ __exportStar(require("./job-category.constants"), exports);
30
30
  __exportStar(require("./special-collaborators.constants"), exports);
31
31
  __exportStar(require("./commissions.constants"), exports);
32
32
  __exportStar(require("./hr.enums"), exports);
33
+ __exportStar(require("./employment.enums"), exports);
33
34
  __exportStar(require("./qvet-cash-flow.enums"), exports);
35
+ __exportStar(require("./time-off.enums"), exports);
36
+ __exportStar(require("./time-off.constants"), exports);
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Time-Off Constants
3
+ *
4
+ * Mexican labor law vacation tables and related constants.
5
+ */
6
+ import { TimeOffType } from './time-off.enums';
7
+ /**
8
+ * Legal vacation days per anniversary year (Mexican Federal Labor Law, Art. 76).
9
+ *
10
+ * - `old`: Pre-2023 reform (Ley Federal del Trabajo original)
11
+ * - `new`: Post-2022 reform (effective Jan 1, 2023 — doubled minimums)
12
+ *
13
+ * Index = years of service (0 = year of hire, 1 = first anniversary, etc.)
14
+ * Values for ranges (e.g., years 5-9) are repeated for each year in range.
15
+ */
16
+ export declare const LEGAL_VACATIONS: {
17
+ readonly old: readonly [0, 6, 8, 10, 12, 14, 14, 14, 14, 14, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 20, 20, 20, 20, 20, 22, 22, 22, 22, 22, 24];
18
+ readonly new: readonly [0, 12, 14, 16, 18, 20, 22, 22, 22, 22, 22, 24, 24, 24, 24, 26, 26, 26, 26, 26, 28, 28, 28, 28, 28, 30, 30, 30, 30, 30, 30];
19
+ };
20
+ /**
21
+ * TimeOffTypes that consume vacation balance.
22
+ * Only these types count against a collaborator's vacation days.
23
+ */
24
+ export declare const VACATION_CONSUMING_TYPES: readonly TimeOffType[];
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ /**
3
+ * Time-Off Constants
4
+ *
5
+ * Mexican labor law vacation tables and related constants.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.VACATION_CONSUMING_TYPES = exports.LEGAL_VACATIONS = void 0;
9
+ const time_off_enums_1 = require("./time-off.enums");
10
+ /**
11
+ * Legal vacation days per anniversary year (Mexican Federal Labor Law, Art. 76).
12
+ *
13
+ * - `old`: Pre-2023 reform (Ley Federal del Trabajo original)
14
+ * - `new`: Post-2022 reform (effective Jan 1, 2023 — doubled minimums)
15
+ *
16
+ * Index = years of service (0 = year of hire, 1 = first anniversary, etc.)
17
+ * Values for ranges (e.g., years 5-9) are repeated for each year in range.
18
+ */
19
+ exports.LEGAL_VACATIONS = {
20
+ old: [
21
+ 0, // 0 years
22
+ 6, // 1
23
+ 8, // 2
24
+ 10, // 3
25
+ 12, // 4
26
+ 14, // 5
27
+ 14, // 6
28
+ 14, // 7
29
+ 14, // 8
30
+ 14, // 9
31
+ 16, // 10
32
+ 16, // 11
33
+ 16, // 12
34
+ 16, // 13
35
+ 16, // 14
36
+ 18, // 15
37
+ 18, // 16
38
+ 18, // 17
39
+ 18, // 18
40
+ 18, // 19
41
+ 20, // 20
42
+ 20, // 21
43
+ 20, // 22
44
+ 20, // 23
45
+ 20, // 24
46
+ 22, // 25
47
+ 22, // 26
48
+ 22, // 27
49
+ 22, // 28
50
+ 22, // 29
51
+ 24, // 30
52
+ ],
53
+ new: [
54
+ 0, // 0 years
55
+ 12, // 1
56
+ 14, // 2
57
+ 16, // 3
58
+ 18, // 4
59
+ 20, // 5
60
+ 22, // 6
61
+ 22, // 7
62
+ 22, // 8
63
+ 22, // 9
64
+ 22, // 10
65
+ 24, // 11
66
+ 24, // 12
67
+ 24, // 13
68
+ 24, // 14
69
+ 26, // 15
70
+ 26, // 16
71
+ 26, // 17
72
+ 26, // 18
73
+ 26, // 19
74
+ 28, // 20
75
+ 28, // 21
76
+ 28, // 22
77
+ 28, // 23
78
+ 28, // 24
79
+ 30, // 25
80
+ 30,
81
+ 30,
82
+ 30,
83
+ 30,
84
+ 30,
85
+ ],
86
+ };
87
+ /**
88
+ * TimeOffTypes that consume vacation balance.
89
+ * Only these types count against a collaborator's vacation days.
90
+ */
91
+ exports.VACATION_CONSUMING_TYPES = [
92
+ time_off_enums_1.TimeOffType.Vacation,
93
+ time_off_enums_1.TimeOffType.PersonalLeave,
94
+ ];
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Time-Off Request Enums
3
+ *
4
+ * Single source of truth for time-off request statuses and types.
5
+ * Used by both backend and frontend.
6
+ */
7
+ export declare enum TimeOffStatus {
8
+ Pending = "Pending",
9
+ Approved = "Approved",
10
+ Rejected = "Rejected",
11
+ Canceled = "Canceled"
12
+ }
13
+ export declare enum TimeOffType {
14
+ Vacation = "Vacation",
15
+ PersonalLeave = "Asuntos propios",
16
+ SickLeaveIMSS = "Incapacidad por IMSS",
17
+ ShiftToBeCompensated = "Jornada a reponer",
18
+ JustifiedAbsenceByCompany = "Inasistencia justificada por la empresa",
19
+ AuthorizedUnjustifiedAbsence = "Falta injustificada autorizada",
20
+ EarlyLeavePermission = "Permiso de salida anticipada",
21
+ LatePermission = "Permiso de llegar tarde",
22
+ CompensationShift = "Reposici\u00F3n de jornada"
23
+ }
24
+ /** Spanish display labels for TimeOffType */
25
+ export declare const TIME_OFF_TYPE_LABELS: Record<TimeOffType, string>;
26
+ /** Spanish display labels for TimeOffStatus */
27
+ export declare const TIME_OFF_STATUS_LABELS: Record<TimeOffStatus, string>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Time-Off Request Enums
4
+ *
5
+ * Single source of truth for time-off request statuses and types.
6
+ * Used by both backend and frontend.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.TIME_OFF_STATUS_LABELS = exports.TIME_OFF_TYPE_LABELS = exports.TimeOffType = exports.TimeOffStatus = void 0;
10
+ var TimeOffStatus;
11
+ (function (TimeOffStatus) {
12
+ TimeOffStatus["Pending"] = "Pending";
13
+ TimeOffStatus["Approved"] = "Approved";
14
+ TimeOffStatus["Rejected"] = "Rejected";
15
+ TimeOffStatus["Canceled"] = "Canceled";
16
+ })(TimeOffStatus || (exports.TimeOffStatus = TimeOffStatus = {}));
17
+ var TimeOffType;
18
+ (function (TimeOffType) {
19
+ TimeOffType["Vacation"] = "Vacation";
20
+ TimeOffType["PersonalLeave"] = "Asuntos propios";
21
+ TimeOffType["SickLeaveIMSS"] = "Incapacidad por IMSS";
22
+ TimeOffType["ShiftToBeCompensated"] = "Jornada a reponer";
23
+ TimeOffType["JustifiedAbsenceByCompany"] = "Inasistencia justificada por la empresa";
24
+ TimeOffType["AuthorizedUnjustifiedAbsence"] = "Falta injustificada autorizada";
25
+ TimeOffType["EarlyLeavePermission"] = "Permiso de salida anticipada";
26
+ TimeOffType["LatePermission"] = "Permiso de llegar tarde";
27
+ TimeOffType["CompensationShift"] = "Reposici\u00F3n de jornada";
28
+ })(TimeOffType || (exports.TimeOffType = TimeOffType = {}));
29
+ /** Spanish display labels for TimeOffType */
30
+ exports.TIME_OFF_TYPE_LABELS = {
31
+ [TimeOffType.Vacation]: 'Vacaciones',
32
+ [TimeOffType.PersonalLeave]: 'Asuntos propios',
33
+ [TimeOffType.SickLeaveIMSS]: 'Incapacidad por IMSS',
34
+ [TimeOffType.ShiftToBeCompensated]: 'Jornada a reponer',
35
+ [TimeOffType.JustifiedAbsenceByCompany]: 'Inasistencia justificada por la empresa',
36
+ [TimeOffType.AuthorizedUnjustifiedAbsence]: 'Falta injustificada autorizada',
37
+ [TimeOffType.EarlyLeavePermission]: 'Permiso de salida anticipada',
38
+ [TimeOffType.LatePermission]: 'Permiso de llegar tarde',
39
+ [TimeOffType.CompensationShift]: 'Reposición de jornada',
40
+ };
41
+ /** Spanish display labels for TimeOffStatus */
42
+ exports.TIME_OFF_STATUS_LABELS = {
43
+ [TimeOffStatus.Pending]: 'Pendiente',
44
+ [TimeOffStatus.Approved]: 'Aprobada',
45
+ [TimeOffStatus.Rejected]: 'Rechazada',
46
+ [TimeOffStatus.Canceled]: 'Cancelada',
47
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Employment API Contracts
3
+ * Request and Response types for Employment endpoints
4
+ */
5
+ export * from './responses';
6
+ export * from './requests';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Employment API Contracts
4
+ * Request and Response types for Employment endpoints
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./responses"), exports);
22
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,95 @@
1
+ import { EmploymentType, CompensationType, PayrollStampingMode, ScheduleType, AttendanceSource } from '../../constants/employment.enums';
2
+ /**
3
+ * Create Employment Request
4
+ *
5
+ * Data required to create a new employment record.
6
+ * Used by admin/manager roles.
7
+ *
8
+ * @example POST /api/employments
9
+ */
10
+ export interface CreateEmploymentRequest {
11
+ collaboratorId: string;
12
+ jobId: string;
13
+ isActive: boolean;
14
+ employmentType: EmploymentType;
15
+ compensationType: CompensationType;
16
+ hasCommissions: boolean;
17
+ hasImss: boolean;
18
+ payrollStampingMode: PayrollStampingMode;
19
+ scheduleType: ScheduleType;
20
+ attendanceSource: AttendanceSource;
21
+ employmentStartDate: string;
22
+ employmentEndDate?: string;
23
+ weeklyHours?: number;
24
+ maxWeeklyHours?: number;
25
+ seniorityBonusPercentage?: number;
26
+ commissionBonusPercentage?: number;
27
+ additionalFixedIncomes?: Array<{
28
+ concept: string;
29
+ amount: number;
30
+ }>;
31
+ otherDeductions?: Array<{
32
+ concept: string;
33
+ amount: number;
34
+ }>;
35
+ contributionBaseSalary?: number;
36
+ journeyType?: string;
37
+ cfdiPaymentFrequency?: string;
38
+ trainingSupport?: number;
39
+ physicalActivitySupport?: number;
40
+ }
41
+ /**
42
+ * Update Employment Request
43
+ *
44
+ * Partial data to update an existing employment.
45
+ * All fields optional — only provided fields are updated.
46
+ * Computed fields (totalFixedIncome, etc.) are recalculated automatically.
47
+ *
48
+ * @example PATCH /api/employments/:id
49
+ */
50
+ export interface UpdateEmploymentRequest {
51
+ jobId?: string;
52
+ isActive?: boolean;
53
+ employmentType?: EmploymentType;
54
+ compensationType?: CompensationType;
55
+ hasCommissions?: boolean;
56
+ hasImss?: boolean;
57
+ payrollStampingMode?: PayrollStampingMode;
58
+ scheduleType?: ScheduleType;
59
+ attendanceSource?: AttendanceSource;
60
+ employmentStartDate?: string;
61
+ employmentEndDate?: string;
62
+ weeklyHours?: number;
63
+ maxWeeklyHours?: number;
64
+ seniorityBonusPercentage?: number;
65
+ commissionBonusPercentage?: number;
66
+ additionalFixedIncomes?: Array<{
67
+ concept: string;
68
+ amount: number;
69
+ }>;
70
+ otherDeductions?: Array<{
71
+ concept: string;
72
+ amount: number;
73
+ }>;
74
+ contributionBaseSalary?: number;
75
+ journeyType?: string;
76
+ cfdiPaymentFrequency?: string;
77
+ trainingSupport?: number;
78
+ physicalActivitySupport?: number;
79
+ }
80
+ /**
81
+ * Employment Query Filters
82
+ *
83
+ * Query parameters for filtering the employments list.
84
+ *
85
+ * @example GET /api/employments?isActive=true&employmentType=payroll
86
+ */
87
+ export interface EmploymentQueryFilters {
88
+ isActive?: boolean;
89
+ collaboratorId?: string;
90
+ jobId?: string;
91
+ employmentType?: EmploymentType;
92
+ compensationType?: CompensationType;
93
+ scheduleType?: ScheduleType;
94
+ hasImss?: boolean;
95
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,86 @@
1
+ import { EmploymentType, CompensationType, PayrollStampingMode, ScheduleType, AttendanceSource } from '../../constants/employment.enums';
2
+ /**
3
+ * Public Employment Response
4
+ *
5
+ * Minimal employment data for non-sensitive contexts.
6
+ * Used for: Scheduling views, shift coverage checks, team displays.
7
+ *
8
+ * @example GET /api/employments/:id (authenticated)
9
+ */
10
+ export interface PublicEmploymentResponse {
11
+ id: string;
12
+ collaboratorId: string;
13
+ jobId: string;
14
+ isActive: boolean;
15
+ employmentType: EmploymentType;
16
+ scheduleType: ScheduleType;
17
+ employmentStartDate?: string;
18
+ employmentEndDate?: string;
19
+ }
20
+ /**
21
+ * Employment View Response
22
+ *
23
+ * Extended employment data for collaborators and managers.
24
+ * Includes work configuration but excludes payroll-sensitive computed values.
25
+ *
26
+ * Used for: Employment list, employment detail view, attendance config.
27
+ *
28
+ * @example GET /api/employments/:id (collaborator/manager)
29
+ */
30
+ export interface EmploymentViewResponse extends PublicEmploymentResponse {
31
+ compensationType: CompensationType;
32
+ attendanceSource: AttendanceSource;
33
+ hasCommissions: boolean;
34
+ hasImss: boolean;
35
+ payrollStampingMode: PayrollStampingMode;
36
+ weeklyHours?: number;
37
+ maxWeeklyHours: number;
38
+ seniorityBonusPercentage?: number;
39
+ commissionBonusPercentage?: number;
40
+ createdAt?: string;
41
+ updatedAt?: string;
42
+ }
43
+ /**
44
+ * Admin Employment Response
45
+ *
46
+ * Complete employment data including all computed payroll values.
47
+ * Only for admin/manager users performing payroll or HR operations.
48
+ *
49
+ * Used for: Payroll management, employment editing, income calculations, CFDI.
50
+ *
51
+ * @example GET /api/employments/:id (admin)
52
+ */
53
+ export interface AdminEmploymentResponse extends EmploymentViewResponse {
54
+ dailyWorkingHours?: number;
55
+ workWeekRatio?: number;
56
+ employmentFixedIncomeByJob?: number;
57
+ totalFixedIncome?: number;
58
+ employmentGuaranteedIncome?: number;
59
+ nominalDailyFixedIncome?: number;
60
+ nominalHourlyFixedIncome?: number;
61
+ effectiveDailyFixedIncome?: number;
62
+ effectiveHourlyFixedIncome?: number;
63
+ employmentHourlyRate?: number;
64
+ integratedDailySalary?: number;
65
+ contributionBaseSalary?: number;
66
+ journeyType?: string;
67
+ cfdiPaymentFrequency?: string;
68
+ additionalFixedIncomes?: Array<{
69
+ concept: string;
70
+ amount: number;
71
+ }>;
72
+ otherDeductions?: Array<{
73
+ concept: string;
74
+ amount: number;
75
+ }>;
76
+ averageCommissionsPerScheduledHour?: number;
77
+ averageOrdinaryIncomePerScheduledHour?: number;
78
+ trainingSupport?: number;
79
+ physicalActivitySupport?: number;
80
+ createdBy?: string;
81
+ updatedBy?: string;
82
+ }
83
+ /**
84
+ * Union type for all employment response types
85
+ */
86
+ export type EmploymentResponse = PublicEmploymentResponse | EmploymentViewResponse | AdminEmploymentResponse;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,8 +3,10 @@
3
3
  * Request and Response types for all API endpoints
4
4
  */
5
5
  export * from './collaborator';
6
+ export * from './employment';
6
7
  export * from './catalog-item';
7
8
  export * from './order-planning';
8
9
  export * from './qvet';
9
10
  export * from './stock-calculation';
10
11
  export * from './cash-reconciliation';
12
+ export * from './time-off-request';
@@ -19,8 +19,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  __exportStar(require("./collaborator"), exports);
22
+ __exportStar(require("./employment"), exports);
22
23
  __exportStar(require("./catalog-item"), exports);
23
24
  __exportStar(require("./order-planning"), exports);
24
25
  __exportStar(require("./qvet"), exports);
25
26
  __exportStar(require("./stock-calculation"), exports);
26
27
  __exportStar(require("./cash-reconciliation"), exports);
28
+ __exportStar(require("./time-off-request"), exports);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Time-Off Request API Contracts
3
+ * Request and Response types for Time-Off Request endpoints
4
+ */
5
+ export * from './responses';
6
+ export * from './requests';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Time-Off Request API Contracts
4
+ * Request and Response types for Time-Off Request endpoints
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./responses"), exports);
22
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Time-Off Request Request Types
3
+ *
4
+ * API request contracts for time-off request endpoints.
5
+ *
6
+ * @example POST /api/time-off-requests
7
+ * @example PATCH /api/time-off-requests/:id
8
+ */
9
+ import { TimeOffStatus, TimeOffType } from '../../constants/time-off.enums';
10
+ /**
11
+ * Create Time-Off Request
12
+ *
13
+ * Used for: Submitting a new time-off request.
14
+ *
15
+ * @example POST /api/time-off-requests
16
+ */
17
+ export interface CreateTimeOffRequestRequest {
18
+ collaborator: string;
19
+ requestedDays: string[];
20
+ timeOffType: TimeOffType;
21
+ collaboratorNote?: string;
22
+ /** Optional: admin-created requests can set status directly */
23
+ status?: TimeOffStatus;
24
+ approvedAt?: string;
25
+ approvedBy?: string;
26
+ }
27
+ /**
28
+ * Update Time-Off Request
29
+ *
30
+ * Used for: Modifying an existing time-off request (approval, notes, etc.)
31
+ *
32
+ * @example PATCH /api/time-off-requests/:id
33
+ */
34
+ export interface UpdateTimeOffRequestRequest {
35
+ status?: TimeOffStatus;
36
+ managerNote?: string;
37
+ requestedDays?: string[];
38
+ timeOffType?: TimeOffType;
39
+ collaboratorNote?: string;
40
+ approvedAt?: string;
41
+ approvedBy?: string;
42
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * Time-Off Request Request Types
4
+ *
5
+ * API request contracts for time-off request endpoints.
6
+ *
7
+ * @example POST /api/time-off-requests
8
+ * @example PATCH /api/time-off-requests/:id
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Time-Off Request Response Types
3
+ *
4
+ * API response contracts for time-off request endpoints.
5
+ *
6
+ * @example GET /api/time-off-requests
7
+ * @example GET /api/time-off-requests/collaborators/time-off-overview/:id
8
+ */
9
+ import { TimeOffStatus, TimeOffType } from '../../constants/time-off.enums';
10
+ /**
11
+ * Annual vacation period breakdown.
12
+ *
13
+ * Each period represents one anniversary year, showing how many days
14
+ * were earned, taken, and the running accumulated balance.
15
+ *
16
+ * Used in: CollaboratorTimeOffOverviewResponse.vacationPeriods
17
+ */
18
+ export interface VacationPeriodResponse {
19
+ /** Period start (anniversary date or hire date for first period) */
20
+ startDate: string;
21
+ /** Period end (next anniversary or current date for incomplete period) */
22
+ endDate: string;
23
+ /** Days earned by law at this anniversary (0 for current incomplete period) */
24
+ legalVacationDays: number;
25
+ /** Company-given extra days (2/year from 2025) */
26
+ extraVacationDays: number;
27
+ /** Pro-rated days for current incomplete period */
28
+ provisionalVacationDays: number;
29
+ /** legalVacationDays + extraVacationDays + provisionalVacationDays */
30
+ totalVacationDays: number;
31
+ /** Days taken (approved + pending) in this period */
32
+ vacationDaysTaken: number;
33
+ /** totalVacationDays - vacationDaysTaken */
34
+ periodBalance: number;
35
+ /** Running total balance across all periods up to this one */
36
+ accumulatedBalance: number;
37
+ }
38
+ /**
39
+ * Collaborator Time-Off Overview
40
+ *
41
+ * Complete vacation summary for a single collaborator, including
42
+ * annual period breakdown.
43
+ *
44
+ * Used for: User profile vacation info, admin vacation dashboard.
45
+ *
46
+ * @example GET /api/time-off-requests/collaborators/time-off-overview/:id
47
+ */
48
+ export interface CollaboratorTimeOffOverviewResponse {
49
+ collaboratorId: string;
50
+ lastAnniversaryDate: string;
51
+ totalVacationDays: number;
52
+ legalVacationDays: number;
53
+ /** Count of approved vacation dates */
54
+ vacationDaysTaken: number;
55
+ /** Count of pending vacation dates */
56
+ vacationDaysRequested: number;
57
+ remainingVacationDays: number;
58
+ remainingLegalVacationDays: number;
59
+ remainingCurrentYearVacationDays: number;
60
+ /** Annual breakdown of vacation accrual and usage */
61
+ vacationPeriods: VacationPeriodResponse[];
62
+ dateTimeOffRequests: DateTimeOffRequestResponse[];
63
+ }
64
+ /**
65
+ * Individual date within a time-off request.
66
+ *
67
+ * Flattened view: one entry per date per request.
68
+ */
69
+ export interface DateTimeOffRequestResponse {
70
+ date: string;
71
+ id: string;
72
+ timeOffType: TimeOffType;
73
+ status: TimeOffStatus;
74
+ collaborator: string;
75
+ }
76
+ /**
77
+ * Time-Off Request Item
78
+ *
79
+ * Single time-off request as returned by list/detail endpoints.
80
+ *
81
+ * @example GET /api/time-off-requests
82
+ * @example GET /api/time-off-requests/:id
83
+ */
84
+ export interface TimeOffRequestItemResponse {
85
+ id: string;
86
+ collaborator: string;
87
+ requestedAt: string;
88
+ requestedDays: string[];
89
+ timeOffType: TimeOffType;
90
+ status: TimeOffStatus;
91
+ collaboratorNote?: string;
92
+ managerNote?: string;
93
+ approvedAt?: string;
94
+ approvedBy?: string;
95
+ createdAt: string;
96
+ createdBy?: string;
97
+ updatedAt: string;
98
+ updatedBy?: string;
99
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * Time-Off Request Response Types
4
+ *
5
+ * API response contracts for time-off request endpoints.
6
+ *
7
+ * @example GET /api/time-off-requests
8
+ * @example GET /api/time-off-requests/collaborators/time-off-overview/:id
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.51.0",
3
+ "version": "6.53.0",
4
4
  "description": "Shared types and utilities for HVP backend and frontend",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",