hvp-shared 13.13.0 → 13.15.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.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Force Majeure (Fuerza mayor) Enums
3
+ *
4
+ * Single source of truth for force-majeure declaration scope.
5
+ * A declaration marks a day (or range) as "fuerza mayor" for everyone or for a
6
+ * single branch. Affected collaborators are paid full salary with their actual
7
+ * scheduled hours computed. See GH#423.
8
+ */
9
+ export declare enum ForceMajeureScope {
10
+ all = "all",
11
+ branch = "branch"
12
+ }
13
+ /** Spanish display labels for ForceMajeureScope */
14
+ export declare const FORCE_MAJEURE_SCOPE_LABELS: Record<ForceMajeureScope, string>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * Force Majeure (Fuerza mayor) Enums
4
+ *
5
+ * Single source of truth for force-majeure declaration scope.
6
+ * A declaration marks a day (or range) as "fuerza mayor" for everyone or for a
7
+ * single branch. Affected collaborators are paid full salary with their actual
8
+ * scheduled hours computed. See GH#423.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.FORCE_MAJEURE_SCOPE_LABELS = exports.ForceMajeureScope = void 0;
12
+ var ForceMajeureScope;
13
+ (function (ForceMajeureScope) {
14
+ ForceMajeureScope["all"] = "all";
15
+ ForceMajeureScope["branch"] = "branch";
16
+ })(ForceMajeureScope || (exports.ForceMajeureScope = ForceMajeureScope = {}));
17
+ /** Spanish display labels for ForceMajeureScope */
18
+ exports.FORCE_MAJEURE_SCOPE_LABELS = {
19
+ [ForceMajeureScope.all]: 'Todas las sucursales',
20
+ [ForceMajeureScope.branch]: 'Sucursal específica',
21
+ };
@@ -19,6 +19,7 @@ export * from './employment.enums';
19
19
  export * from './qvet-cash-flow.enums';
20
20
  export * from './time-off.enums';
21
21
  export * from './time-off.constants';
22
+ export * from './force-majeure.enums';
22
23
  export * from './hris.constants';
23
24
  export * from './payroll-features.constants';
24
25
  export * from './inventory-session.enums';
@@ -35,6 +35,7 @@ __exportStar(require("./employment.enums"), exports);
35
35
  __exportStar(require("./qvet-cash-flow.enums"), exports);
36
36
  __exportStar(require("./time-off.enums"), exports);
37
37
  __exportStar(require("./time-off.constants"), exports);
38
+ __exportStar(require("./force-majeure.enums"), exports);
38
39
  __exportStar(require("./hris.constants"), exports);
39
40
  __exportStar(require("./payroll-features.constants"), exports);
40
41
  __exportStar(require("./inventory-session.enums"), exports);
@@ -20,5 +20,8 @@ export declare const LEGAL_VACATIONS: {
20
20
  /**
21
21
  * TimeOffTypes that consume vacation balance.
22
22
  * Only these types count against a collaborator's vacation days.
23
+ *
24
+ * NOTE: TimeOffType.PaidLeave (Permiso con goce de sueldo) is intentionally
25
+ * EXCLUDED — a paid leave pays full salary but must NOT consume vacation days.
23
26
  */
24
27
  export declare const VACATION_CONSUMING_TYPES: readonly TimeOffType[];
@@ -87,6 +87,9 @@ exports.LEGAL_VACATIONS = {
87
87
  /**
88
88
  * TimeOffTypes that consume vacation balance.
89
89
  * Only these types count against a collaborator's vacation days.
90
+ *
91
+ * NOTE: TimeOffType.PaidLeave (Permiso con goce de sueldo) is intentionally
92
+ * EXCLUDED — a paid leave pays full salary but must NOT consume vacation days.
90
93
  */
91
94
  exports.VACATION_CONSUMING_TYPES = [
92
95
  time_off_enums_1.TimeOffType.Vacation,
@@ -19,7 +19,14 @@ export declare enum TimeOffType {
19
19
  AuthorizedUnjustifiedAbsence = "Falta injustificada autorizada",
20
20
  EarlyLeavePermission = "Permiso de salida anticipada",
21
21
  LatePermission = "Permiso de llegar tarde",
22
- CompensationShift = "Reposici\u00F3n de jornada"
22
+ CompensationShift = "Reposici\u00F3n de jornada",
23
+ /**
24
+ * Employer-paid authorized absence at full ordinary salary (paternity,
25
+ * marriage, bereavement, etc.). The specific motive goes in the request note.
26
+ * Pays full salary, NO discount, does NOT consume vacation balance, grants
27
+ * NO prima vacacional, and pays NO commission/average-income compensation.
28
+ */
29
+ PaidLeave = "Permiso con goce de sueldo"
23
30
  }
24
31
  /** Spanish display labels for TimeOffType */
25
32
  export declare const TIME_OFF_TYPE_LABELS: Record<TimeOffType, string>;
@@ -25,6 +25,13 @@ var TimeOffType;
25
25
  TimeOffType["EarlyLeavePermission"] = "Permiso de salida anticipada";
26
26
  TimeOffType["LatePermission"] = "Permiso de llegar tarde";
27
27
  TimeOffType["CompensationShift"] = "Reposici\u00F3n de jornada";
28
+ /**
29
+ * Employer-paid authorized absence at full ordinary salary (paternity,
30
+ * marriage, bereavement, etc.). The specific motive goes in the request note.
31
+ * Pays full salary, NO discount, does NOT consume vacation balance, grants
32
+ * NO prima vacacional, and pays NO commission/average-income compensation.
33
+ */
34
+ TimeOffType["PaidLeave"] = "Permiso con goce de sueldo";
28
35
  })(TimeOffType || (exports.TimeOffType = TimeOffType = {}));
29
36
  /** Spanish display labels for TimeOffType */
30
37
  exports.TIME_OFF_TYPE_LABELS = {
@@ -37,6 +44,7 @@ exports.TIME_OFF_TYPE_LABELS = {
37
44
  [TimeOffType.EarlyLeavePermission]: 'Permiso de salida anticipada',
38
45
  [TimeOffType.LatePermission]: 'Permiso de llegar tarde',
39
46
  [TimeOffType.CompensationShift]: 'Reposición de jornada',
47
+ [TimeOffType.PaidLeave]: 'Permiso con goce de sueldo',
40
48
  };
41
49
  /** Spanish display labels for TimeOffStatus */
42
50
  exports.TIME_OFF_STATUS_LABELS = {
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Force Majeure Declaration API Contracts
3
+ * Request and Response types for force-majeure declaration endpoints.
4
+ */
5
+ export * from './responses';
6
+ export * from './requests';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Force Majeure Declaration API Contracts
4
+ * Request and Response types for force-majeure declaration endpoints.
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./responses"), exports);
22
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Force Majeure Declaration Request Types
3
+ *
4
+ * API request contracts for force-majeure declaration endpoints. A single
5
+ * declaration covers everyone (or a branch) for the given day(s); affected
6
+ * collaborators are resolved at attendance-read time (individual time-off wins).
7
+ *
8
+ * @example POST /api/force-majeure
9
+ * @example PATCH /api/force-majeure/:id
10
+ */
11
+ import { ForceMajeureScope } from '../../constants/force-majeure.enums';
12
+ /**
13
+ * Create Force Majeure Declaration
14
+ *
15
+ * @example POST /api/force-majeure
16
+ */
17
+ export interface CreateForceMajeureDeclarationRequest {
18
+ /** Affected day(s), ISO 8601 at Mexico start-of-day. */
19
+ dates: string[];
20
+ scope: ForceMajeureScope;
21
+ /** Required when scope is `branch`. */
22
+ branchId?: string;
23
+ reason: string;
24
+ }
25
+ /**
26
+ * Update Force Majeure Declaration (partial).
27
+ *
28
+ * @example PATCH /api/force-majeure/:id
29
+ */
30
+ export interface UpdateForceMajeureDeclarationRequest {
31
+ dates?: string[];
32
+ scope?: ForceMajeureScope;
33
+ branchId?: string;
34
+ reason?: string;
35
+ }
36
+ /**
37
+ * Query filters for listing declarations.
38
+ *
39
+ * @example GET /api/force-majeure?fromDate=...&toDate=...
40
+ */
41
+ export interface ForceMajeureDeclarationQuery {
42
+ /** Return declarations overlapping this date range (ISO 8601). */
43
+ fromDate?: string;
44
+ toDate?: string;
45
+ branchId?: string;
46
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * Force Majeure Declaration Request Types
4
+ *
5
+ * API request contracts for force-majeure declaration endpoints. A single
6
+ * declaration covers everyone (or a branch) for the given day(s); affected
7
+ * collaborators are resolved at attendance-read time (individual time-off wins).
8
+ *
9
+ * @example POST /api/force-majeure
10
+ * @example PATCH /api/force-majeure/:id
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Force Majeure Declaration Response Types
3
+ *
4
+ * API response contracts for force-majeure declaration endpoints.
5
+ *
6
+ * @example GET /api/force-majeure
7
+ * @example GET /api/force-majeure/:id
8
+ */
9
+ import { ForceMajeureScope } from '../../constants/force-majeure.enums';
10
+ /**
11
+ * Force Majeure Declaration
12
+ *
13
+ * A declared closure for a day (or range), affecting everyone or a single
14
+ * branch. Collaborators with a scheduled shift and no full-day individual
15
+ * time-off on those days are paid full salary with their scheduled hours.
16
+ */
17
+ export interface ForceMajeureDeclarationResponse {
18
+ id: string;
19
+ /** Affected day(s), ISO 8601 at Mexico start-of-day. */
20
+ dates: string[];
21
+ scope: ForceMajeureScope;
22
+ /** Present when scope is `branch`. */
23
+ branchId?: string;
24
+ reason: string;
25
+ createdAt?: string;
26
+ updatedAt?: string;
27
+ createdBy?: string;
28
+ updatedBy?: string;
29
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * Force Majeure Declaration Response Types
4
+ *
5
+ * API response contracts for force-majeure declaration endpoints.
6
+ *
7
+ * @example GET /api/force-majeure
8
+ * @example GET /api/force-majeure/:id
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,6 +10,7 @@ export * from './qvet';
10
10
  export * from './stock-calculation';
11
11
  export * from './cash-reconciliation';
12
12
  export * from './time-off-request';
13
+ export * from './force-majeure';
13
14
  export * from './job';
14
15
  export * from './inventory-session';
15
16
  export * from './client-billing';
@@ -26,6 +26,7 @@ __exportStar(require("./qvet"), exports);
26
26
  __exportStar(require("./stock-calculation"), exports);
27
27
  __exportStar(require("./cash-reconciliation"), exports);
28
28
  __exportStar(require("./time-off-request"), exports);
29
+ __exportStar(require("./force-majeure"), exports);
29
30
  __exportStar(require("./job"), exports);
30
31
  __exportStar(require("./inventory-session"), exports);
31
32
  __exportStar(require("./client-billing"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "13.13.0",
3
+ "version": "13.15.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",