hvp-shared 6.34.0 → 6.36.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/background-job.constants.d.ts +4 -1
- package/dist/constants/background-job.constants.js +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/payroll-v2.types.d.ts +115 -0
- package/dist/types/payroll-v2.types.js +38 -0
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ export declare enum JobType {
|
|
|
20
20
|
SYNC_PURCHASE_ORDERS = "SYNC_PURCHASE_ORDERS",
|
|
21
21
|
SYNC_STOCK_CONFIG = "SYNC_STOCK_CONFIG",
|
|
22
22
|
SYNC_CATALOG = "SYNC_CATALOG",
|
|
23
|
+
SYNC_SUPPLIERS = "SYNC_SUPPLIERS",
|
|
23
24
|
SYNC_CLIENTS = "SYNC_CLIENTS",
|
|
24
25
|
SYNC_INVENTORY_SNAPSHOT = "SYNC_INVENTORY_SNAPSHOT",
|
|
25
26
|
SYNC_BATCH = "SYNC_BATCH",
|
|
@@ -55,7 +56,9 @@ export declare enum ReportType {
|
|
|
55
56
|
/** Product catalog - no date params required */
|
|
56
57
|
CATALOG = "CATALOG",
|
|
57
58
|
/** Stock configuration - no date params required */
|
|
58
|
-
STOCK_CONFIG = "STOCK_CONFIG"
|
|
59
|
+
STOCK_CONFIG = "STOCK_CONFIG",
|
|
60
|
+
/** Suppliers catalog - no date params required */
|
|
61
|
+
SUPPLIERS = "SUPPLIERS"
|
|
59
62
|
}
|
|
60
63
|
/**
|
|
61
64
|
* Sub-task status within a batch job
|
|
@@ -24,6 +24,7 @@ var JobType;
|
|
|
24
24
|
JobType["SYNC_PURCHASE_ORDERS"] = "SYNC_PURCHASE_ORDERS";
|
|
25
25
|
JobType["SYNC_STOCK_CONFIG"] = "SYNC_STOCK_CONFIG";
|
|
26
26
|
JobType["SYNC_CATALOG"] = "SYNC_CATALOG";
|
|
27
|
+
JobType["SYNC_SUPPLIERS"] = "SYNC_SUPPLIERS";
|
|
27
28
|
JobType["SYNC_CLIENTS"] = "SYNC_CLIENTS";
|
|
28
29
|
JobType["SYNC_INVENTORY_SNAPSHOT"] = "SYNC_INVENTORY_SNAPSHOT";
|
|
29
30
|
JobType["SYNC_BATCH"] = "SYNC_BATCH";
|
|
@@ -61,6 +62,8 @@ var ReportType;
|
|
|
61
62
|
ReportType["CATALOG"] = "CATALOG";
|
|
62
63
|
/** Stock configuration - no date params required */
|
|
63
64
|
ReportType["STOCK_CONFIG"] = "STOCK_CONFIG";
|
|
65
|
+
/** Suppliers catalog - no date params required */
|
|
66
|
+
ReportType["SUPPLIERS"] = "SUPPLIERS";
|
|
64
67
|
})(ReportType || (exports.ReportType = ReportType = {}));
|
|
65
68
|
/**
|
|
66
69
|
* Sub-task status within a batch job
|
|
@@ -90,6 +93,7 @@ exports.REPORT_PARAM_TYPES = {
|
|
|
90
93
|
[ReportType.CLIENTS]: 'no_params',
|
|
91
94
|
[ReportType.CATALOG]: 'no_params',
|
|
92
95
|
[ReportType.STOCK_CONFIG]: 'no_params',
|
|
96
|
+
[ReportType.SUPPLIERS]: 'no_params',
|
|
93
97
|
};
|
|
94
98
|
/**
|
|
95
99
|
* Job execution status
|
|
@@ -128,6 +132,7 @@ exports.JOB_TYPE_LABELS = {
|
|
|
128
132
|
[JobType.SYNC_PURCHASE_ORDERS]: 'Sincronizar Pedidos',
|
|
129
133
|
[JobType.SYNC_STOCK_CONFIG]: 'Sincronizar Config. Stock',
|
|
130
134
|
[JobType.SYNC_CATALOG]: 'Sincronizar Catálogo',
|
|
135
|
+
[JobType.SYNC_SUPPLIERS]: 'Sincronizar Proveedores',
|
|
131
136
|
[JobType.SYNC_CLIENTS]: 'Sincronizar Clientes',
|
|
132
137
|
[JobType.SYNC_INVENTORY_SNAPSHOT]: 'Sincronizar Snapshot Inventario',
|
|
133
138
|
[JobType.SYNC_BATCH]: 'Sincronización por Lotes',
|
|
@@ -150,6 +155,7 @@ exports.REPORT_TYPE_LABELS = {
|
|
|
150
155
|
[ReportType.CLIENTS]: 'Clientes',
|
|
151
156
|
[ReportType.CATALOG]: 'Catálogo',
|
|
152
157
|
[ReportType.STOCK_CONFIG]: 'Config. Stock',
|
|
158
|
+
[ReportType.SUPPLIERS]: 'Proveedores',
|
|
153
159
|
};
|
|
154
160
|
/**
|
|
155
161
|
* Human-readable labels for sub-task status (Spanish for UI)
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -26,3 +26,4 @@ __exportStar(require("./sync-field.types"), exports);
|
|
|
26
26
|
__exportStar(require("./catalog-item.types"), exports);
|
|
27
27
|
__exportStar(require("./qvet.types"), exports);
|
|
28
28
|
__exportStar(require("./background-job.types"), exports);
|
|
29
|
+
__exportStar(require("./payroll-v2.types"), exports);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PayrollV2 Types — unified PayrollItem-based model.
|
|
3
|
+
*
|
|
4
|
+
* Each item is self-describing: carries SAT codes, taxed/exempt split,
|
|
5
|
+
* source key for internal reference, and an optional formula explaining
|
|
6
|
+
* how the amount was calculated.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: CfdiStatus and PayrollStatus enums are NOT imported here because
|
|
9
|
+
* they live in repo-specific enum files (used in 19+ files each). Instead,
|
|
10
|
+
* the `status` and `payrollStatus` fields use `string`, which is compatible
|
|
11
|
+
* since TypeScript string enum values ARE strings.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum PayrollItemCategory {
|
|
14
|
+
BASE_SALARY = "BASE_SALARY",
|
|
15
|
+
ADDITIONAL_FIXED = "ADDITIONAL_FIXED",
|
|
16
|
+
COMMISSION = "COMMISSION",
|
|
17
|
+
BONUS = "BONUS",
|
|
18
|
+
OVERTIME = "OVERTIME",
|
|
19
|
+
HOLIDAY_PAY = "HOLIDAY_PAY",
|
|
20
|
+
YEAR_END_BONUS = "YEAR_END_BONUS",
|
|
21
|
+
VACATION_BONUS = "VACATION_BONUS",
|
|
22
|
+
PROFIT_SHARING = "PROFIT_SHARING",
|
|
23
|
+
SUBSIDY = "SUBSIDY",
|
|
24
|
+
SUPPORT = "SUPPORT",
|
|
25
|
+
COMPENSATION = "COMPENSATION",
|
|
26
|
+
TAX = "TAX",
|
|
27
|
+
SOCIAL_SECURITY = "SOCIAL_SECURITY",
|
|
28
|
+
ATTENDANCE_DISCOUNT = "ATTENDANCE_DISCOUNT",
|
|
29
|
+
OTHER_DEDUCTION = "OTHER_DEDUCTION",
|
|
30
|
+
OTHER_PAYMENT = "OTHER_PAYMENT"
|
|
31
|
+
}
|
|
32
|
+
export interface PayrollFormula {
|
|
33
|
+
readonly expression: string;
|
|
34
|
+
readonly inputs: Record<string, number>;
|
|
35
|
+
readonly result: number;
|
|
36
|
+
}
|
|
37
|
+
export interface PayrollItem {
|
|
38
|
+
readonly satCode?: string;
|
|
39
|
+
readonly satType?: string;
|
|
40
|
+
readonly description: string;
|
|
41
|
+
readonly amount: number;
|
|
42
|
+
readonly taxedAmount?: number;
|
|
43
|
+
readonly exemptAmount?: number;
|
|
44
|
+
readonly sourceKey: string;
|
|
45
|
+
readonly category: PayrollItemCategory;
|
|
46
|
+
readonly formula?: PayrollFormula;
|
|
47
|
+
readonly isEditable: boolean;
|
|
48
|
+
readonly notes?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface PayrollV2Totals {
|
|
51
|
+
readonly totalPerceptions: number;
|
|
52
|
+
readonly totalDeductions: number;
|
|
53
|
+
readonly totalOtherPayments: number;
|
|
54
|
+
readonly totalTaxed: number;
|
|
55
|
+
readonly totalExempt: number;
|
|
56
|
+
readonly netPay: number;
|
|
57
|
+
}
|
|
58
|
+
export interface PayrollCalculationContext {
|
|
59
|
+
readonly attendanceFactor?: number;
|
|
60
|
+
readonly dailyUma: number;
|
|
61
|
+
readonly isrBracketUsed?: string;
|
|
62
|
+
readonly subsidioCausado?: number;
|
|
63
|
+
readonly isrCausado?: number;
|
|
64
|
+
readonly employerImssRate?: number;
|
|
65
|
+
readonly workedHours: number;
|
|
66
|
+
readonly hourlyRate?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface PayrollEmployeeSnapshot {
|
|
69
|
+
readonly fullName: string;
|
|
70
|
+
readonly collaboratorCode: string;
|
|
71
|
+
readonly imgUrl?: string;
|
|
72
|
+
readonly curp?: string;
|
|
73
|
+
readonly rfc?: string;
|
|
74
|
+
readonly socialSecurityNumber?: string;
|
|
75
|
+
readonly jobTitle: string;
|
|
76
|
+
readonly paymentType: string;
|
|
77
|
+
readonly contributionBaseSalary: number;
|
|
78
|
+
readonly fiscalRegime?: string;
|
|
79
|
+
readonly taxZipCode?: string;
|
|
80
|
+
readonly startDateLaborRelations?: string;
|
|
81
|
+
readonly contractType?: string;
|
|
82
|
+
readonly regimeType?: string;
|
|
83
|
+
readonly federalEntityKey?: string;
|
|
84
|
+
readonly bank?: string;
|
|
85
|
+
readonly bankAccount?: string;
|
|
86
|
+
readonly typeOfJourney?: string;
|
|
87
|
+
readonly frequencyPayment?: string;
|
|
88
|
+
readonly positionRisk?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface PayrollV2Cfdi {
|
|
91
|
+
/** CfdiStatus value — typed as string to avoid coupling to repo-specific enums */
|
|
92
|
+
readonly status: string;
|
|
93
|
+
readonly uuid?: string;
|
|
94
|
+
readonly facturamaId?: string;
|
|
95
|
+
readonly stampedAt?: Date | string;
|
|
96
|
+
readonly cancelledAt?: Date | string;
|
|
97
|
+
readonly errorMessage?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface PayrollV2 {
|
|
100
|
+
readonly collaboratorId?: string;
|
|
101
|
+
readonly employmentId?: string;
|
|
102
|
+
readonly jobId?: string;
|
|
103
|
+
readonly periodStartDate?: string;
|
|
104
|
+
readonly periodEndDate?: string;
|
|
105
|
+
/** PayrollStatus value — typed as string to avoid coupling to repo-specific enums */
|
|
106
|
+
readonly payrollStatus?: string;
|
|
107
|
+
readonly daysPaid?: number;
|
|
108
|
+
readonly perceptions: PayrollItem[];
|
|
109
|
+
readonly deductions: PayrollItem[];
|
|
110
|
+
readonly otherPayments: PayrollItem[];
|
|
111
|
+
readonly totals: PayrollV2Totals;
|
|
112
|
+
readonly employee: PayrollEmployeeSnapshot;
|
|
113
|
+
readonly calculationContext: PayrollCalculationContext;
|
|
114
|
+
readonly cfdi?: PayrollV2Cfdi;
|
|
115
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PayrollV2 Types — unified PayrollItem-based model.
|
|
4
|
+
*
|
|
5
|
+
* Each item is self-describing: carries SAT codes, taxed/exempt split,
|
|
6
|
+
* source key for internal reference, and an optional formula explaining
|
|
7
|
+
* how the amount was calculated.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: CfdiStatus and PayrollStatus enums are NOT imported here because
|
|
10
|
+
* they live in repo-specific enum files (used in 19+ files each). Instead,
|
|
11
|
+
* the `status` and `payrollStatus` fields use `string`, which is compatible
|
|
12
|
+
* since TypeScript string enum values ARE strings.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PayrollItemCategory = void 0;
|
|
16
|
+
// ============================================================
|
|
17
|
+
// Core item types
|
|
18
|
+
// ============================================================
|
|
19
|
+
var PayrollItemCategory;
|
|
20
|
+
(function (PayrollItemCategory) {
|
|
21
|
+
PayrollItemCategory["BASE_SALARY"] = "BASE_SALARY";
|
|
22
|
+
PayrollItemCategory["ADDITIONAL_FIXED"] = "ADDITIONAL_FIXED";
|
|
23
|
+
PayrollItemCategory["COMMISSION"] = "COMMISSION";
|
|
24
|
+
PayrollItemCategory["BONUS"] = "BONUS";
|
|
25
|
+
PayrollItemCategory["OVERTIME"] = "OVERTIME";
|
|
26
|
+
PayrollItemCategory["HOLIDAY_PAY"] = "HOLIDAY_PAY";
|
|
27
|
+
PayrollItemCategory["YEAR_END_BONUS"] = "YEAR_END_BONUS";
|
|
28
|
+
PayrollItemCategory["VACATION_BONUS"] = "VACATION_BONUS";
|
|
29
|
+
PayrollItemCategory["PROFIT_SHARING"] = "PROFIT_SHARING";
|
|
30
|
+
PayrollItemCategory["SUBSIDY"] = "SUBSIDY";
|
|
31
|
+
PayrollItemCategory["SUPPORT"] = "SUPPORT";
|
|
32
|
+
PayrollItemCategory["COMPENSATION"] = "COMPENSATION";
|
|
33
|
+
PayrollItemCategory["TAX"] = "TAX";
|
|
34
|
+
PayrollItemCategory["SOCIAL_SECURITY"] = "SOCIAL_SECURITY";
|
|
35
|
+
PayrollItemCategory["ATTENDANCE_DISCOUNT"] = "ATTENDANCE_DISCOUNT";
|
|
36
|
+
PayrollItemCategory["OTHER_DEDUCTION"] = "OTHER_DEDUCTION";
|
|
37
|
+
PayrollItemCategory["OTHER_PAYMENT"] = "OTHER_PAYMENT";
|
|
38
|
+
})(PayrollItemCategory || (exports.PayrollItemCategory = PayrollItemCategory = {}));
|