hvp-shared 6.72.2 → 6.73.1
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/inventory-session.enums.d.ts +23 -0
- package/dist/constants/inventory-session.enums.js +44 -1
- package/dist/contracts/inventory-session/requests.d.ts +27 -1
- package/dist/contracts/inventory-session/responses.d.ts +26 -0
- package/dist/contracts/inventory-session/types.d.ts +13 -1
- package/package.json +1 -1
|
@@ -18,3 +18,26 @@ export declare enum InventoryItemStatus {
|
|
|
18
18
|
matched = "matched"
|
|
19
19
|
}
|
|
20
20
|
export declare const INVENTORY_ITEM_STATUS_LABELS: Record<InventoryItemStatus, string>;
|
|
21
|
+
/** Auto-calculated review status based on count data vs stock */
|
|
22
|
+
export declare enum InventoryReviewStatus {
|
|
23
|
+
pending = "pending",
|
|
24
|
+
ok = "ok",
|
|
25
|
+
tolerated = "tolerated",
|
|
26
|
+
needs_review = "needs_review",
|
|
27
|
+
verify_qvet = "verify_qvet"
|
|
28
|
+
}
|
|
29
|
+
export declare const INVENTORY_REVIEW_STATUS_LABELS: Record<InventoryReviewStatus, string>;
|
|
30
|
+
/** Decision made by the manager/reviewer on a counted item */
|
|
31
|
+
export declare enum ManagerDecision {
|
|
32
|
+
validated = "validated",
|
|
33
|
+
loss = "loss",
|
|
34
|
+
justified = "justified",
|
|
35
|
+
recount = "recount"
|
|
36
|
+
}
|
|
37
|
+
export declare const MANAGER_DECISION_LABELS: Record<ManagerDecision, string>;
|
|
38
|
+
/** Action taken by the collaborator on their own count */
|
|
39
|
+
export declare enum CollaboratorAction {
|
|
40
|
+
confirmed = "confirmed",
|
|
41
|
+
corrected = "corrected"
|
|
42
|
+
}
|
|
43
|
+
export declare const COLLABORATOR_ACTION_LABELS: Record<CollaboratorAction, string>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* until closure is detected from QVET movements sync.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.INVENTORY_ITEM_STATUS_LABELS = exports.InventoryItemStatus = exports.INVENTORY_SESSION_STATUS_LABELS = exports.InventorySessionStatus = void 0;
|
|
10
|
+
exports.COLLABORATOR_ACTION_LABELS = exports.CollaboratorAction = exports.MANAGER_DECISION_LABELS = exports.ManagerDecision = exports.INVENTORY_REVIEW_STATUS_LABELS = exports.InventoryReviewStatus = exports.INVENTORY_ITEM_STATUS_LABELS = exports.InventoryItemStatus = exports.INVENTORY_SESSION_STATUS_LABELS = exports.InventorySessionStatus = void 0;
|
|
11
11
|
// --- Session Status ---
|
|
12
12
|
/** Lifecycle status of an inventory session */
|
|
13
13
|
var InventorySessionStatus;
|
|
@@ -32,3 +32,46 @@ exports.INVENTORY_ITEM_STATUS_LABELS = {
|
|
|
32
32
|
[InventoryItemStatus.counted]: "Contado",
|
|
33
33
|
[InventoryItemStatus.matched]: "Validado",
|
|
34
34
|
};
|
|
35
|
+
// --- Review Status (auto-calculated) ---
|
|
36
|
+
/** Auto-calculated review status based on count data vs stock */
|
|
37
|
+
var InventoryReviewStatus;
|
|
38
|
+
(function (InventoryReviewStatus) {
|
|
39
|
+
InventoryReviewStatus["pending"] = "pending";
|
|
40
|
+
InventoryReviewStatus["ok"] = "ok";
|
|
41
|
+
InventoryReviewStatus["tolerated"] = "tolerated";
|
|
42
|
+
InventoryReviewStatus["needs_review"] = "needs_review";
|
|
43
|
+
InventoryReviewStatus["verify_qvet"] = "verify_qvet";
|
|
44
|
+
})(InventoryReviewStatus || (exports.InventoryReviewStatus = InventoryReviewStatus = {}));
|
|
45
|
+
exports.INVENTORY_REVIEW_STATUS_LABELS = {
|
|
46
|
+
[InventoryReviewStatus.pending]: "Pendiente",
|
|
47
|
+
[InventoryReviewStatus.ok]: "OK",
|
|
48
|
+
[InventoryReviewStatus.tolerated]: "Tolerado",
|
|
49
|
+
[InventoryReviewStatus.needs_review]: "Revisar",
|
|
50
|
+
[InventoryReviewStatus.verify_qvet]: "Verificar QVET",
|
|
51
|
+
};
|
|
52
|
+
// --- Manager Decision ---
|
|
53
|
+
/** Decision made by the manager/reviewer on a counted item */
|
|
54
|
+
var ManagerDecision;
|
|
55
|
+
(function (ManagerDecision) {
|
|
56
|
+
ManagerDecision["validated"] = "validated";
|
|
57
|
+
ManagerDecision["loss"] = "loss";
|
|
58
|
+
ManagerDecision["justified"] = "justified";
|
|
59
|
+
ManagerDecision["recount"] = "recount";
|
|
60
|
+
})(ManagerDecision || (exports.ManagerDecision = ManagerDecision = {}));
|
|
61
|
+
exports.MANAGER_DECISION_LABELS = {
|
|
62
|
+
[ManagerDecision.validated]: "Validado",
|
|
63
|
+
[ManagerDecision.loss]: "Pérdida",
|
|
64
|
+
[ManagerDecision.justified]: "Justificado",
|
|
65
|
+
[ManagerDecision.recount]: "Recontar",
|
|
66
|
+
};
|
|
67
|
+
// --- Collaborator Action ---
|
|
68
|
+
/** Action taken by the collaborator on their own count */
|
|
69
|
+
var CollaboratorAction;
|
|
70
|
+
(function (CollaboratorAction) {
|
|
71
|
+
CollaboratorAction["confirmed"] = "confirmed";
|
|
72
|
+
CollaboratorAction["corrected"] = "corrected";
|
|
73
|
+
})(CollaboratorAction || (exports.CollaboratorAction = CollaboratorAction = {}));
|
|
74
|
+
exports.COLLABORATOR_ACTION_LABELS = {
|
|
75
|
+
[CollaboratorAction.confirmed]: "Confirmado",
|
|
76
|
+
[CollaboratorAction.corrected]: "Corregido",
|
|
77
|
+
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @example POST /api/qvet/inventory-sessions/:id/upload
|
|
8
8
|
* @example POST /api/qvet/inventory-sessions/:id/confirm-matches
|
|
9
9
|
*/
|
|
10
|
-
import { InventorySessionStatus } from '../../constants/inventory-session.enums';
|
|
10
|
+
import { InventorySessionStatus, CollaboratorAction, ManagerDecision } from '../../constants/inventory-session.enums';
|
|
11
11
|
import { Warehouse } from '../../types/qvet.types';
|
|
12
12
|
/**
|
|
13
13
|
* Create a new inventory session.
|
|
@@ -38,3 +38,29 @@ export interface ListInventorySessionsFilters {
|
|
|
38
38
|
warehouse?: Warehouse;
|
|
39
39
|
status?: InventorySessionStatus;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Item within an apply-review batch request.
|
|
43
|
+
*
|
|
44
|
+
* Can contain count data (collaborator), confirmation, or manager decision.
|
|
45
|
+
* All fields are optional — only send what changed.
|
|
46
|
+
*/
|
|
47
|
+
export interface ApplyReviewItemRequest {
|
|
48
|
+
qvetCode: number;
|
|
49
|
+
countedQuantity?: number;
|
|
50
|
+
countedExpiredQuantity?: number;
|
|
51
|
+
nextExpirationDate?: string;
|
|
52
|
+
comment?: string;
|
|
53
|
+
collaboratorAction?: CollaboratorAction;
|
|
54
|
+
managerDecision?: ManagerDecision;
|
|
55
|
+
reviewerNotes?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Batch apply review changes to multiple items.
|
|
59
|
+
*
|
|
60
|
+
* Replaces per-item PATCH calls. All changes are applied atomically.
|
|
61
|
+
*
|
|
62
|
+
* @example POST /api/qvet/inventory-sessions/:id/apply-review
|
|
63
|
+
*/
|
|
64
|
+
export interface ApplyReviewRequest {
|
|
65
|
+
items: ApplyReviewItemRequest[];
|
|
66
|
+
}
|
|
@@ -24,6 +24,10 @@ export interface InventorySessionSummaryResponse {
|
|
|
24
24
|
countedItems: number;
|
|
25
25
|
/** Items with status "matched" */
|
|
26
26
|
matchedItems: number;
|
|
27
|
+
/** Items needing review (reviewStatus = needs_review) */
|
|
28
|
+
needsReviewItems: number;
|
|
29
|
+
/** Items confirmed by collaborator but pending manager decision */
|
|
30
|
+
confirmedItems: number;
|
|
27
31
|
/** Number of times an Excel was uploaded */
|
|
28
32
|
uploadCount: number;
|
|
29
33
|
createdByName: string;
|
|
@@ -78,3 +82,25 @@ export interface UploadCountsResponse {
|
|
|
78
82
|
count: number;
|
|
79
83
|
};
|
|
80
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Warning about stock changes detected during review apply.
|
|
87
|
+
*/
|
|
88
|
+
export interface ApplyReviewWarning {
|
|
89
|
+
qvetCode: number;
|
|
90
|
+
description: string;
|
|
91
|
+
stockAtCount: number;
|
|
92
|
+
currentStock: number;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Response after applying review changes to a session.
|
|
96
|
+
*
|
|
97
|
+
* @example POST /api/qvet/inventory-sessions/:id/apply-review
|
|
98
|
+
*/
|
|
99
|
+
export interface ApplyReviewResponse {
|
|
100
|
+
/** Updated session detail */
|
|
101
|
+
session: InventorySessionDetailResponse;
|
|
102
|
+
/** Number of items processed */
|
|
103
|
+
applied: number;
|
|
104
|
+
/** Items where QVET stock changed since counting */
|
|
105
|
+
warnings?: ApplyReviewWarning[];
|
|
106
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Shared type definitions for inventory session items.
|
|
5
5
|
* Used by both requests and responses.
|
|
6
6
|
*/
|
|
7
|
-
import { InventoryItemStatus } from '../../constants/inventory-session.enums';
|
|
7
|
+
import { InventoryItemStatus, InventoryReviewStatus, ManagerDecision, CollaboratorAction } from '../../constants/inventory-session.enums';
|
|
8
8
|
/**
|
|
9
9
|
* Item data within an inventory session.
|
|
10
10
|
*
|
|
@@ -43,4 +43,16 @@ export interface InventorySessionItem {
|
|
|
43
43
|
matchedAt?: string;
|
|
44
44
|
/** Who confirmed the match */
|
|
45
45
|
matchedByName?: string;
|
|
46
|
+
/** Auto-calculated review status based on count vs stock */
|
|
47
|
+
reviewStatus?: InventoryReviewStatus;
|
|
48
|
+
/** Collaborator's confirmation of their count */
|
|
49
|
+
collaboratorAction?: CollaboratorAction;
|
|
50
|
+
/** Manager/reviewer decision */
|
|
51
|
+
managerDecision?: ManagerDecision;
|
|
52
|
+
/** Notes from the reviewer */
|
|
53
|
+
reviewerNotes?: string;
|
|
54
|
+
/** When the review was done (ISO 8601) */
|
|
55
|
+
reviewedAt?: string;
|
|
56
|
+
/** Name of the reviewer */
|
|
57
|
+
reviewedByName?: string;
|
|
46
58
|
}
|