hvp-shared 6.77.0 → 6.78.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.
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { InventorySessionStatus } from '../../constants/inventory-session.enums';
7
7
  import { Warehouse } from '../../types/qvet.types';
8
- import { InventorySessionItem } from './types';
8
+ import { InventorySessionItem, SessionActivity } from './types';
9
9
  /**
10
10
  * Summary of an inventory session for list views.
11
11
  *
@@ -43,6 +43,7 @@ export interface InventorySessionSummaryResponse {
43
43
  export interface InventorySessionDetailResponse extends InventorySessionSummaryResponse {
44
44
  createdById: string;
45
45
  items: InventorySessionItem[];
46
+ activityLog: SessionActivity[];
46
47
  }
47
48
  /**
48
49
  * Response after uploading a count Excel.
@@ -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, ManagerDecision, CollaboratorAction } from '../../constants/inventory-session.enums';
7
+ import { InventoryItemStatus, InventorySessionStatus, ManagerDecision, CollaboratorAction } from '../../constants/inventory-session.enums';
8
8
  /**
9
9
  * Item data within an inventory session.
10
10
  *
@@ -49,3 +49,39 @@ export interface InventorySessionItem {
49
49
  /** Name of the reviewer */
50
50
  reviewedByName?: string;
51
51
  }
52
+ export type SessionActivityAction = 'created' | 'uploaded' | 'reviewed' | 'downloaded' | 'refreshed' | 'exported' | 'bulk_loss';
53
+ export declare const SESSION_ACTIVITY_LABELS: Record<SessionActivityAction, string>;
54
+ /** Snapshot of session counts at a point in time */
55
+ export interface SessionActivitySnapshot {
56
+ pending: number;
57
+ resolved: number;
58
+ needsAttention: number;
59
+ inProgress: number;
60
+ sessionStatus: InventorySessionStatus;
61
+ }
62
+ /** Action-specific metrics */
63
+ export interface SessionActivityMetrics {
64
+ itemsUpdated?: number;
65
+ itemsNotFound?: number;
66
+ itemsSkipped?: number;
67
+ countChanges?: number;
68
+ confirmations?: number;
69
+ managerDecisions?: number;
70
+ autoAdjusted?: number;
71
+ resetToPending?: number;
72
+ itemsInSheet?: number;
73
+ filter?: 'pending' | 'all';
74
+ expirationsPropagated?: number;
75
+ totalLossMXN?: number;
76
+ totalSurplusMXN?: number;
77
+ }
78
+ /** Single entry in the session activity log */
79
+ export interface SessionActivity {
80
+ action: SessionActivityAction;
81
+ userName: string;
82
+ colCode: string;
83
+ timestamp: string;
84
+ snapshot: SessionActivitySnapshot;
85
+ metrics: SessionActivityMetrics;
86
+ details?: string;
87
+ }
@@ -6,3 +6,13 @@
6
6
  * Used by both requests and responses.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.SESSION_ACTIVITY_LABELS = void 0;
10
+ exports.SESSION_ACTIVITY_LABELS = {
11
+ created: 'Sesión creada',
12
+ uploaded: 'Conteo subido',
13
+ reviewed: 'Revisión aplicada',
14
+ downloaded: 'Hoja descargada',
15
+ refreshed: 'Stock actualizado',
16
+ exported: 'Hoja final exportada',
17
+ bulk_loss: 'Pérdidas aceptadas',
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.77.0",
3
+ "version": "6.78.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",