hvp-shared 6.65.0 → 6.66.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.
@@ -1,5 +1,6 @@
1
1
  import { EmploymentType, CompensationType, PayrollStampingMode, ScheduleType, AttendanceSource } from '../../constants/employment.enums';
2
2
  import { JobSnapshot } from '../../types/job-snapshot.types';
3
+ import { EmploymentConfig, EmploymentSchedule, EmploymentSeniority, EmploymentSalaryData, EmploymentHourlyData, EmploymentBenefits, EmploymentImss, EmploymentCfdi } from '../../types/employment-sections.types';
3
4
  /**
4
5
  * Public Employment Response
5
6
  *
@@ -81,6 +82,14 @@ export interface AdminEmploymentResponse extends EmploymentViewResponse {
81
82
  physicalActivitySupport?: number;
82
83
  createdBy?: string;
83
84
  updatedBy?: string;
85
+ config?: EmploymentConfig;
86
+ schedule?: EmploymentSchedule;
87
+ seniority?: EmploymentSeniority;
88
+ salaryData?: EmploymentSalaryData;
89
+ hourlyData?: EmploymentHourlyData;
90
+ benefits?: EmploymentBenefits;
91
+ imss?: EmploymentImss;
92
+ cfdi?: EmploymentCfdi;
84
93
  }
85
94
  /**
86
95
  * Union type for all employment response types
@@ -0,0 +1,130 @@
1
+ import { EmploymentType, CompensationType, PayrollStampingMode, ScheduleType, AttendanceSource } from '../constants/employment.enums';
2
+ /**
3
+ * A fixed concept with a name and amount.
4
+ * Used for additional incomes and deductions.
5
+ */
6
+ export interface FixedConcept {
7
+ concept: string;
8
+ amount: number;
9
+ }
10
+ /**
11
+ * Employment Config
12
+ *
13
+ * User-set classification fields. Changing any triggers recalculation.
14
+ * Present on ALL employment types.
15
+ */
16
+ export interface EmploymentConfig {
17
+ employmentType: EmploymentType;
18
+ compensationType: CompensationType;
19
+ weeklyHours: number;
20
+ scheduleType: ScheduleType;
21
+ attendanceSource: AttendanceSource;
22
+ hasCommissions: boolean;
23
+ hasImss: boolean;
24
+ payrollStampingMode: PayrollStampingMode;
25
+ additionalIncomes: FixedConcept[];
26
+ deductions: FixedConcept[];
27
+ }
28
+ /**
29
+ * Employment Schedule
30
+ *
31
+ * Derived from config.weeklyHours. ONLY present when scheduleType = "fixed".
32
+ * Absent for flexible, on_demand, none.
33
+ */
34
+ export interface EmploymentSchedule {
35
+ workWeekRatio: number;
36
+ dailyWorkingHours: number;
37
+ }
38
+ /**
39
+ * Employment Seniority
40
+ *
41
+ * Derived from collaborator start date. Always calculated, no overrides.
42
+ * Present for: payroll, payroll_draft, intern, hourly_agreed, casual.
43
+ * Absent for: contractor, coverage_only.
44
+ */
45
+ export interface EmploymentSeniority {
46
+ bonusPercentage: number;
47
+ commissionBonusPercentage: number;
48
+ }
49
+ /**
50
+ * Salary Rates
51
+ *
52
+ * Daily and hourly rates derived from totalFixedIncome.
53
+ * Used for CFDI stamping (nominal) and deductions/bonuses (effective).
54
+ */
55
+ export interface SalaryRates {
56
+ nominalDaily: number;
57
+ nominalHourly: number;
58
+ effectiveDaily: number;
59
+ effectiveHourly: number;
60
+ }
61
+ /**
62
+ * Salary Data Overrides
63
+ *
64
+ * When the user manually overrides a calculated value.
65
+ * The calculated field always holds the formula result;
66
+ * the override holds the user's intent.
67
+ * Effective value = override ?? calculated.
68
+ */
69
+ export interface SalaryDataOverrides {
70
+ guaranteedIncome?: number;
71
+ adjustedJobIncome?: number;
72
+ totalFixedIncome?: number;
73
+ }
74
+ /**
75
+ * Employment Salary Data
76
+ *
77
+ * Full income chain + rates for salary-based employments.
78
+ * ONLY for: payroll, payroll_draft, intern.
79
+ * Mutually exclusive with hourlyData.
80
+ */
81
+ export interface EmploymentSalaryData {
82
+ guaranteedIncome: number;
83
+ adjustedJobIncome: number;
84
+ totalFixedIncome: number;
85
+ rates: SalaryRates;
86
+ overrides?: SalaryDataOverrides;
87
+ }
88
+ /**
89
+ * Employment Hourly Data
90
+ *
91
+ * Pay rate + hours tracking for hourly-based employments.
92
+ * ONLY for: hourly_agreed, casual.
93
+ * Mutually exclusive with salaryData.
94
+ */
95
+ export interface EmploymentHourlyData {
96
+ adjustedHourlyRate: number;
97
+ averageDailyHoursWorked: number;
98
+ adjustedHourlyRateOverride?: number;
99
+ }
100
+ /**
101
+ * Employment Benefits
102
+ *
103
+ * Monthly support amounts (user-entered).
104
+ * Present for: payroll, payroll_draft, intern, hourly_agreed, casual.
105
+ * Absent for: contractor, coverage_only.
106
+ */
107
+ export interface EmploymentBenefits {
108
+ trainingSupport: number;
109
+ physicalActivitySupport: number;
110
+ }
111
+ /**
112
+ * Employment IMSS
113
+ *
114
+ * Social security contribution data.
115
+ * Only present when config.hasImss = true.
116
+ */
117
+ export interface EmploymentImss {
118
+ contributionBaseSalary: number;
119
+ integratedDailySalary: number;
120
+ }
121
+ /**
122
+ * Employment CFDI
123
+ *
124
+ * Fiscal stamping configuration.
125
+ * Only present when config.payrollStampingMode !== "none".
126
+ */
127
+ export interface EmploymentCfdi {
128
+ journeyType: string;
129
+ paymentFrequency: string;
130
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,3 +15,4 @@ export * from './cash-reconciliation.types';
15
15
  export * from './coverage.types';
16
16
  export * from './job-promotion-stats.types';
17
17
  export * from './job-snapshot.types';
18
+ export * from './employment-sections.types';
@@ -31,3 +31,4 @@ __exportStar(require("./cash-reconciliation.types"), exports);
31
31
  __exportStar(require("./coverage.types"), exports);
32
32
  __exportStar(require("./job-promotion-stats.types"), exports);
33
33
  __exportStar(require("./job-snapshot.types"), exports);
34
+ __exportStar(require("./employment-sections.types"), exports);
@@ -16,4 +16,5 @@ export interface JobSnapshot {
16
16
  isCommissionAdjusted: boolean;
17
17
  commissionRateAdjustment: number;
18
18
  expressBranchCompensation: number;
19
+ hourlyRate?: number;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.65.0",
3
+ "version": "6.66.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",