hvp-shared 6.64.0 → 6.65.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.
@@ -49,3 +49,5 @@ export declare const MONTH_WORK_DAYS: number;
49
49
  export declare const DAILY_WORK_HOURS = 8;
50
50
  /** Working days in a week (alias for clarity) */
51
51
  export declare const WEEK_WORK_DAYS = 6;
52
+ /** Calculate hourly rate from monthly fixed income: income / 30 / 8 */
53
+ export declare function calculateHourlyRate(jobFixedIncome: number): number;
@@ -12,6 +12,7 @@
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.WEEK_WORK_DAYS = exports.DAILY_WORK_HOURS = exports.MONTH_WORK_DAYS = exports.MONTH_DAYS = exports.WEEKS_IN_MONTH = exports.AVERAGE_WORK_DAYS_PER_MONTH = exports.EXCELLENCE_BONUS_RATE = exports.EXCELLENCE_BONUS_MIN_CLOSINGS = exports.DEDUCTION_INVALID_WITHDRAWAL = exports.DEDUCTION_INVALID_CLOSING = exports.BONUS_PER_CLOSING = exports.BONUS_SMALL_CLOSING = exports.BONUS_LARGE_CLOSING = exports.CLOSING_LARGE_THRESHOLD = exports.COMMISSION_SENIORITY_BONUS_PER_SEMESTER = exports.COMMISSION_PERCENTAGE_FOR_YEAR_END_BONUS = exports.YEAR_END_BONUS_DAYS = exports.ANNUAL_RAISE_PERCENT = exports.WORKING_DAYS_IN_A_WEEK = exports.MAX_DOUBLE_PLAY_WORK_WEEK_LIMIT = exports.MAX_WORK_WEEK_LIMIT = exports.HOLIDAY_OR_REST_EXTRA_PAY_PERCENTAGE = exports.SUNDAY_BONUS_PERCENTAGE = exports.VACATION_BONUS_PERCENTAGE = void 0;
15
+ exports.calculateHourlyRate = calculateHourlyRate;
15
16
  // ── Mexican Labor Law (not configurable) ──
16
17
  /** Prima vacacional: 25% of vacation days' salary (Art. 80 LFT) */
17
18
  exports.VACATION_BONUS_PERCENTAGE = 0.25;
@@ -59,3 +60,10 @@ exports.MONTH_WORK_DAYS = 6 * exports.WEEKS_IN_MONTH;
59
60
  exports.DAILY_WORK_HOURS = 8;
60
61
  /** Working days in a week (alias for clarity) */
61
62
  exports.WEEK_WORK_DAYS = 6;
63
+ // ── Utility Functions ──
64
+ /** Calculate hourly rate from monthly fixed income: income / 30 / 8 */
65
+ function calculateHourlyRate(jobFixedIncome) {
66
+ if (!jobFixedIncome || jobFixedIncome <= 0)
67
+ return 0;
68
+ return Math.round((jobFixedIncome / exports.MONTH_DAYS / exports.DAILY_WORK_HOURS) * 100) / 100;
69
+ }
@@ -16,6 +16,7 @@ export interface CreateJobRequest {
16
16
  positionFactor?: number;
17
17
  guaranteedJobIncome?: number;
18
18
  jobFixedIncome?: number;
19
+ hourlyRate?: number;
19
20
  isCommissionAdjusted?: boolean;
20
21
  commissionRateAdjustment?: number;
21
22
  expressBranchCompensation?: number;
@@ -40,6 +41,7 @@ export interface UpdateJobRequest {
40
41
  positionFactor?: number;
41
42
  guaranteedJobIncome?: number;
42
43
  jobFixedIncome?: number;
44
+ hourlyRate?: number;
43
45
  isCommissionAdjusted?: boolean;
44
46
  commissionRateAdjustment?: number;
45
47
  expressBranchCompensation?: number;
@@ -21,6 +21,7 @@ export interface JobResponse {
21
21
  positionFactor: number;
22
22
  guaranteedJobIncome?: number;
23
23
  jobFixedIncome?: number;
24
+ hourlyRate?: number;
24
25
  isCommissionAdjusted: boolean;
25
26
  commissionRateAdjustment: number;
26
27
  expressBranchCompensation: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.64.0",
3
+ "version": "6.65.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",