hvp-shared 9.4.0 → 10.0.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.
|
@@ -50,8 +50,6 @@ export interface CreateDocumentRequest {
|
|
|
50
50
|
title: string;
|
|
51
51
|
/** Optional — auto-generated from title via slugify if omitted. */
|
|
52
52
|
slug?: string;
|
|
53
|
-
/** Optional human-readable code (e.g. "PROT-EGO-01"). */
|
|
54
|
-
code?: string;
|
|
55
53
|
purpose: Purpose;
|
|
56
54
|
type: DocumentType;
|
|
57
55
|
tags?: string[];
|
|
@@ -75,7 +73,6 @@ export interface CreateDocumentRequest {
|
|
|
75
73
|
export interface UpdateDocumentMetadataRequest {
|
|
76
74
|
title?: string;
|
|
77
75
|
slug?: string;
|
|
78
|
-
code?: string | null;
|
|
79
76
|
purpose?: Purpose;
|
|
80
77
|
type?: DocumentType;
|
|
81
78
|
tags?: string[];
|
|
@@ -28,7 +28,6 @@ export interface PublicDocumentResponse {
|
|
|
28
28
|
id: string;
|
|
29
29
|
slug: string;
|
|
30
30
|
title: string;
|
|
31
|
-
code: string | null;
|
|
32
31
|
purpose: Purpose;
|
|
33
32
|
type: DocumentType;
|
|
34
33
|
status: DocumentStatus;
|
|
@@ -74,7 +73,6 @@ export interface DocumentSummaryResponse {
|
|
|
74
73
|
id: string;
|
|
75
74
|
slug: string;
|
|
76
75
|
title: string;
|
|
77
|
-
code: string | null;
|
|
78
76
|
purpose: Purpose;
|
|
79
77
|
type: DocumentType;
|
|
80
78
|
status: DocumentStatus;
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Stock figures (current / min / optimal) for a single warehouse or aggregated globally.
|
|
6
|
+
*
|
|
7
|
+
* Values are expressed in **sale units** (the unit that stock is tracked in:
|
|
8
|
+
* ml, tablets, individual items). To convert to purchase units (bottle, box,
|
|
9
|
+
* case), divide by `conversionFactor`.
|
|
6
10
|
*/
|
|
7
11
|
export interface SupplierOrderStockFigures {
|
|
8
12
|
currentStock: number;
|
|
@@ -10,7 +14,7 @@ export interface SupplierOrderStockFigures {
|
|
|
10
14
|
optimalStock: number;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
|
-
* Per-warehouse breakdown of stock for a single product.
|
|
17
|
+
* Per-warehouse breakdown of stock for a single product (in sale units).
|
|
14
18
|
*/
|
|
15
19
|
export interface SupplierOrderWarehouseBreakdown extends SupplierOrderStockFigures {
|
|
16
20
|
warehouse: string;
|
|
@@ -18,17 +22,40 @@ export interface SupplierOrderWarehouseBreakdown extends SupplierOrderStockFigur
|
|
|
18
22
|
/**
|
|
19
23
|
* Single product line in the supplier order suggestions response.
|
|
20
24
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
25
|
+
* Stock and the sale-unit gap are tracked in **sale units**, but the suggested
|
|
26
|
+
* order quantity is expressed in **purchase units** (bottle, box) — that's how
|
|
27
|
+
* suppliers actually fulfill orders. The conversion uses `ceil` because you
|
|
28
|
+
* can't buy 0.9 bottles.
|
|
29
|
+
*
|
|
30
|
+
* - `gapSaleUnits` = max(optimalStock - currentStock, 0) (sale units)
|
|
31
|
+
* - `global.suggested` = ceil(gapSaleUnits / conversionFactor) (purchase units)
|
|
32
|
+
* - `suggestedSubtotal` = global.suggested × purchaseUnitPrice (MXN, no IVA)
|
|
23
33
|
*/
|
|
24
34
|
export interface SupplierOrderItemResponse {
|
|
25
35
|
qvetCode: number;
|
|
26
36
|
name: string;
|
|
27
|
-
|
|
37
|
+
/** Unit in which the supplier sells (e.g. "BOTELLA", "CAJA"). Drives the order quantity. */
|
|
38
|
+
purchaseUnit: string;
|
|
39
|
+
/** Unit in which the product is dispensed/sold (e.g. "ML", "PIEZA"). Drives stock figures. */
|
|
40
|
+
saleUnit: string;
|
|
41
|
+
/** Sale units contained in one purchase unit (e.g. 100 if a bottle has 100 ml). */
|
|
42
|
+
conversionFactor: number;
|
|
43
|
+
/** Price per purchase unit (BI, no IVA). */
|
|
44
|
+
purchaseUnitPrice: number;
|
|
45
|
+
/** Price per sale unit (BI, no IVA). Informative — used for granular calculations. */
|
|
46
|
+
saleUnitPrice: number;
|
|
47
|
+
/**
|
|
48
|
+
* Global stock figures across all warehouses, in sale units.
|
|
49
|
+
* `suggested` here is in **purchase units** (the field used in the order).
|
|
50
|
+
* `gapSaleUnits` is the raw gap before conversion.
|
|
51
|
+
*/
|
|
28
52
|
global: SupplierOrderStockFigures & {
|
|
53
|
+
gapSaleUnits: number;
|
|
29
54
|
suggested: number;
|
|
30
55
|
};
|
|
56
|
+
/** Per-warehouse breakdown (sale units). */
|
|
31
57
|
byWarehouse: SupplierOrderWarehouseBreakdown[];
|
|
58
|
+
/** Line cost = global.suggested × purchaseUnitPrice (MXN, no IVA). */
|
|
32
59
|
suggestedSubtotal: number;
|
|
33
60
|
}
|
|
34
61
|
/**
|