hvp-shared 6.70.0 → 6.72.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 +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/inventory-session.enums.d.ts +20 -0
- package/dist/constants/inventory-session.enums.js +34 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/inventory-session/index.d.ts +3 -0
- package/dist/contracts/inventory-session/index.js +19 -0
- package/dist/contracts/inventory-session/requests.d.ts +40 -0
- package/dist/contracts/inventory-session/requests.js +11 -0
- package/dist/contracts/inventory-session/responses.d.ts +80 -0
- package/dist/contracts/inventory-session/responses.js +7 -0
- package/dist/contracts/inventory-session/types.d.ts +38 -0
- package/dist/contracts/inventory-session/types.js +8 -0
- package/dist/types/catalog-item.types.d.ts +2 -0
- package/dist/types/payroll-v2.types.d.ts +28 -1
- package/package.json +1 -1
package/dist/constants/index.js
CHANGED
|
@@ -37,3 +37,4 @@ __exportStar(require("./time-off.enums"), exports);
|
|
|
37
37
|
__exportStar(require("./time-off.constants"), exports);
|
|
38
38
|
__exportStar(require("./hris.constants"), exports);
|
|
39
39
|
__exportStar(require("./payroll-features.constants"), exports);
|
|
40
|
+
__exportStar(require("./inventory-session.enums"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Session Enums
|
|
3
|
+
*
|
|
4
|
+
* Enums for the persistent multi-pass inventory count workflow.
|
|
5
|
+
* Sessions track physical inventory counts across multiple uploads
|
|
6
|
+
* until closure is detected from QVET movements sync.
|
|
7
|
+
*/
|
|
8
|
+
/** Lifecycle status of an inventory session */
|
|
9
|
+
export declare enum InventorySessionStatus {
|
|
10
|
+
open = "open",
|
|
11
|
+
closed = "closed"
|
|
12
|
+
}
|
|
13
|
+
export declare const INVENTORY_SESSION_STATUS_LABELS: Record<InventorySessionStatus, string>;
|
|
14
|
+
/** Status of an individual item within a session */
|
|
15
|
+
export declare enum InventoryItemStatus {
|
|
16
|
+
pending = "pending",
|
|
17
|
+
counted = "counted",
|
|
18
|
+
matched = "matched"
|
|
19
|
+
}
|
|
20
|
+
export declare const INVENTORY_ITEM_STATUS_LABELS: Record<InventoryItemStatus, string>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inventory Session Enums
|
|
4
|
+
*
|
|
5
|
+
* Enums for the persistent multi-pass inventory count workflow.
|
|
6
|
+
* Sessions track physical inventory counts across multiple uploads
|
|
7
|
+
* until closure is detected from QVET movements sync.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.INVENTORY_ITEM_STATUS_LABELS = exports.InventoryItemStatus = exports.INVENTORY_SESSION_STATUS_LABELS = exports.InventorySessionStatus = void 0;
|
|
11
|
+
// --- Session Status ---
|
|
12
|
+
/** Lifecycle status of an inventory session */
|
|
13
|
+
var InventorySessionStatus;
|
|
14
|
+
(function (InventorySessionStatus) {
|
|
15
|
+
InventorySessionStatus["open"] = "open";
|
|
16
|
+
InventorySessionStatus["closed"] = "closed";
|
|
17
|
+
})(InventorySessionStatus || (exports.InventorySessionStatus = InventorySessionStatus = {}));
|
|
18
|
+
exports.INVENTORY_SESSION_STATUS_LABELS = {
|
|
19
|
+
[InventorySessionStatus.open]: "Abierta",
|
|
20
|
+
[InventorySessionStatus.closed]: "Cerrada",
|
|
21
|
+
};
|
|
22
|
+
// --- Item Status ---
|
|
23
|
+
/** Status of an individual item within a session */
|
|
24
|
+
var InventoryItemStatus;
|
|
25
|
+
(function (InventoryItemStatus) {
|
|
26
|
+
InventoryItemStatus["pending"] = "pending";
|
|
27
|
+
InventoryItemStatus["counted"] = "counted";
|
|
28
|
+
InventoryItemStatus["matched"] = "matched";
|
|
29
|
+
})(InventoryItemStatus || (exports.InventoryItemStatus = InventoryItemStatus = {}));
|
|
30
|
+
exports.INVENTORY_ITEM_STATUS_LABELS = {
|
|
31
|
+
[InventoryItemStatus.pending]: "Pendiente",
|
|
32
|
+
[InventoryItemStatus.counted]: "Contado",
|
|
33
|
+
[InventoryItemStatus.matched]: "Validado",
|
|
34
|
+
};
|
package/dist/contracts/index.js
CHANGED
|
@@ -27,3 +27,4 @@ __exportStar(require("./stock-calculation"), exports);
|
|
|
27
27
|
__exportStar(require("./cash-reconciliation"), exports);
|
|
28
28
|
__exportStar(require("./time-off-request"), exports);
|
|
29
29
|
__exportStar(require("./job"), exports);
|
|
30
|
+
__exportStar(require("./inventory-session"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
19
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Session Request Types
|
|
3
|
+
*
|
|
4
|
+
* Request DTOs for inventory session endpoints.
|
|
5
|
+
*
|
|
6
|
+
* @example POST /api/qvet/inventory-sessions
|
|
7
|
+
* @example POST /api/qvet/inventory-sessions/:id/upload
|
|
8
|
+
* @example POST /api/qvet/inventory-sessions/:id/confirm-matches
|
|
9
|
+
*/
|
|
10
|
+
import { InventorySessionStatus } from '../../constants/inventory-session.enums';
|
|
11
|
+
import { Warehouse } from '../../types/qvet.types';
|
|
12
|
+
/**
|
|
13
|
+
* Create a new inventory session.
|
|
14
|
+
*
|
|
15
|
+
* @example POST /api/qvet/inventory-sessions
|
|
16
|
+
*/
|
|
17
|
+
export interface CreateInventorySessionRequest {
|
|
18
|
+
/** Warehouse to count */
|
|
19
|
+
warehouse: Warehouse;
|
|
20
|
+
/** Sections to include in the count */
|
|
21
|
+
sections: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Confirm auto-matched items after an upload.
|
|
25
|
+
*
|
|
26
|
+
* @example POST /api/qvet/inventory-sessions/:id/confirm-matches
|
|
27
|
+
*/
|
|
28
|
+
export interface ConfirmMatchesRequest {
|
|
29
|
+
/** QVET codes of items to mark as matched */
|
|
30
|
+
qvetCodes: number[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Filters for listing inventory sessions.
|
|
34
|
+
*
|
|
35
|
+
* @example GET /api/qvet/inventory-sessions?warehouse=HARBOR&status=open
|
|
36
|
+
*/
|
|
37
|
+
export interface ListInventorySessionsFilters {
|
|
38
|
+
warehouse?: Warehouse;
|
|
39
|
+
status?: InventorySessionStatus;
|
|
40
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inventory Session Request Types
|
|
4
|
+
*
|
|
5
|
+
* Request DTOs for inventory session endpoints.
|
|
6
|
+
*
|
|
7
|
+
* @example POST /api/qvet/inventory-sessions
|
|
8
|
+
* @example POST /api/qvet/inventory-sessions/:id/upload
|
|
9
|
+
* @example POST /api/qvet/inventory-sessions/:id/confirm-matches
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Session Response Types
|
|
3
|
+
*
|
|
4
|
+
* Response DTOs for inventory session endpoints.
|
|
5
|
+
*/
|
|
6
|
+
import { InventorySessionStatus } from '../../constants/inventory-session.enums';
|
|
7
|
+
import { Warehouse } from '../../types/qvet.types';
|
|
8
|
+
import { InventorySessionItem } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Summary of an inventory session for list views.
|
|
11
|
+
*
|
|
12
|
+
* @example GET /api/qvet/inventory-sessions
|
|
13
|
+
*/
|
|
14
|
+
export interface InventorySessionSummaryResponse {
|
|
15
|
+
id: string;
|
|
16
|
+
warehouse: Warehouse;
|
|
17
|
+
sections: string[];
|
|
18
|
+
status: InventorySessionStatus;
|
|
19
|
+
/** Total items in session */
|
|
20
|
+
totalItems: number;
|
|
21
|
+
/** Items with status "pending" */
|
|
22
|
+
pendingItems: number;
|
|
23
|
+
/** Items with status "counted" */
|
|
24
|
+
countedItems: number;
|
|
25
|
+
/** Items with status "matched" */
|
|
26
|
+
matchedItems: number;
|
|
27
|
+
/** Number of times an Excel was uploaded */
|
|
28
|
+
uploadCount: number;
|
|
29
|
+
createdByName: string;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
lastUploadAt?: string;
|
|
33
|
+
closedAt?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Full detail of an inventory session including all items.
|
|
37
|
+
*
|
|
38
|
+
* @example GET /api/qvet/inventory-sessions/:id
|
|
39
|
+
*/
|
|
40
|
+
export interface InventorySessionDetailResponse extends InventorySessionSummaryResponse {
|
|
41
|
+
createdById: string;
|
|
42
|
+
items: InventorySessionItem[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Item that matched QVET stock during upload.
|
|
46
|
+
* Shown in the match preview popup.
|
|
47
|
+
*/
|
|
48
|
+
export interface MatchPreviewItem {
|
|
49
|
+
qvetCode: number;
|
|
50
|
+
description: string;
|
|
51
|
+
section: string;
|
|
52
|
+
/** The quantity that matched (counted == QVET stock) */
|
|
53
|
+
quantity: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Response after uploading a count Excel.
|
|
57
|
+
* Includes upload result + items that can be auto-matched.
|
|
58
|
+
*
|
|
59
|
+
* @example POST /api/qvet/inventory-sessions/:id/upload
|
|
60
|
+
*/
|
|
61
|
+
export interface UploadCountsResponse {
|
|
62
|
+
/** Updated session summary */
|
|
63
|
+
session: InventorySessionSummaryResponse;
|
|
64
|
+
/** Statistics from this upload */
|
|
65
|
+
uploadStats: {
|
|
66
|
+
/** Items updated in this upload */
|
|
67
|
+
itemsUpdated: number;
|
|
68
|
+
/** Items that were not found in the session */
|
|
69
|
+
itemsNotFound: number;
|
|
70
|
+
/** Items skipped (already matched) */
|
|
71
|
+
itemsSkipped: number;
|
|
72
|
+
};
|
|
73
|
+
/** Items that can be auto-matched (counted == QVET stock) */
|
|
74
|
+
matchPreview: {
|
|
75
|
+
/** Items eligible for matching */
|
|
76
|
+
items: MatchPreviewItem[];
|
|
77
|
+
/** Total count of matchable items */
|
|
78
|
+
count: number;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Session Types
|
|
3
|
+
*
|
|
4
|
+
* Shared type definitions for inventory session items.
|
|
5
|
+
* Used by both requests and responses.
|
|
6
|
+
*/
|
|
7
|
+
import { InventoryItemStatus } from '../../constants/inventory-session.enums';
|
|
8
|
+
/**
|
|
9
|
+
* Item data within an inventory session.
|
|
10
|
+
*
|
|
11
|
+
* Tracks the count state of a single product across uploads.
|
|
12
|
+
*/
|
|
13
|
+
export interface InventorySessionItem {
|
|
14
|
+
qvetCode: number;
|
|
15
|
+
description: string;
|
|
16
|
+
section: string;
|
|
17
|
+
family: string;
|
|
18
|
+
/** Stock at session creation (reference only, does not change) */
|
|
19
|
+
initialQvetStock: number;
|
|
20
|
+
/** Latest QVET stock (refreshed on each upload) */
|
|
21
|
+
currentQvetStock: number;
|
|
22
|
+
/** Quantity counted by collaborator */
|
|
23
|
+
countedQuantity?: number;
|
|
24
|
+
/** Expired items counted */
|
|
25
|
+
countedExpiredQuantity?: number;
|
|
26
|
+
/** Next expiration date recorded during count */
|
|
27
|
+
nextExpirationDate?: string;
|
|
28
|
+
/** Collaborator comment */
|
|
29
|
+
comment?: string;
|
|
30
|
+
/** Unit price at time of session creation */
|
|
31
|
+
unitPrice: number;
|
|
32
|
+
/** Current item status */
|
|
33
|
+
status: InventoryItemStatus;
|
|
34
|
+
/** When the item was matched (ISO 8601) */
|
|
35
|
+
matchedAt?: string;
|
|
36
|
+
/** Who confirmed the match */
|
|
37
|
+
matchedByName?: string;
|
|
38
|
+
}
|
|
@@ -18,6 +18,8 @@ export interface WarehouseStock {
|
|
|
18
18
|
minStock: SyncField<number>;
|
|
19
19
|
/** Optimal stock level (sync with QVET) */
|
|
20
20
|
optimalStock: SyncField<number>;
|
|
21
|
+
/** Next expiration date for items in this warehouse (ISO 8601) */
|
|
22
|
+
nextExpirationDate?: string;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* QVET Sync Data
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* how the amount was calculated.
|
|
7
7
|
*/
|
|
8
8
|
import { CfdiStatus, PayrollStatus } from '../constants/hr.enums';
|
|
9
|
+
import { CompensationType, EmploymentType, PayrollStampingMode } from '../constants/employment.enums';
|
|
9
10
|
export declare enum PayrollItemCategory {
|
|
10
11
|
BASE_SALARY = "BASE_SALARY",
|
|
11
12
|
ADDITIONAL_FIXED = "ADDITIONAL_FIXED",
|
|
@@ -118,6 +119,29 @@ export interface PayrollEditableOverrides {
|
|
|
118
119
|
readonly otherFixedDeductions?: PayrollConceptDto[];
|
|
119
120
|
readonly otherVariableDeductions?: PayrollConceptDto[];
|
|
120
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Snapshot of the employment configuration that affects payroll visualization.
|
|
124
|
+
* Stored on each PayrollV2 so the frontend can render it without external lookups.
|
|
125
|
+
*/
|
|
126
|
+
export interface PayrollV2EmploymentConfig {
|
|
127
|
+
readonly employmentType: EmploymentType;
|
|
128
|
+
readonly compensationType: CompensationType;
|
|
129
|
+
readonly payrollStampingMode: PayrollStampingMode;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Embedded nominal payroll data for employees that require CFDI stamping
|
|
133
|
+
* at minimum wage (casual with IMSS, coverage_only).
|
|
134
|
+
*
|
|
135
|
+
* Instead of generating a separate PayrollV2 record, the nominal component
|
|
136
|
+
* is embedded inside the main payroll record.
|
|
137
|
+
*/
|
|
138
|
+
export interface NominalPayrollData {
|
|
139
|
+
readonly perceptions: PayrollItem[];
|
|
140
|
+
readonly deductions: PayrollItem[];
|
|
141
|
+
readonly otherPayments: PayrollItem[];
|
|
142
|
+
readonly totals: PayrollV2Totals;
|
|
143
|
+
readonly cfdi?: PayrollV2Cfdi;
|
|
144
|
+
}
|
|
121
145
|
export interface PayrollV2 {
|
|
122
146
|
readonly collaboratorId?: string;
|
|
123
147
|
readonly employmentId?: string;
|
|
@@ -126,7 +150,10 @@ export interface PayrollV2 {
|
|
|
126
150
|
readonly periodEndDate?: string;
|
|
127
151
|
readonly payrollStatus?: PayrollStatus;
|
|
128
152
|
readonly daysPaid?: number;
|
|
129
|
-
|
|
153
|
+
/** Snapshot of employment config at generation time */
|
|
154
|
+
readonly employmentConfig?: PayrollV2EmploymentConfig;
|
|
155
|
+
/** Embedded nominal payroll (casual+IMSS, coverage_only) */
|
|
156
|
+
readonly nominalPayroll?: NominalPayrollData;
|
|
130
157
|
readonly perceptions: PayrollItem[];
|
|
131
158
|
readonly deductions: PayrollItem[];
|
|
132
159
|
readonly otherPayments: PayrollItem[];
|