hvp-shared 6.52.0 → 6.53.1
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/constants/collaborator.constants.d.ts +2 -1
- package/dist/constants/collaborator.constants.js +1 -0
- package/dist/constants/employment.enums.d.ts +84 -0
- package/dist/constants/employment.enums.js +167 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/contracts/employment/index.d.ts +6 -0
- package/dist/contracts/employment/index.js +22 -0
- package/dist/contracts/employment/requests.d.ts +93 -0
- package/dist/contracts/employment/requests.js +2 -0
- package/dist/contracts/employment/responses.d.ts +85 -0
- package/dist/contracts/employment/responses.js +2 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +1 -0
- package/package.json +1 -1
|
@@ -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,84 @@
|
|
|
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
|
+
attendanceSource: AttendanceSource;
|
|
83
|
+
}
|
|
84
|
+
export declare const EMPLOYMENT_TYPE_DEFAULTS: Record<EmploymentType, EmploymentTypeDefaults>;
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
attendanceSource: AttendanceSource.attendance_records,
|
|
118
|
+
},
|
|
119
|
+
[EmploymentType.payroll_draft]: {
|
|
120
|
+
compensationType: CompensationType.salary,
|
|
121
|
+
hasCommissions: true,
|
|
122
|
+
hasImss: false,
|
|
123
|
+
payrollStampingMode: PayrollStampingMode.none,
|
|
124
|
+
scheduleType: ScheduleType.fixed,
|
|
125
|
+
attendanceSource: AttendanceSource.attendance_records,
|
|
126
|
+
},
|
|
127
|
+
[EmploymentType.intern]: {
|
|
128
|
+
compensationType: CompensationType.hourly,
|
|
129
|
+
hasCommissions: true,
|
|
130
|
+
hasImss: false,
|
|
131
|
+
payrollStampingMode: PayrollStampingMode.none,
|
|
132
|
+
scheduleType: ScheduleType.fixed,
|
|
133
|
+
attendanceSource: AttendanceSource.activity_register,
|
|
134
|
+
},
|
|
135
|
+
[EmploymentType.hourly_agreed]: {
|
|
136
|
+
compensationType: CompensationType.hourly,
|
|
137
|
+
hasCommissions: true,
|
|
138
|
+
hasImss: false,
|
|
139
|
+
payrollStampingMode: PayrollStampingMode.none,
|
|
140
|
+
scheduleType: ScheduleType.fixed,
|
|
141
|
+
attendanceSource: AttendanceSource.attendance_records,
|
|
142
|
+
},
|
|
143
|
+
[EmploymentType.casual]: {
|
|
144
|
+
compensationType: CompensationType.hourly,
|
|
145
|
+
hasCommissions: true,
|
|
146
|
+
hasImss: false,
|
|
147
|
+
payrollStampingMode: PayrollStampingMode.nominal,
|
|
148
|
+
scheduleType: ScheduleType.none,
|
|
149
|
+
attendanceSource: AttendanceSource.activity_register,
|
|
150
|
+
},
|
|
151
|
+
[EmploymentType.contractor]: {
|
|
152
|
+
compensationType: CompensationType.none,
|
|
153
|
+
hasCommissions: true,
|
|
154
|
+
hasImss: false,
|
|
155
|
+
payrollStampingMode: PayrollStampingMode.none,
|
|
156
|
+
scheduleType: ScheduleType.none,
|
|
157
|
+
attendanceSource: AttendanceSource.none,
|
|
158
|
+
},
|
|
159
|
+
[EmploymentType.coverage_only]: {
|
|
160
|
+
compensationType: CompensationType.none,
|
|
161
|
+
hasCommissions: false,
|
|
162
|
+
hasImss: false,
|
|
163
|
+
payrollStampingMode: PayrollStampingMode.nominal,
|
|
164
|
+
scheduleType: ScheduleType.none,
|
|
165
|
+
attendanceSource: AttendanceSource.none,
|
|
166
|
+
},
|
|
167
|
+
};
|
|
@@ -14,6 +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';
|
|
18
19
|
export * from './time-off.enums';
|
|
19
20
|
export * from './time-off.constants';
|
package/dist/constants/index.js
CHANGED
|
@@ -30,6 +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);
|
|
34
35
|
__exportStar(require("./time-off.enums"), exports);
|
|
35
36
|
__exportStar(require("./time-off.constants"), exports);
|
|
@@ -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,93 @@
|
|
|
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
|
+
seniorityBonusPercentage?: number;
|
|
25
|
+
commissionBonusPercentage?: number;
|
|
26
|
+
additionalFixedIncomes?: Array<{
|
|
27
|
+
concept: string;
|
|
28
|
+
amount: number;
|
|
29
|
+
}>;
|
|
30
|
+
otherDeductions?: Array<{
|
|
31
|
+
concept: string;
|
|
32
|
+
amount: number;
|
|
33
|
+
}>;
|
|
34
|
+
contributionBaseSalary?: number;
|
|
35
|
+
journeyType?: string;
|
|
36
|
+
cfdiPaymentFrequency?: string;
|
|
37
|
+
trainingSupport?: number;
|
|
38
|
+
physicalActivitySupport?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Update Employment Request
|
|
42
|
+
*
|
|
43
|
+
* Partial data to update an existing employment.
|
|
44
|
+
* All fields optional — only provided fields are updated.
|
|
45
|
+
* Computed fields (totalFixedIncome, etc.) are recalculated automatically.
|
|
46
|
+
*
|
|
47
|
+
* @example PATCH /api/employments/:id
|
|
48
|
+
*/
|
|
49
|
+
export interface UpdateEmploymentRequest {
|
|
50
|
+
jobId?: string;
|
|
51
|
+
isActive?: boolean;
|
|
52
|
+
employmentType?: EmploymentType;
|
|
53
|
+
compensationType?: CompensationType;
|
|
54
|
+
hasCommissions?: boolean;
|
|
55
|
+
hasImss?: boolean;
|
|
56
|
+
payrollStampingMode?: PayrollStampingMode;
|
|
57
|
+
scheduleType?: ScheduleType;
|
|
58
|
+
attendanceSource?: AttendanceSource;
|
|
59
|
+
employmentStartDate?: string;
|
|
60
|
+
employmentEndDate?: string;
|
|
61
|
+
weeklyHours?: number;
|
|
62
|
+
seniorityBonusPercentage?: number;
|
|
63
|
+
commissionBonusPercentage?: number;
|
|
64
|
+
additionalFixedIncomes?: Array<{
|
|
65
|
+
concept: string;
|
|
66
|
+
amount: number;
|
|
67
|
+
}>;
|
|
68
|
+
otherDeductions?: Array<{
|
|
69
|
+
concept: string;
|
|
70
|
+
amount: number;
|
|
71
|
+
}>;
|
|
72
|
+
contributionBaseSalary?: number;
|
|
73
|
+
journeyType?: string;
|
|
74
|
+
cfdiPaymentFrequency?: string;
|
|
75
|
+
trainingSupport?: number;
|
|
76
|
+
physicalActivitySupport?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Employment Query Filters
|
|
80
|
+
*
|
|
81
|
+
* Query parameters for filtering the employments list.
|
|
82
|
+
*
|
|
83
|
+
* @example GET /api/employments?isActive=true&employmentType=payroll
|
|
84
|
+
*/
|
|
85
|
+
export interface EmploymentQueryFilters {
|
|
86
|
+
isActive?: boolean;
|
|
87
|
+
collaboratorId?: string;
|
|
88
|
+
jobId?: string;
|
|
89
|
+
employmentType?: EmploymentType;
|
|
90
|
+
compensationType?: CompensationType;
|
|
91
|
+
scheduleType?: ScheduleType;
|
|
92
|
+
hasImss?: boolean;
|
|
93
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
seniorityBonusPercentage?: number;
|
|
38
|
+
commissionBonusPercentage?: number;
|
|
39
|
+
createdAt?: string;
|
|
40
|
+
updatedAt?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Admin Employment Response
|
|
44
|
+
*
|
|
45
|
+
* Complete employment data including all computed payroll values.
|
|
46
|
+
* Only for admin/manager users performing payroll or HR operations.
|
|
47
|
+
*
|
|
48
|
+
* Used for: Payroll management, employment editing, income calculations, CFDI.
|
|
49
|
+
*
|
|
50
|
+
* @example GET /api/employments/:id (admin)
|
|
51
|
+
*/
|
|
52
|
+
export interface AdminEmploymentResponse extends EmploymentViewResponse {
|
|
53
|
+
dailyWorkingHours?: number;
|
|
54
|
+
workWeekRatio?: number;
|
|
55
|
+
employmentFixedIncomeByJob?: number;
|
|
56
|
+
totalFixedIncome?: number;
|
|
57
|
+
employmentGuaranteedIncome?: number;
|
|
58
|
+
nominalDailyFixedIncome?: number;
|
|
59
|
+
nominalHourlyFixedIncome?: number;
|
|
60
|
+
effectiveDailyFixedIncome?: number;
|
|
61
|
+
effectiveHourlyFixedIncome?: number;
|
|
62
|
+
employmentHourlyRate?: number;
|
|
63
|
+
integratedDailySalary?: number;
|
|
64
|
+
contributionBaseSalary?: number;
|
|
65
|
+
journeyType?: string;
|
|
66
|
+
cfdiPaymentFrequency?: string;
|
|
67
|
+
additionalFixedIncomes?: Array<{
|
|
68
|
+
concept: string;
|
|
69
|
+
amount: number;
|
|
70
|
+
}>;
|
|
71
|
+
otherDeductions?: Array<{
|
|
72
|
+
concept: string;
|
|
73
|
+
amount: number;
|
|
74
|
+
}>;
|
|
75
|
+
averageCommissionsPerScheduledHour?: number;
|
|
76
|
+
averageOrdinaryIncomePerScheduledHour?: number;
|
|
77
|
+
trainingSupport?: number;
|
|
78
|
+
physicalActivitySupport?: number;
|
|
79
|
+
createdBy?: string;
|
|
80
|
+
updatedBy?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Union type for all employment response types
|
|
84
|
+
*/
|
|
85
|
+
export type EmploymentResponse = PublicEmploymentResponse | EmploymentViewResponse | AdminEmploymentResponse;
|
package/dist/contracts/index.js
CHANGED
|
@@ -19,6 +19,7 @@ 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);
|