hvp-shared 3.8.0 → 4.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.
@@ -41,10 +41,10 @@ export interface CatalogItemQueryFilters {
41
41
  export interface UpdateCatalogItemRequest {
42
42
  /** Update description (sets pending) */
43
43
  description?: string;
44
- /** Update sale price (sets pending) */
45
- salePrice?: number;
46
- /** Update purchase price (sets pending) */
47
- purchasePrice?: number;
44
+ /** Update sale price PVP - con IVA (sets pending) */
45
+ salePricePVP?: number;
46
+ /** Update purchase price BI - sin IVA (sets pending) */
47
+ purchasePriceBI?: number;
48
48
  /** Update section (sets pending) */
49
49
  section?: string;
50
50
  /** Update family (sets pending) */
@@ -28,8 +28,10 @@ export interface CatalogItemListResponse {
28
28
  description: string;
29
29
  section: string;
30
30
  family: string;
31
- salePrice: number;
32
- minimumPrice: number;
31
+ /** Precio venta PVP (con IVA) */
32
+ salePricePVP: number;
33
+ /** Precio mínimo PVP (con IVA) */
34
+ minimumPricePVP: number;
33
35
  isActive: boolean;
34
36
  usageType: UsageType;
35
37
  hasPendingChanges: boolean;
@@ -56,15 +58,29 @@ export interface CatalogItemDetailResponse {
56
58
  family: SyncField<string>;
57
59
  subfamily: SyncField<string>;
58
60
  brand: SyncField<string>;
59
- purchasePrice: SyncField<number>;
60
- salePrice: SyncField<number>;
61
- minimumPrice: SyncField<number>;
62
- purchaseMargin: SyncField<number>;
63
- saleMargin: SyncField<number>;
64
- /** Calculated: purchasePrice / conversionFactor (price per sale unit) */
65
- unitPurchasePrice: number;
61
+ /** Precio compra por unidad de compra - Base Imponible (sin IVA) */
62
+ purchasePriceBI: SyncField<number>;
63
+ /** Precio venta por unidad de venta - PVP (con IVA) */
64
+ salePricePVP: SyncField<number>;
65
+ /** Precio mínimo por unidad de venta - PVP (con IVA) */
66
+ minimumPricePVP: SyncField<number>;
67
+ /** IVA venta (%) - ej: 16 */
66
68
  vatSale: SyncField<number>;
69
+ /** IVA compra (%) - ej: 16 */
67
70
  vatPurchase: SyncField<number>;
71
+ /** Precio compra unitario BI = purchasePriceBI / conversionFactor */
72
+ unitPurchasePriceBI: number;
73
+ /** Precio venta sin IVA = salePricePVP / (1 + vatSale/100) */
74
+ salePriceBI: number;
75
+ /** Precio mínimo sin IVA = minimumPricePVP / (1 + vatSale/100) */
76
+ minimumPriceBI: number;
77
+ /** Margen QVET (incorrecto, mezcla BI y PVP) - solo referencia */
78
+ qvetPurchaseMargin: SyncField<number>;
79
+ qvetSaleMargin: SyncField<number>;
80
+ /** Margen correcto precio venta = (salePriceBI - unitPurchasePriceBI) / unitPurchasePriceBI * 100 */
81
+ marginSale: number;
82
+ /** Margen correcto precio mínimo = (minimumPriceBI - unitPurchasePriceBI) / unitPurchasePriceBI * 100 */
83
+ marginMinimum: number;
68
84
  purchaseUnit: SyncField<string>;
69
85
  saleUnit: SyncField<string>;
70
86
  conversionFactor: SyncField<number>;
@@ -73,8 +89,11 @@ export interface CatalogItemDetailResponse {
73
89
  stockByWarehouse: WarehouseStockResponse[];
74
90
  observations: SyncField<string>;
75
91
  description2: SyncField<string>;
76
- visibleInSales: SyncField<string>;
77
- visibleInPurchases: SyncField<string>;
92
+ /** Visible en ventas (convertido de "S"/"N" a boolean) */
93
+ visibleInSales: SyncField<boolean>;
94
+ /** Visible en compras (convertido de "S"/"N" a boolean) */
95
+ visibleInPurchases: SyncField<boolean>;
96
+ /** Centros donde es visible (ej: "URBAN, HARBOR, MONTEJO") */
78
97
  visibleIn: SyncField<string>;
79
98
  qvetCreatedAt?: string;
80
99
  lastSaleDate?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "3.8.0",
3
+ "version": "4.0.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",