hvp-shared 6.79.0 → 6.81.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.
- package/dist/constants/hr.enums.d.ts +2 -0
- package/dist/constants/hr.enums.js +15 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/settlement.enums.d.ts +12 -0
- package/dist/constants/settlement.enums.js +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/payroll-v2.types.d.ts +4 -0
- package/dist/utils/enum.helpers.d.ts +12 -0
- package/dist/utils/enum.helpers.js +17 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export declare enum PayrollStatus {
|
|
|
10
10
|
Paid = "paid",
|
|
11
11
|
Billed = "billed"
|
|
12
12
|
}
|
|
13
|
+
export declare const PAYROLL_STATUS_LABELS: Record<PayrollStatus, string>;
|
|
13
14
|
export declare enum CfdiStatus {
|
|
14
15
|
Pending = "pending",
|
|
15
16
|
Ready = "ready",
|
|
@@ -18,6 +19,7 @@ export declare enum CfdiStatus {
|
|
|
18
19
|
Cancelled = "cancelled",
|
|
19
20
|
Error = "error"
|
|
20
21
|
}
|
|
22
|
+
export declare const CFDI_STATUS_LABELS: Record<CfdiStatus, string>;
|
|
21
23
|
export declare enum HRPaymentType {
|
|
22
24
|
HOURLY = "HOURLY",
|
|
23
25
|
SALARY = "SALARY",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Single source of truth lives here in hvp-shared.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.HRPaymentType = exports.CfdiStatus = exports.PayrollStatus = void 0;
|
|
9
|
+
exports.HRPaymentType = exports.CFDI_STATUS_LABELS = exports.CfdiStatus = exports.PAYROLL_STATUS_LABELS = exports.PayrollStatus = void 0;
|
|
10
10
|
var PayrollStatus;
|
|
11
11
|
(function (PayrollStatus) {
|
|
12
12
|
PayrollStatus["Pending"] = "pending";
|
|
@@ -14,6 +14,12 @@ var PayrollStatus;
|
|
|
14
14
|
PayrollStatus["Paid"] = "paid";
|
|
15
15
|
PayrollStatus["Billed"] = "billed";
|
|
16
16
|
})(PayrollStatus || (exports.PayrollStatus = PayrollStatus = {}));
|
|
17
|
+
exports.PAYROLL_STATUS_LABELS = {
|
|
18
|
+
[PayrollStatus.Pending]: "Pendiente",
|
|
19
|
+
[PayrollStatus.Approved]: "Aprobada",
|
|
20
|
+
[PayrollStatus.Paid]: "Pagada",
|
|
21
|
+
[PayrollStatus.Billed]: "Facturada",
|
|
22
|
+
};
|
|
17
23
|
var CfdiStatus;
|
|
18
24
|
(function (CfdiStatus) {
|
|
19
25
|
CfdiStatus["Pending"] = "pending";
|
|
@@ -23,6 +29,14 @@ var CfdiStatus;
|
|
|
23
29
|
CfdiStatus["Cancelled"] = "cancelled";
|
|
24
30
|
CfdiStatus["Error"] = "error";
|
|
25
31
|
})(CfdiStatus || (exports.CfdiStatus = CfdiStatus = {}));
|
|
32
|
+
exports.CFDI_STATUS_LABELS = {
|
|
33
|
+
[CfdiStatus.Pending]: "Pendiente",
|
|
34
|
+
[CfdiStatus.Ready]: "Lista",
|
|
35
|
+
[CfdiStatus.Stamped]: "Timbrada",
|
|
36
|
+
[CfdiStatus.StampedExternal]: "Timbrada (externo)",
|
|
37
|
+
[CfdiStatus.Cancelled]: "Cancelada",
|
|
38
|
+
[CfdiStatus.Error]: "Error",
|
|
39
|
+
};
|
|
26
40
|
var HRPaymentType;
|
|
27
41
|
(function (HRPaymentType) {
|
|
28
42
|
HRPaymentType["HOURLY"] = "HOURLY";
|
package/dist/constants/index.js
CHANGED
|
@@ -39,3 +39,4 @@ __exportStar(require("./hris.constants"), exports);
|
|
|
39
39
|
__exportStar(require("./payroll-features.constants"), exports);
|
|
40
40
|
__exportStar(require("./inventory-session.enums"), exports);
|
|
41
41
|
__exportStar(require("./documentation.enums"), exports);
|
|
42
|
+
__exportStar(require("./settlement.enums"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settlement/Termination enums — finiquito and liquidación.
|
|
3
|
+
* Per Mexican Federal Labor Law (LFT).
|
|
4
|
+
*/
|
|
5
|
+
export declare enum SeparationType {
|
|
6
|
+
voluntaryResignation = "voluntary_resignation",
|
|
7
|
+
unjustifiedDismissal = "unjustified_dismissal",
|
|
8
|
+
constructiveDismissal = "constructive_dismissal",
|
|
9
|
+
endOfContract = "end_of_contract",
|
|
10
|
+
mutualAgreement = "mutual_agreement"
|
|
11
|
+
}
|
|
12
|
+
export declare const SEPARATION_TYPE_LABELS: Record<SeparationType, string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Settlement/Termination enums — finiquito and liquidación.
|
|
4
|
+
* Per Mexican Federal Labor Law (LFT).
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SEPARATION_TYPE_LABELS = exports.SeparationType = void 0;
|
|
8
|
+
var SeparationType;
|
|
9
|
+
(function (SeparationType) {
|
|
10
|
+
SeparationType["voluntaryResignation"] = "voluntary_resignation";
|
|
11
|
+
SeparationType["unjustifiedDismissal"] = "unjustified_dismissal";
|
|
12
|
+
SeparationType["constructiveDismissal"] = "constructive_dismissal";
|
|
13
|
+
SeparationType["endOfContract"] = "end_of_contract";
|
|
14
|
+
SeparationType["mutualAgreement"] = "mutual_agreement";
|
|
15
|
+
})(SeparationType || (exports.SeparationType = SeparationType = {}));
|
|
16
|
+
exports.SEPARATION_TYPE_LABELS = {
|
|
17
|
+
[SeparationType.voluntaryResignation]: "Renuncia voluntaria",
|
|
18
|
+
[SeparationType.unjustifiedDismissal]: "Despido injustificado",
|
|
19
|
+
[SeparationType.constructiveDismissal]: "Rescisión imputable al patrón",
|
|
20
|
+
[SeparationType.endOfContract]: "Fin de contrato",
|
|
21
|
+
[SeparationType.mutualAgreement]: "Mutuo acuerdo",
|
|
22
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -28,3 +28,4 @@ Object.defineProperty(exports, "debugLog", { enumerable: true, get: function ()
|
|
|
28
28
|
__exportStar(require("./utils/sync-field.helpers"), exports);
|
|
29
29
|
__exportStar(require("./utils/qvet-catalog.helpers"), exports);
|
|
30
30
|
__exportStar(require("./utils/qvet-staff.helpers"), exports);
|
|
31
|
+
__exportStar(require("./utils/enum.helpers"), exports);
|
|
@@ -142,7 +142,11 @@ export interface NominalPayrollData {
|
|
|
142
142
|
readonly totals: PayrollV2Totals;
|
|
143
143
|
readonly cfdi?: PayrollV2Cfdi;
|
|
144
144
|
}
|
|
145
|
+
/** Distinguishes ordinary payrolls from settlement (finiquito/liquidación) */
|
|
146
|
+
export type PayrollType = "ordinary" | "settlement";
|
|
145
147
|
export interface PayrollV2 {
|
|
148
|
+
/** "ordinary" (default) or "settlement". Absent on old payrolls = ordinary. */
|
|
149
|
+
readonly payrollType?: PayrollType;
|
|
146
150
|
readonly collaboratorId?: string;
|
|
147
151
|
readonly employmentId?: string;
|
|
148
152
|
readonly jobId?: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a Record<EnumValue, Label> into an array of { label, value } options
|
|
3
|
+
* ready for select/dropdown components.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const options = enumToOptions(COMPENSATION_TYPE_LABELS);
|
|
7
|
+
* // [{ label: "Salario", value: "salary" }, { label: "Por hora", value: "hourly" }, ...]
|
|
8
|
+
*/
|
|
9
|
+
export declare function enumToOptions<T extends string>(labels: Record<T, string>): {
|
|
10
|
+
label: string;
|
|
11
|
+
value: T;
|
|
12
|
+
}[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enumToOptions = enumToOptions;
|
|
4
|
+
/**
|
|
5
|
+
* Converts a Record<EnumValue, Label> into an array of { label, value } options
|
|
6
|
+
* ready for select/dropdown components.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const options = enumToOptions(COMPENSATION_TYPE_LABELS);
|
|
10
|
+
* // [{ label: "Salario", value: "salary" }, { label: "Por hora", value: "hourly" }, ...]
|
|
11
|
+
*/
|
|
12
|
+
function enumToOptions(labels) {
|
|
13
|
+
return Object.entries(labels).map(([value, label]) => ({
|
|
14
|
+
label,
|
|
15
|
+
value,
|
|
16
|
+
}));
|
|
17
|
+
}
|