hvp-shared 6.35.0 → 6.37.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/index.d.ts +2 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/job-category.constants.d.ts +35 -0
- package/dist/constants/job-category.constants.js +46 -0
- package/dist/constants/special-collaborators.constants.d.ts +12 -0
- package/dist/constants/special-collaborators.constants.js +14 -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
package/dist/constants/index.js
CHANGED
|
@@ -27,3 +27,5 @@ __exportStar(require("./qvet-catalog"), exports);
|
|
|
27
27
|
__exportStar(require("./qvet-warehouses"), exports);
|
|
28
28
|
__exportStar(require("./qvet-inventory"), exports);
|
|
29
29
|
__exportStar(require("./background-job.constants"), exports);
|
|
30
|
+
__exportStar(require("./job-category.constants"), exports);
|
|
31
|
+
__exportStar(require("./special-collaborators.constants"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Job Category Constants
|
|
3
|
+
*
|
|
4
|
+
* Enum and groupings for classifying jobs by function.
|
|
5
|
+
* Used by shift validations and business rules instead of comparing job titles.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Check if a job is veterinary staff
|
|
9
|
+
* VET_CATEGORIES.includes(job.category)
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Functional category for a job position.
|
|
13
|
+
*
|
|
14
|
+
* Decouples business logic from job titles so titles can be renamed
|
|
15
|
+
* without breaking shift validations or other rules.
|
|
16
|
+
*/
|
|
17
|
+
export declare enum JobCategory {
|
|
18
|
+
MEDICAL_DIRECTOR = "MEDICAL_DIRECTOR",
|
|
19
|
+
VET = "VET",
|
|
20
|
+
VET_ASSISTANT = "VET_ASSISTANT",
|
|
21
|
+
TRAINEE = "TRAINEE",
|
|
22
|
+
RECEPTIONIST = "RECEPTIONIST",
|
|
23
|
+
ADMIN = "ADMIN",
|
|
24
|
+
ADVISOR = "ADVISOR"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Jobs that count as veterinarians for shift coverage rules.
|
|
28
|
+
* Includes directors and full vets.
|
|
29
|
+
*/
|
|
30
|
+
export declare const VET_CATEGORIES: readonly JobCategory[];
|
|
31
|
+
/**
|
|
32
|
+
* All medical/clinical staff — vets + assistants + trainees.
|
|
33
|
+
* Used for total clinical headcount validations.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ALL_MEDICAL_CATEGORIES: readonly JobCategory[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Job Category Constants
|
|
4
|
+
*
|
|
5
|
+
* Enum and groupings for classifying jobs by function.
|
|
6
|
+
* Used by shift validations and business rules instead of comparing job titles.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Check if a job is veterinary staff
|
|
10
|
+
* VET_CATEGORIES.includes(job.category)
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ALL_MEDICAL_CATEGORIES = exports.VET_CATEGORIES = exports.JobCategory = void 0;
|
|
14
|
+
/**
|
|
15
|
+
* Functional category for a job position.
|
|
16
|
+
*
|
|
17
|
+
* Decouples business logic from job titles so titles can be renamed
|
|
18
|
+
* without breaking shift validations or other rules.
|
|
19
|
+
*/
|
|
20
|
+
var JobCategory;
|
|
21
|
+
(function (JobCategory) {
|
|
22
|
+
JobCategory["MEDICAL_DIRECTOR"] = "MEDICAL_DIRECTOR";
|
|
23
|
+
JobCategory["VET"] = "VET";
|
|
24
|
+
JobCategory["VET_ASSISTANT"] = "VET_ASSISTANT";
|
|
25
|
+
JobCategory["TRAINEE"] = "TRAINEE";
|
|
26
|
+
JobCategory["RECEPTIONIST"] = "RECEPTIONIST";
|
|
27
|
+
JobCategory["ADMIN"] = "ADMIN";
|
|
28
|
+
JobCategory["ADVISOR"] = "ADVISOR";
|
|
29
|
+
})(JobCategory || (exports.JobCategory = JobCategory = {}));
|
|
30
|
+
/**
|
|
31
|
+
* Jobs that count as veterinarians for shift coverage rules.
|
|
32
|
+
* Includes directors and full vets.
|
|
33
|
+
*/
|
|
34
|
+
exports.VET_CATEGORIES = [
|
|
35
|
+
JobCategory.MEDICAL_DIRECTOR,
|
|
36
|
+
JobCategory.VET,
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* All medical/clinical staff — vets + assistants + trainees.
|
|
40
|
+
* Used for total clinical headcount validations.
|
|
41
|
+
*/
|
|
42
|
+
exports.ALL_MEDICAL_CATEGORIES = [
|
|
43
|
+
...exports.VET_CATEGORIES,
|
|
44
|
+
JobCategory.VET_ASSISTANT,
|
|
45
|
+
JobCategory.TRAINEE,
|
|
46
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Special Collaborator Constants
|
|
3
|
+
*
|
|
4
|
+
* Codes for collaborators that have special shift validation rules.
|
|
5
|
+
* Replaces hardcoded "MAT" / "RGL" strings in frontend helpers.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Collaborator codes that are exempt from certain shift coverage rules
|
|
9
|
+
* (e.g., they may work supervised shifts without full vet coverage).
|
|
10
|
+
*/
|
|
11
|
+
export declare const SUPERVISED_COLLABORATOR_CODES: readonly ["MAT", "RGL"];
|
|
12
|
+
export type SupervisedCollaboratorCode = (typeof SUPERVISED_COLLABORATOR_CODES)[number];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Special Collaborator Constants
|
|
4
|
+
*
|
|
5
|
+
* Codes for collaborators that have special shift validation rules.
|
|
6
|
+
* Replaces hardcoded "MAT" / "RGL" strings in frontend helpers.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SUPERVISED_COLLABORATOR_CODES = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Collaborator codes that are exempt from certain shift coverage rules
|
|
12
|
+
* (e.g., they may work supervised shifts without full vet coverage).
|
|
13
|
+
*/
|
|
14
|
+
exports.SUPERVISED_COLLABORATOR_CODES = ["MAT", "RGL"];
|
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 = {}));
|