hvp-shared 6.10.0 → 6.11.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.
@@ -4,6 +4,32 @@
4
4
  * Response interfaces for QVET data endpoints.
5
5
  * Used by frontend to consume synced QVET data.
6
6
  */
7
+ /**
8
+ * Standard pagination info for QVET endpoints
9
+ */
10
+ export interface QvetPagination {
11
+ total: number;
12
+ limit: number;
13
+ skip: number;
14
+ hasMore: boolean;
15
+ }
16
+ /**
17
+ * Generic paginated response for QVET list endpoints
18
+ * Use this for all QVET list endpoints to ensure consistent pagination format.
19
+ *
20
+ * @example
21
+ * // Backend returns this structure:
22
+ * {
23
+ * ok: true,
24
+ * data: [...],
25
+ * pagination: { total: 100, limit: 25, skip: 0, hasMore: true }
26
+ * }
27
+ */
28
+ export interface QvetPaginatedResponse<T> {
29
+ ok: boolean;
30
+ data: T[];
31
+ pagination: QvetPagination;
32
+ }
7
33
  /**
8
34
  * Single sale record from QVET
9
35
  * Represents one line item in a sale transaction
@@ -40,17 +66,9 @@ export interface QvetSaleResponse {
40
66
  }
41
67
  /**
42
68
  * Paginated list of sales
69
+ * Uses generic QvetPaginatedResponse for consistent pagination format.
43
70
  */
44
- export interface QvetSalesListResponse {
45
- ok: boolean;
46
- data: QvetSaleResponse[];
47
- pagination: {
48
- total: number;
49
- limit: number;
50
- skip: number;
51
- hasMore: boolean;
52
- };
53
- }
71
+ export type QvetSalesListResponse = QvetPaginatedResponse<QvetSaleResponse>;
54
72
  /**
55
73
  * Sales summary statistics for a period
56
74
  */
@@ -134,17 +152,9 @@ export interface QvetPurchaseResponse {
134
152
  }
135
153
  /**
136
154
  * Paginated list of purchases
155
+ * Uses generic QvetPaginatedResponse for consistent pagination format.
137
156
  */
138
- export interface QvetPurchasesListResponse {
139
- ok: boolean;
140
- data: QvetPurchaseResponse[];
141
- pagination: {
142
- total: number;
143
- limit: number;
144
- skip: number;
145
- hasMore: boolean;
146
- };
147
- }
157
+ export type QvetPurchasesListResponse = QvetPaginatedResponse<QvetPurchaseResponse>;
148
158
  /**
149
159
  * Purchases summary statistics for a period
150
160
  */
@@ -221,17 +231,9 @@ export interface QvetMovementResponse {
221
231
  }
222
232
  /**
223
233
  * Paginated list of movements
234
+ * Uses generic QvetPaginatedResponse for consistent pagination format.
224
235
  */
225
- export interface QvetMovementsListResponse {
226
- ok: boolean;
227
- data: QvetMovementResponse[];
228
- pagination: {
229
- total: number;
230
- limit: number;
231
- skip: number;
232
- hasMore: boolean;
233
- };
234
- }
236
+ export type QvetMovementsListResponse = QvetPaginatedResponse<QvetMovementResponse>;
235
237
  /**
236
238
  * Movements summary statistics for a period
237
239
  */
@@ -295,17 +297,9 @@ export interface QvetTransferResponse {
295
297
  }
296
298
  /**
297
299
  * Paginated list of transfers
300
+ * Uses generic QvetPaginatedResponse for consistent pagination format.
298
301
  */
299
- export interface QvetTransfersListResponse {
300
- ok: boolean;
301
- data: QvetTransferResponse[];
302
- pagination: {
303
- total: number;
304
- limit: number;
305
- skip: number;
306
- hasMore: boolean;
307
- };
308
- }
302
+ export type QvetTransfersListResponse = QvetPaginatedResponse<QvetTransferResponse>;
309
303
  /**
310
304
  * Transfers summary statistics for a period
311
305
  */
@@ -336,3 +330,45 @@ export interface QvetTransfersQueryParams {
336
330
  skip?: number;
337
331
  sort?: string;
338
332
  }
333
+ /**
334
+ * Single item within a consolidated transfer
335
+ */
336
+ export interface ConsolidatedTransferItem {
337
+ productName: string;
338
+ quantity: number;
339
+ unitCost: number;
340
+ totalValue: number;
341
+ lot: string;
342
+ }
343
+ /**
344
+ * Consolidated transfer record
345
+ *
346
+ * QVET registers inter-warehouse transfers as multiple movements through
347
+ * intermediate "COLABORADOR-X" warehouses. This consolidated view combines
348
+ * those movements to show the real source and target warehouses.
349
+ *
350
+ * @example
351
+ * Original in QVET:
352
+ * ID 3206: MONTEJO → COLABORADOR-URBAN (exit)
353
+ * ID 3207: COLABORADOR-URBAN → URBAN CENTER (entry)
354
+ *
355
+ * Consolidated:
356
+ * realSource: "MONTEJO"
357
+ * realTarget: "URBAN CENTER"
358
+ * transferIds: [3206, 3207]
359
+ */
360
+ export interface ConsolidatedTransfer {
361
+ date: string;
362
+ realSource: string;
363
+ realTarget: string;
364
+ items: ConsolidatedTransferItem[];
365
+ totalItems: number;
366
+ totalQuantity: number;
367
+ totalValue: number;
368
+ transferIds: number[];
369
+ }
370
+ /**
371
+ * Paginated list of consolidated transfers
372
+ * Uses generic QvetPaginatedResponse for consistent pagination format.
373
+ */
374
+ export type ConsolidatedTransfersResponse = QvetPaginatedResponse<ConsolidatedTransfer>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.10.0",
3
+ "version": "6.11.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",