hvp-shared 6.35.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.
@@ -10,3 +10,4 @@ export * from './sync-field.types';
10
10
  export * from './catalog-item.types';
11
11
  export * from './qvet.types';
12
12
  export * from './background-job.types';
13
+ export * from './payroll-v2.types';
@@ -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 = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.35.0",
3
+ "version": "6.36.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",