hvp-shared 6.71.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.
@@ -21,3 +21,4 @@ export * from './time-off.enums';
21
21
  export * from './time-off.constants';
22
22
  export * from './hris.constants';
23
23
  export * from './payroll-features.constants';
24
+ export * from './inventory-session.enums';
@@ -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
+ };
@@ -11,3 +11,4 @@ export * from './stock-calculation';
11
11
  export * from './cash-reconciliation';
12
12
  export * from './time-off-request';
13
13
  export * from './job';
14
+ export * from './inventory-session';
@@ -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,3 @@
1
+ export * from './types';
2
+ export * from './requests';
3
+ export * from './responses';
@@ -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,7 @@
1
+ "use strict";
2
+ /**
3
+ * Inventory Session Response Types
4
+ *
5
+ * Response DTOs for inventory session endpoints.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Inventory Session Types
4
+ *
5
+ * Shared type definitions for inventory session items.
6
+ * Used by both requests and responses.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.71.0",
3
+ "version": "6.72.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",