hvp-shared 3.4.0 → 3.5.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.
Files changed (36) hide show
  1. package/dist/constants/catalog-item.constants.d.ts +63 -0
  2. package/dist/constants/catalog-item.constants.js +80 -0
  3. package/dist/constants/index.d.ts +4 -0
  4. package/dist/constants/index.js +4 -0
  5. package/dist/{inventory → constants}/qvet-catalog.d.ts +8 -58
  6. package/dist/{inventory → constants}/qvet-catalog.js +10 -133
  7. package/dist/constants/qvet-inventory.d.ts +28 -0
  8. package/dist/constants/qvet-inventory.js +56 -0
  9. package/dist/constants/qvet-warehouses.d.ts +6 -0
  10. package/dist/constants/qvet-warehouses.js +9 -0
  11. package/dist/contracts/catalog-item/index.d.ts +2 -0
  12. package/dist/{inventory → contracts/catalog-item}/index.js +2 -1
  13. package/dist/contracts/catalog-item/requests.d.ts +113 -0
  14. package/dist/contracts/catalog-item/requests.js +7 -0
  15. package/dist/contracts/catalog-item/responses.d.ts +132 -0
  16. package/dist/contracts/catalog-item/responses.js +7 -0
  17. package/dist/contracts/index.d.ts +1 -0
  18. package/dist/contracts/index.js +1 -0
  19. package/dist/index.d.ts +2 -1
  20. package/dist/index.js +2 -1
  21. package/dist/types/catalog-item.types.d.ts +104 -0
  22. package/dist/types/catalog-item.types.js +7 -0
  23. package/dist/types/index.d.ts +3 -0
  24. package/dist/types/index.js +3 -0
  25. package/dist/types/qvet.types.d.ts +21 -0
  26. package/dist/types/qvet.types.js +9 -0
  27. package/dist/types/sync-field.types.d.ts +23 -0
  28. package/dist/types/sync-field.types.js +9 -0
  29. package/dist/utils/qvet-catalog.helpers.d.ts +37 -0
  30. package/dist/utils/qvet-catalog.helpers.js +104 -0
  31. package/dist/utils/sync-field.helpers.d.ts +84 -0
  32. package/dist/utils/sync-field.helpers.js +117 -0
  33. package/dist/utils/sync-field.helpers.test.d.ts +1 -0
  34. package/dist/utils/sync-field.helpers.test.js +149 -0
  35. package/package.json +1 -1
  36. package/dist/inventory/index.d.ts +0 -1
@@ -0,0 +1,63 @@
1
+ /**
2
+ * CatalogItem Constants
3
+ *
4
+ * Enums and constants for catalog items (products/services from QVET).
5
+ */
6
+ /**
7
+ * UsageType - How the item is used in HVP
8
+ *
9
+ * This is an HVP-only field (not in QVET).
10
+ */
11
+ export declare enum UsageType {
12
+ /** Direct sale to customer */
13
+ VENTA_DIRECTA = "ventaDirecta",
14
+ /** Optional sale (may or may not be charged) */
15
+ VENTA_OPCIONAL = "ventaOpcional",
16
+ /** Only used in recipes/compositions, never sold directly */
17
+ SOLO_ESCANDALLOS = "soloEscandallos",
18
+ /** Internal consumption (cleaning supplies, etc.) */
19
+ CONSUMO_INTERNO = "consumoInterno",
20
+ /** Fixed asset (equipment, furniture) */
21
+ ACTIVO_FIJO = "activoFijo"
22
+ }
23
+ /**
24
+ * All UsageType values as array (for dropdowns)
25
+ */
26
+ export declare const USAGE_TYPE_VALUES: UsageType[];
27
+ /**
28
+ * UsageType labels in Spanish (for UI)
29
+ */
30
+ export declare const USAGE_TYPE_LABELS: Record<UsageType, string>;
31
+ /**
32
+ * ArticleType - Type of article in QVET
33
+ */
34
+ export declare enum ArticleType {
35
+ MEDICAMENTO = "Medicamento",
36
+ SERVICIO = "Servicio",
37
+ NORMAL = "Normal"
38
+ }
39
+ /**
40
+ * All ArticleType values as array
41
+ */
42
+ export declare const ARTICLE_TYPE_VALUES: ArticleType[];
43
+ /**
44
+ * SyncStatus - Status of sync with QVET
45
+ */
46
+ export declare enum SyncStatus {
47
+ /** Fully synced with QVET, no pending changes */
48
+ SYNCED = "synced",
49
+ /** Has local changes pending upload to QVET */
50
+ PENDING = "pending",
51
+ /** Local changes conflict with QVET changes */
52
+ CONFLICT = "conflict",
53
+ /** Item exists in HVP but not found in last QVET sync */
54
+ MISSING_FROM_QVET = "missing_from_qvet"
55
+ }
56
+ /**
57
+ * All SyncStatus values as array
58
+ */
59
+ export declare const SYNC_STATUS_VALUES: SyncStatus[];
60
+ /**
61
+ * SyncStatus labels in Spanish (for UI)
62
+ */
63
+ export declare const SYNC_STATUS_LABELS: Record<SyncStatus, string>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /**
3
+ * CatalogItem Constants
4
+ *
5
+ * Enums and constants for catalog items (products/services from QVET).
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SYNC_STATUS_LABELS = exports.SYNC_STATUS_VALUES = exports.SyncStatus = exports.ARTICLE_TYPE_VALUES = exports.ArticleType = exports.USAGE_TYPE_LABELS = exports.USAGE_TYPE_VALUES = exports.UsageType = void 0;
9
+ /**
10
+ * UsageType - How the item is used in HVP
11
+ *
12
+ * This is an HVP-only field (not in QVET).
13
+ */
14
+ var UsageType;
15
+ (function (UsageType) {
16
+ /** Direct sale to customer */
17
+ UsageType["VENTA_DIRECTA"] = "ventaDirecta";
18
+ /** Optional sale (may or may not be charged) */
19
+ UsageType["VENTA_OPCIONAL"] = "ventaOpcional";
20
+ /** Only used in recipes/compositions, never sold directly */
21
+ UsageType["SOLO_ESCANDALLOS"] = "soloEscandallos";
22
+ /** Internal consumption (cleaning supplies, etc.) */
23
+ UsageType["CONSUMO_INTERNO"] = "consumoInterno";
24
+ /** Fixed asset (equipment, furniture) */
25
+ UsageType["ACTIVO_FIJO"] = "activoFijo";
26
+ })(UsageType || (exports.UsageType = UsageType = {}));
27
+ /**
28
+ * All UsageType values as array (for dropdowns)
29
+ */
30
+ exports.USAGE_TYPE_VALUES = Object.values(UsageType);
31
+ /**
32
+ * UsageType labels in Spanish (for UI)
33
+ */
34
+ exports.USAGE_TYPE_LABELS = {
35
+ [UsageType.VENTA_DIRECTA]: 'Venta Directa',
36
+ [UsageType.VENTA_OPCIONAL]: 'Venta Opcional',
37
+ [UsageType.SOLO_ESCANDALLOS]: 'Solo Escandallos',
38
+ [UsageType.CONSUMO_INTERNO]: 'Consumo Interno',
39
+ [UsageType.ACTIVO_FIJO]: 'Activo Fijo',
40
+ };
41
+ /**
42
+ * ArticleType - Type of article in QVET
43
+ */
44
+ var ArticleType;
45
+ (function (ArticleType) {
46
+ ArticleType["MEDICAMENTO"] = "Medicamento";
47
+ ArticleType["SERVICIO"] = "Servicio";
48
+ ArticleType["NORMAL"] = "Normal";
49
+ })(ArticleType || (exports.ArticleType = ArticleType = {}));
50
+ /**
51
+ * All ArticleType values as array
52
+ */
53
+ exports.ARTICLE_TYPE_VALUES = Object.values(ArticleType);
54
+ /**
55
+ * SyncStatus - Status of sync with QVET
56
+ */
57
+ var SyncStatus;
58
+ (function (SyncStatus) {
59
+ /** Fully synced with QVET, no pending changes */
60
+ SyncStatus["SYNCED"] = "synced";
61
+ /** Has local changes pending upload to QVET */
62
+ SyncStatus["PENDING"] = "pending";
63
+ /** Local changes conflict with QVET changes */
64
+ SyncStatus["CONFLICT"] = "conflict";
65
+ /** Item exists in HVP but not found in last QVET sync */
66
+ SyncStatus["MISSING_FROM_QVET"] = "missing_from_qvet";
67
+ })(SyncStatus || (exports.SyncStatus = SyncStatus = {}));
68
+ /**
69
+ * All SyncStatus values as array
70
+ */
71
+ exports.SYNC_STATUS_VALUES = Object.values(SyncStatus);
72
+ /**
73
+ * SyncStatus labels in Spanish (for UI)
74
+ */
75
+ exports.SYNC_STATUS_LABELS = {
76
+ [SyncStatus.SYNCED]: 'Sincronizado',
77
+ [SyncStatus.PENDING]: 'Pendiente',
78
+ [SyncStatus.CONFLICT]: 'Conflicto',
79
+ [SyncStatus.MISSING_FROM_QVET]: 'No encontrado en QVET',
80
+ };
@@ -4,3 +4,7 @@
4
4
  export * from './mexican-states';
5
5
  export * from './sat-catalogs';
6
6
  export * from './collaborator.constants';
7
+ export * from './catalog-item.constants';
8
+ export * from './qvet-catalog';
9
+ export * from './qvet-warehouses';
10
+ export * from './qvet-inventory';
@@ -20,3 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  __exportStar(require("./mexican-states"), exports);
21
21
  __exportStar(require("./sat-catalogs"), exports);
22
22
  __exportStar(require("./collaborator.constants"), exports);
23
+ __exportStar(require("./catalog-item.constants"), exports);
24
+ __exportStar(require("./qvet-catalog"), exports);
25
+ __exportStar(require("./qvet-warehouses"), exports);
26
+ __exportStar(require("./qvet-inventory"), exports);
@@ -1,10 +1,17 @@
1
1
  /**
2
2
  * QVET Catalog
3
- * Complete hierarchy of sections, families, and subfamilies from QVET system
3
+ *
4
+ * Complete hierarchy of sections, families, and subfamilies from QVET system.
4
5
  * Source: QVET system export (Updated 2026-01-10)
5
6
  *
6
7
  * Structure: SECTION → FAMILY → SUBFAMILY[]
7
8
  * Each combination is unique and can change independently in QVET.
9
+ *
10
+ * Related files:
11
+ * - Types: types/qvet.types.ts
12
+ * - Inventory rules: constants/qvet-inventory.ts
13
+ * - Warehouses: constants/qvet-warehouses.ts
14
+ * - Helpers: utils/qvet-catalog.helpers.ts
8
15
  */
9
16
  export declare const QVET_SECTIONS: {
10
17
  readonly EQUIPAMIENTO: "EQUIPAMIENTO";
@@ -17,7 +24,6 @@ export declare const QVET_SECTIONS: {
17
24
  readonly SERVICIOS_MEDICOS: "SERVICIOS MEDICOS";
18
25
  readonly SUMINISTROS_GENERALES: "SUMINISTROS GENERALES";
19
26
  };
20
- export type QvetSection = typeof QVET_SECTIONS[keyof typeof QVET_SECTIONS];
21
27
  export declare const QVET_CATALOG: {
22
28
  readonly EQUIPAMIENTO: {
23
29
  readonly UNICA: readonly ["UNICA"];
@@ -107,63 +113,7 @@ export declare const QVET_CATALOG: {
107
113
  readonly PAPELERIA: readonly ["UNICA"];
108
114
  };
109
115
  };
110
- export type QvetCatalog = typeof QVET_CATALOG;
111
116
  /**
112
117
  * All section values as array
113
118
  */
114
119
  export declare const QVET_SECTIONS_LIST: ("EQUIPAMIENTO" | "FARMACIA" | "FARMACIA INTERNA" | "INSUMOS MEDICOS" | "OTROS ARTICULOS" | "OTROS SERVICIOS" | "SERVICIOS EXTERNOS" | "SERVICIOS MEDICOS" | "SUMINISTROS GENERALES")[];
115
- /**
116
- * Sections that are countable for inventory (physical items, not services)
117
- * Excludes: OTROS SERVICIOS, SERVICIOS EXTERNOS, SERVICIOS MEDICOS
118
- */
119
- export declare const INVENTORY_COUNTABLE_SECTIONS: readonly ["EQUIPAMIENTO", "FARMACIA", "FARMACIA INTERNA", "INSUMOS MEDICOS", "OTROS ARTICULOS", "SUMINISTROS GENERALES"];
120
- /**
121
- * Set for quick lookup of countable sections
122
- */
123
- export declare const INVENTORY_COUNTABLE_SECTIONS_SET: ReadonlySet<string>;
124
- /**
125
- * Priority sections for sorting (appear first in count sheets)
126
- */
127
- export declare const SECTION_SORT_PRIORITY: readonly ["FARMACIA", "FARMACIA INTERNA", "INSUMOS MEDICOS"];
128
- /**
129
- * Get all families for a section
130
- */
131
- export declare function getFamiliesForSection(section: string): string[];
132
- /**
133
- * Get all subfamilies for a section + family combination
134
- */
135
- export declare function getSubfamiliesForFamily(section: string, family: string): readonly string[];
136
- /**
137
- * Check if a section exists in the catalog
138
- */
139
- export declare function isValidSection(section: string): boolean;
140
- /**
141
- * Check if a section is countable (physical inventory)
142
- */
143
- export declare function isCountableSection(section: string): boolean;
144
- /**
145
- * Check if a family exists within a section
146
- */
147
- export declare function isValidFamily(section: string, family: string): boolean;
148
- /**
149
- * Check if a subfamily exists within a section + family
150
- */
151
- export declare function isValidSubfamily(section: string, family: string, subfamily: string): boolean;
152
- /**
153
- * Get sort order for a section (lower = higher priority)
154
- */
155
- export declare function getSectionSortOrder(section: string): number;
156
- /**
157
- * Sections that ALWAYS require expiration date tracking
158
- */
159
- export declare const SECTIONS_REQUIRE_EXPIRATION: readonly ["FARMACIA", "FARMACIA INTERNA"];
160
- /**
161
- * Specific families within sections that require expiration date tracking
162
- */
163
- export declare const FAMILIES_REQUIRE_EXPIRATION: Partial<Record<QvetSection, readonly string[]>>;
164
- /**
165
- * Check if an item requires expiration date tracking based on section and family
166
- */
167
- export declare function requiresExpirationDate(section: string, family: string): boolean;
168
- export declare const WAREHOUSES: readonly ["HARBOR", "MONTEJO", "URBAN CENTER"];
169
- export type Warehouse = typeof WAREHOUSES[number];
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
  /**
3
3
  * QVET Catalog
4
- * Complete hierarchy of sections, families, and subfamilies from QVET system
4
+ *
5
+ * Complete hierarchy of sections, families, and subfamilies from QVET system.
5
6
  * Source: QVET system export (Updated 2026-01-10)
6
7
  *
7
8
  * Structure: SECTION → FAMILY → SUBFAMILY[]
8
9
  * Each combination is unique and can change independently in QVET.
10
+ *
11
+ * Related files:
12
+ * - Types: types/qvet.types.ts
13
+ * - Inventory rules: constants/qvet-inventory.ts
14
+ * - Warehouses: constants/qvet-warehouses.ts
15
+ * - Helpers: utils/qvet-catalog.helpers.ts
9
16
  */
10
17
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.WAREHOUSES = exports.FAMILIES_REQUIRE_EXPIRATION = exports.SECTIONS_REQUIRE_EXPIRATION = exports.SECTION_SORT_PRIORITY = exports.INVENTORY_COUNTABLE_SECTIONS_SET = exports.INVENTORY_COUNTABLE_SECTIONS = exports.QVET_SECTIONS_LIST = exports.QVET_CATALOG = exports.QVET_SECTIONS = void 0;
12
- exports.getFamiliesForSection = getFamiliesForSection;
13
- exports.getSubfamiliesForFamily = getSubfamiliesForFamily;
14
- exports.isValidSection = isValidSection;
15
- exports.isCountableSection = isCountableSection;
16
- exports.isValidFamily = isValidFamily;
17
- exports.isValidSubfamily = isValidSubfamily;
18
- exports.getSectionSortOrder = getSectionSortOrder;
19
- exports.requiresExpirationDate = requiresExpirationDate;
18
+ exports.QVET_SECTIONS_LIST = exports.QVET_CATALOG = exports.QVET_SECTIONS = void 0;
20
19
  // =============================================================================
21
20
  // SECTIONS (Single source of truth for section strings)
22
21
  // =============================================================================
@@ -136,131 +135,9 @@ exports.QVET_CATALOG = {
136
135
  },
137
136
  };
138
137
  // =============================================================================
139
- // DERIVED CONSTANTS (No string repetition - use QVET_SECTIONS)
138
+ // DERIVED LISTS
140
139
  // =============================================================================
141
140
  /**
142
141
  * All section values as array
143
142
  */
144
143
  exports.QVET_SECTIONS_LIST = Object.values(exports.QVET_SECTIONS);
145
- /**
146
- * Sections that are countable for inventory (physical items, not services)
147
- * Excludes: OTROS SERVICIOS, SERVICIOS EXTERNOS, SERVICIOS MEDICOS
148
- */
149
- exports.INVENTORY_COUNTABLE_SECTIONS = [
150
- exports.QVET_SECTIONS.EQUIPAMIENTO,
151
- exports.QVET_SECTIONS.FARMACIA,
152
- exports.QVET_SECTIONS.FARMACIA_INTERNA,
153
- exports.QVET_SECTIONS.INSUMOS_MEDICOS,
154
- exports.QVET_SECTIONS.OTROS_ARTICULOS,
155
- exports.QVET_SECTIONS.SUMINISTROS_GENERALES,
156
- ];
157
- /**
158
- * Set for quick lookup of countable sections
159
- */
160
- exports.INVENTORY_COUNTABLE_SECTIONS_SET = new Set(exports.INVENTORY_COUNTABLE_SECTIONS);
161
- /**
162
- * Priority sections for sorting (appear first in count sheets)
163
- */
164
- exports.SECTION_SORT_PRIORITY = [
165
- exports.QVET_SECTIONS.FARMACIA,
166
- exports.QVET_SECTIONS.FARMACIA_INTERNA,
167
- exports.QVET_SECTIONS.INSUMOS_MEDICOS,
168
- ];
169
- // =============================================================================
170
- // UTILITY FUNCTIONS
171
- // =============================================================================
172
- /**
173
- * Get all families for a section
174
- */
175
- function getFamiliesForSection(section) {
176
- const sectionData = exports.QVET_CATALOG[section];
177
- if (!sectionData)
178
- return [];
179
- return Object.keys(sectionData);
180
- }
181
- /**
182
- * Get all subfamilies for a section + family combination
183
- */
184
- function getSubfamiliesForFamily(section, family) {
185
- const sectionData = exports.QVET_CATALOG[section];
186
- if (!sectionData)
187
- return [];
188
- const familyData = sectionData[family];
189
- if (!familyData)
190
- return [];
191
- return familyData;
192
- }
193
- /**
194
- * Check if a section exists in the catalog
195
- */
196
- function isValidSection(section) {
197
- return section in exports.QVET_CATALOG;
198
- }
199
- /**
200
- * Check if a section is countable (physical inventory)
201
- */
202
- function isCountableSection(section) {
203
- return exports.INVENTORY_COUNTABLE_SECTIONS_SET.has(section);
204
- }
205
- /**
206
- * Check if a family exists within a section
207
- */
208
- function isValidFamily(section, family) {
209
- const sectionData = exports.QVET_CATALOG[section];
210
- if (!sectionData)
211
- return false;
212
- return family in sectionData;
213
- }
214
- /**
215
- * Check if a subfamily exists within a section + family
216
- */
217
- function isValidSubfamily(section, family, subfamily) {
218
- const subfamilies = getSubfamiliesForFamily(section, family);
219
- return subfamilies.includes(subfamily);
220
- }
221
- /**
222
- * Get sort order for a section (lower = higher priority)
223
- */
224
- function getSectionSortOrder(section) {
225
- const index = exports.SECTION_SORT_PRIORITY.indexOf(section);
226
- if (index >= 0) {
227
- return index;
228
- }
229
- // Non-priority sections come after, sorted alphabetically
230
- return exports.SECTION_SORT_PRIORITY.length + section.charCodeAt(0);
231
- }
232
- // =============================================================================
233
- // EXPIRATION DATE REQUIREMENTS
234
- // =============================================================================
235
- /**
236
- * Sections that ALWAYS require expiration date tracking
237
- */
238
- exports.SECTIONS_REQUIRE_EXPIRATION = [
239
- exports.QVET_SECTIONS.FARMACIA,
240
- exports.QVET_SECTIONS.FARMACIA_INTERNA,
241
- ];
242
- /**
243
- * Specific families within sections that require expiration date tracking
244
- */
245
- exports.FAMILIES_REQUIRE_EXPIRATION = {
246
- [exports.QVET_SECTIONS.INSUMOS_MEDICOS]: ['SUEROS Y SOLUCIONES', 'VACUNAS'],
247
- };
248
- /**
249
- * Check if an item requires expiration date tracking based on section and family
250
- */
251
- function requiresExpirationDate(section, family) {
252
- // Full section requires expiration
253
- if (exports.SECTIONS_REQUIRE_EXPIRATION.includes(section)) {
254
- return true;
255
- }
256
- // Check specific families within sections
257
- const familiesForSection = exports.FAMILIES_REQUIRE_EXPIRATION[section];
258
- if (familiesForSection) {
259
- return familiesForSection.includes(family);
260
- }
261
- return false;
262
- }
263
- // =============================================================================
264
- // WAREHOUSES
265
- // =============================================================================
266
- exports.WAREHOUSES = ['HARBOR', 'MONTEJO', 'URBAN CENTER'];
@@ -0,0 +1,28 @@
1
+ /**
2
+ * QVET Inventory Constants
3
+ *
4
+ * Constants related to inventory management: countable sections,
5
+ * sort priorities, and expiration date requirements.
6
+ */
7
+ import { QvetSection } from '../types/qvet.types';
8
+ /**
9
+ * Sections that are countable for inventory (physical items, not services)
10
+ * Excludes: OTROS SERVICIOS, SERVICIOS EXTERNOS, SERVICIOS MEDICOS
11
+ */
12
+ export declare const INVENTORY_COUNTABLE_SECTIONS: readonly ["EQUIPAMIENTO", "FARMACIA", "FARMACIA INTERNA", "INSUMOS MEDICOS", "OTROS ARTICULOS", "SUMINISTROS GENERALES"];
13
+ /**
14
+ * Set for quick lookup of countable sections
15
+ */
16
+ export declare const INVENTORY_COUNTABLE_SECTIONS_SET: ReadonlySet<string>;
17
+ /**
18
+ * Priority sections for sorting (appear first in count sheets)
19
+ */
20
+ export declare const SECTION_SORT_PRIORITY: readonly ["FARMACIA", "FARMACIA INTERNA", "INSUMOS MEDICOS"];
21
+ /**
22
+ * Sections that ALWAYS require expiration date tracking
23
+ */
24
+ export declare const SECTIONS_REQUIRE_EXPIRATION: readonly ["FARMACIA", "FARMACIA INTERNA"];
25
+ /**
26
+ * Specific families within sections that require expiration date tracking
27
+ */
28
+ export declare const FAMILIES_REQUIRE_EXPIRATION: Partial<Record<QvetSection, readonly string[]>>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /**
3
+ * QVET Inventory Constants
4
+ *
5
+ * Constants related to inventory management: countable sections,
6
+ * sort priorities, and expiration date requirements.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.FAMILIES_REQUIRE_EXPIRATION = exports.SECTIONS_REQUIRE_EXPIRATION = exports.SECTION_SORT_PRIORITY = exports.INVENTORY_COUNTABLE_SECTIONS_SET = exports.INVENTORY_COUNTABLE_SECTIONS = void 0;
10
+ const qvet_catalog_1 = require("./qvet-catalog");
11
+ // =============================================================================
12
+ // COUNTABLE SECTIONS (Physical items, not services)
13
+ // =============================================================================
14
+ /**
15
+ * Sections that are countable for inventory (physical items, not services)
16
+ * Excludes: OTROS SERVICIOS, SERVICIOS EXTERNOS, SERVICIOS MEDICOS
17
+ */
18
+ exports.INVENTORY_COUNTABLE_SECTIONS = [
19
+ qvet_catalog_1.QVET_SECTIONS.EQUIPAMIENTO,
20
+ qvet_catalog_1.QVET_SECTIONS.FARMACIA,
21
+ qvet_catalog_1.QVET_SECTIONS.FARMACIA_INTERNA,
22
+ qvet_catalog_1.QVET_SECTIONS.INSUMOS_MEDICOS,
23
+ qvet_catalog_1.QVET_SECTIONS.OTROS_ARTICULOS,
24
+ qvet_catalog_1.QVET_SECTIONS.SUMINISTROS_GENERALES,
25
+ ];
26
+ /**
27
+ * Set for quick lookup of countable sections
28
+ */
29
+ exports.INVENTORY_COUNTABLE_SECTIONS_SET = new Set(exports.INVENTORY_COUNTABLE_SECTIONS);
30
+ // =============================================================================
31
+ // SORT PRIORITY
32
+ // =============================================================================
33
+ /**
34
+ * Priority sections for sorting (appear first in count sheets)
35
+ */
36
+ exports.SECTION_SORT_PRIORITY = [
37
+ qvet_catalog_1.QVET_SECTIONS.FARMACIA,
38
+ qvet_catalog_1.QVET_SECTIONS.FARMACIA_INTERNA,
39
+ qvet_catalog_1.QVET_SECTIONS.INSUMOS_MEDICOS,
40
+ ];
41
+ // =============================================================================
42
+ // EXPIRATION DATE REQUIREMENTS
43
+ // =============================================================================
44
+ /**
45
+ * Sections that ALWAYS require expiration date tracking
46
+ */
47
+ exports.SECTIONS_REQUIRE_EXPIRATION = [
48
+ qvet_catalog_1.QVET_SECTIONS.FARMACIA,
49
+ qvet_catalog_1.QVET_SECTIONS.FARMACIA_INTERNA,
50
+ ];
51
+ /**
52
+ * Specific families within sections that require expiration date tracking
53
+ */
54
+ exports.FAMILIES_REQUIRE_EXPIRATION = {
55
+ [qvet_catalog_1.QVET_SECTIONS.INSUMOS_MEDICOS]: ['SUEROS Y SOLUCIONES', 'VACUNAS'],
56
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * QVET Warehouses
3
+ *
4
+ * Physical warehouse locations in QVET system.
5
+ */
6
+ export declare const WAREHOUSES: readonly ["HARBOR", "MONTEJO", "URBAN CENTER"];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * QVET Warehouses
4
+ *
5
+ * Physical warehouse locations in QVET system.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.WAREHOUSES = void 0;
9
+ exports.WAREHOUSES = ['HARBOR', 'MONTEJO', 'URBAN CENTER'];
@@ -0,0 +1,2 @@
1
+ export * from './requests';
2
+ export * from './responses';
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./qvet-catalog"), exports);
17
+ __exportStar(require("./requests"), exports);
18
+ __exportStar(require("./responses"), exports);
@@ -0,0 +1,113 @@
1
+ /**
2
+ * CatalogItem Request Types
3
+ *
4
+ * Request DTOs for catalog item endpoints.
5
+ */
6
+ import { UsageType, SyncStatus } from '../../constants/catalog-item.constants';
7
+ /**
8
+ * Query filters for listing catalog items
9
+ *
10
+ * @example GET /api/catalog-items?section=FARMACIA&isActive=true&page=1&limit=20
11
+ */
12
+ export interface CatalogItemQueryFilters {
13
+ /** Filter by section */
14
+ section?: string;
15
+ /** Filter by family */
16
+ family?: string;
17
+ /** Filter by usage type */
18
+ usageType?: UsageType;
19
+ /** Filter by active status */
20
+ isActive?: boolean;
21
+ /** Filter by sync status */
22
+ syncStatus?: SyncStatus;
23
+ /** Show only items with pending changes */
24
+ hasPendingChanges?: boolean;
25
+ /** Search in description/barcode */
26
+ search?: string;
27
+ /** Page number (1-indexed) */
28
+ page?: number;
29
+ /** Items per page */
30
+ limit?: number;
31
+ /** Sort field */
32
+ sortBy?: 'description' | 'qvetCode' | 'section' | 'salePrice' | 'updatedAt';
33
+ /** Sort direction */
34
+ sortOrder?: 'asc' | 'desc';
35
+ }
36
+ /**
37
+ * Update QVET sync fields (sets pending values)
38
+ *
39
+ * @example PATCH /api/catalog-items/:id
40
+ */
41
+ export interface UpdateCatalogItemRequest {
42
+ /** Update description (sets pending) */
43
+ description?: string;
44
+ /** Update sale price (sets pending) */
45
+ salePrice?: number;
46
+ /** Update purchase price (sets pending) */
47
+ purchasePrice?: number;
48
+ /** Update section (sets pending) */
49
+ section?: string;
50
+ /** Update family (sets pending) */
51
+ family?: string;
52
+ /** Update subfamily (sets pending) */
53
+ subfamily?: string;
54
+ /** Update barcode (sets pending) */
55
+ barcode?: string;
56
+ /** Update reference (sets pending) */
57
+ reference?: string;
58
+ /** Update brand (sets pending) */
59
+ brand?: string;
60
+ /** Update active status (sets pending) */
61
+ isActive?: boolean;
62
+ /** Update stock control type (sets pending) */
63
+ stockControlType?: string;
64
+ }
65
+ /**
66
+ * Update HVP-only fields (direct update, no pending)
67
+ *
68
+ * @example PATCH /api/catalog-items/:id/hvp-data
69
+ */
70
+ export interface UpdateCatalogItemHvpDataRequest {
71
+ /** Usage type */
72
+ usageType?: UsageType;
73
+ /** Internal notes */
74
+ notes?: string;
75
+ /** Internal category */
76
+ internalCategory?: string;
77
+ }
78
+ /**
79
+ * Update stock levels for a warehouse (sets pending)
80
+ *
81
+ * @example PATCH /api/catalog-items/:id/stock/:warehouse
82
+ */
83
+ export interface UpdateWarehouseStockRequest {
84
+ /** Minimum stock level */
85
+ minStock?: number;
86
+ /** Optimal stock level */
87
+ optimalStock?: number;
88
+ }
89
+ /**
90
+ * Bulk update request
91
+ *
92
+ * @example PATCH /api/catalog-items/bulk
93
+ */
94
+ export interface BulkUpdateCatalogItemsRequest {
95
+ /** Item IDs to update */
96
+ ids: string[];
97
+ /** Updates to apply */
98
+ updates: {
99
+ /** Update usage type for all selected items */
100
+ usageType?: UsageType;
101
+ /** Update active status (sets pending) */
102
+ isActive?: boolean;
103
+ };
104
+ }
105
+ /**
106
+ * Revert a field to QVET value
107
+ *
108
+ * @example POST /api/catalog-items/:id/revert/:field
109
+ */
110
+ export interface RevertFieldRequest {
111
+ /** Field name to revert */
112
+ field: string;
113
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * CatalogItem Request Types
4
+ *
5
+ * Request DTOs for catalog item endpoints.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });