hvp-shared 9.2.0 → 9.4.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.
@@ -89,14 +89,23 @@ export declare enum DocumentStatus {
89
89
  outdated = "outdated",
90
90
  /**
91
91
  * Retirado: el documento ya no aplica, fue reemplazado o descontinuado.
92
- * Oculto por defecto en listas. ISO 9001 lo llama "obsolete".
92
+ * Oculto por defecto en listas. Reemplaza a `obsolete` desde 9.3.0
93
+ * (alineación con ISO/TR 10013 "withdrawn" y con la RAE — "retirado"
94
+ * captura mejor la decisión activa que "obsoleto").
95
+ */
96
+ withdrawn = "withdrawn",
97
+ /**
98
+ * @deprecated Renombrado a `withdrawn` desde 9.3.0. Sigue presente en
99
+ * el enum durante la ventana de migración para compat de lectura;
100
+ * removable en una mayor futura cuando la BBDD ya no contenga este
101
+ * valor. La UI lo trata como sinónimo de `withdrawn`.
93
102
  */
94
103
  obsolete = "obsolete",
95
104
  /**
96
105
  * Archivado-histórico: preservación de un documento cuya naturaleza es
97
106
  * registro (grabaciones de reunión, comunicados pasados, etc.). Oculto por
98
- * defecto. Distinto de `obsolete`: archived es preservación pasiva,
99
- * obsolete es retiro activo.
107
+ * defecto. Distinto de `withdrawn`: archived es preservación pasiva,
108
+ * withdrawn es retiro activo.
100
109
  */
101
110
  archived = "archived"
102
111
  }
@@ -124,14 +124,23 @@ var DocumentStatus;
124
124
  DocumentStatus["outdated"] = "outdated";
125
125
  /**
126
126
  * Retirado: el documento ya no aplica, fue reemplazado o descontinuado.
127
- * Oculto por defecto en listas. ISO 9001 lo llama "obsolete".
127
+ * Oculto por defecto en listas. Reemplaza a `obsolete` desde 9.3.0
128
+ * (alineación con ISO/TR 10013 "withdrawn" y con la RAE — "retirado"
129
+ * captura mejor la decisión activa que "obsoleto").
130
+ */
131
+ DocumentStatus["withdrawn"] = "withdrawn";
132
+ /**
133
+ * @deprecated Renombrado a `withdrawn` desde 9.3.0. Sigue presente en
134
+ * el enum durante la ventana de migración para compat de lectura;
135
+ * removable en una mayor futura cuando la BBDD ya no contenga este
136
+ * valor. La UI lo trata como sinónimo de `withdrawn`.
128
137
  */
129
138
  DocumentStatus["obsolete"] = "obsolete";
130
139
  /**
131
140
  * Archivado-histórico: preservación de un documento cuya naturaleza es
132
141
  * registro (grabaciones de reunión, comunicados pasados, etc.). Oculto por
133
- * defecto. Distinto de `obsolete`: archived es preservación pasiva,
134
- * obsolete es retiro activo.
142
+ * defecto. Distinto de `withdrawn`: archived es preservación pasiva,
143
+ * withdrawn es retiro activo.
135
144
  */
136
145
  DocumentStatus["archived"] = "archived";
137
146
  })(DocumentStatus || (exports.DocumentStatus = DocumentStatus = {}));
@@ -140,7 +149,9 @@ exports.DOCUMENT_STATUS_LABELS = {
140
149
  [DocumentStatus.in_review]: "En revisión",
141
150
  [DocumentStatus.published]: "Publicado",
142
151
  [DocumentStatus.outdated]: "Desactualizado",
143
- [DocumentStatus.obsolete]: "Obsoleto",
152
+ [DocumentStatus.withdrawn]: "Retirado",
153
+ // Deprecated alias — kept for read compat during 9.3.x migration window
154
+ [DocumentStatus.obsolete]: "Retirado",
144
155
  [DocumentStatus.archived]: "Archivado",
145
156
  };
146
157
  // ─── Criticality ────────────────────────────────────────────────────────────
@@ -14,7 +14,9 @@ import { ChangeType, ContentType, Criticality, DocumentStatus, DocumentType, Ext
14
14
  * endpoint for backward compat. The generic endpoint covers the new
15
15
  * lifecycle moves added in GH#22 SP2 plus return-to-published.
16
16
  */
17
- export type ChangeableDocumentStatus = DocumentStatus.outdated | DocumentStatus.obsolete | DocumentStatus.published;
17
+ export type ChangeableDocumentStatus = DocumentStatus.outdated | DocumentStatus.withdrawn
18
+ /** @deprecated alias of `withdrawn`; kept for compat during 9.3.x window. */
19
+ | DocumentStatus.obsolete | DocumentStatus.published;
18
20
  import { WebAppRole } from "../../constants/collaborator.constants";
19
21
  /**
20
22
  * One element of `audience[]`. Either a role or the `"all"` sentinel.
@@ -21,3 +21,4 @@ export * from './supplier-overlay';
21
21
  export * from './external-study';
22
22
  export * from './pending-dashboard';
23
23
  export * from './document';
24
+ export * from './supplier-orders';
@@ -37,3 +37,4 @@ __exportStar(require("./supplier-overlay"), exports);
37
37
  __exportStar(require("./external-study"), exports);
38
38
  __exportStar(require("./pending-dashboard"), exports);
39
39
  __exportStar(require("./document"), exports);
40
+ __exportStar(require("./supplier-orders"), exports);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Supplier Orders API Contracts
3
+ */
4
+ export * from './requests';
5
+ export * from './responses';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * Supplier Orders API Contracts
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ __exportStar(require("./requests"), exports);
21
+ __exportStar(require("./responses"), exports);
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Supplier Orders API Requests
3
+ */
4
+ /**
5
+ * Query filters for fetching supplier order suggestions.
6
+ *
7
+ * Used for: GET /api/inventory/supplier-orders
8
+ *
9
+ * @example GET /api/inventory/supplier-orders?supplier=DESEGO&months=12
10
+ */
11
+ export interface SupplierOrderQueryFilters {
12
+ supplier: string;
13
+ months?: number;
14
+ }
15
+ /**
16
+ * Query filters for the supplier list endpoint.
17
+ *
18
+ * Used for: GET /api/inventory/supplier-orders/suppliers
19
+ *
20
+ * @example GET /api/inventory/supplier-orders/suppliers?months=12
21
+ */
22
+ export interface SupplierListQueryFilters {
23
+ months?: number;
24
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Supplier Orders API Requests
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Supplier Orders API Responses
3
+ */
4
+ /**
5
+ * Stock figures (current / min / optimal) for a single warehouse or aggregated globally.
6
+ */
7
+ export interface SupplierOrderStockFigures {
8
+ currentStock: number;
9
+ minStock: number;
10
+ optimalStock: number;
11
+ }
12
+ /**
13
+ * Per-warehouse breakdown of stock for a single product.
14
+ */
15
+ export interface SupplierOrderWarehouseBreakdown extends SupplierOrderStockFigures {
16
+ warehouse: string;
17
+ }
18
+ /**
19
+ * Single product line in the supplier order suggestions response.
20
+ *
21
+ * `suggested` is computed as `max(optimalStock - currentStock, 0)` against the global
22
+ * (cross-warehouse) figures. `suggestedSubtotal` is the line cost without IVA.
23
+ */
24
+ export interface SupplierOrderItemResponse {
25
+ qvetCode: number;
26
+ name: string;
27
+ unitPurchasePrice: number;
28
+ global: SupplierOrderStockFigures & {
29
+ suggested: number;
30
+ };
31
+ byWarehouse: SupplierOrderWarehouseBreakdown[];
32
+ suggestedSubtotal: number;
33
+ }
34
+ /**
35
+ * Aggregate totals for the suggested order across all items.
36
+ */
37
+ export interface SupplierOrderTotals {
38
+ subtotalBeforeTax: number;
39
+ subtotalAfterTax: number;
40
+ }
41
+ /**
42
+ * Supplier Order Suggestions Response.
43
+ *
44
+ * Lists all products purchased from the given supplier within the time window,
45
+ * with current stock, min/opt thresholds, suggested quantity to order and totals.
46
+ *
47
+ * Used for: Supplier Orders dashboard page (manual order planning by supplier).
48
+ *
49
+ * @example GET /api/inventory/supplier-orders?supplier=DESEGO&months=12
50
+ */
51
+ export interface SupplierOrderSuggestionsResponse {
52
+ supplier: string;
53
+ months: number;
54
+ items: SupplierOrderItemResponse[];
55
+ totals: SupplierOrderTotals;
56
+ }
57
+ /**
58
+ * Supplier List Response.
59
+ *
60
+ * Distinct list of supplier names with at least one purchase within the window.
61
+ *
62
+ * Used for: Supplier dropdown on the Supplier Orders dashboard page.
63
+ *
64
+ * @example GET /api/inventory/supplier-orders/suppliers?months=12
65
+ */
66
+ export interface SupplierListResponse {
67
+ suppliers: string[];
68
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Supplier Orders API Responses
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "9.2.0",
3
+ "version": "9.4.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",