hvp-shared 3.3.3 → 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.
- package/dist/constants/catalog-item.constants.d.ts +63 -0
- package/dist/constants/catalog-item.constants.js +80 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +4 -0
- package/dist/constants/qvet-catalog.d.ts +119 -0
- package/dist/constants/qvet-catalog.js +143 -0
- package/dist/constants/qvet-inventory.d.ts +28 -0
- package/dist/constants/qvet-inventory.js +56 -0
- package/dist/constants/qvet-warehouses.d.ts +6 -0
- package/dist/constants/qvet-warehouses.js +9 -0
- package/dist/contracts/catalog-item/index.d.ts +2 -0
- package/dist/contracts/catalog-item/index.js +18 -0
- package/dist/contracts/catalog-item/requests.d.ts +113 -0
- package/dist/contracts/catalog-item/requests.js +7 -0
- package/dist/contracts/catalog-item/responses.d.ts +132 -0
- package/dist/contracts/catalog-item/responses.js +7 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/types/catalog-item.types.d.ts +104 -0
- package/dist/types/catalog-item.types.js +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/qvet.types.d.ts +21 -0
- package/dist/types/qvet.types.js +9 -0
- package/dist/types/sync-field.types.d.ts +23 -0
- package/dist/types/sync-field.types.js +9 -0
- package/dist/utils/qvet-catalog.helpers.d.ts +37 -0
- package/dist/utils/qvet-catalog.helpers.js +104 -0
- package/dist/utils/sync-field.helpers.d.ts +84 -0
- package/dist/utils/sync-field.helpers.js +117 -0
- package/dist/utils/sync-field.helpers.test.d.ts +1 -0
- package/dist/utils/sync-field.helpers.test.js +149 -0
- package/package.json +1 -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
|
+
};
|
package/dist/constants/index.js
CHANGED
|
@@ -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);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QVET Catalog
|
|
3
|
+
*
|
|
4
|
+
* Complete hierarchy of sections, families, and subfamilies from QVET system.
|
|
5
|
+
* Source: QVET system export (Updated 2026-01-10)
|
|
6
|
+
*
|
|
7
|
+
* Structure: SECTION → FAMILY → SUBFAMILY[]
|
|
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
|
|
15
|
+
*/
|
|
16
|
+
export declare const QVET_SECTIONS: {
|
|
17
|
+
readonly EQUIPAMIENTO: "EQUIPAMIENTO";
|
|
18
|
+
readonly FARMACIA: "FARMACIA";
|
|
19
|
+
readonly FARMACIA_INTERNA: "FARMACIA INTERNA";
|
|
20
|
+
readonly INSUMOS_MEDICOS: "INSUMOS MEDICOS";
|
|
21
|
+
readonly OTROS_ARTICULOS: "OTROS ARTICULOS";
|
|
22
|
+
readonly OTROS_SERVICIOS: "OTROS SERVICIOS";
|
|
23
|
+
readonly SERVICIOS_EXTERNOS: "SERVICIOS EXTERNOS";
|
|
24
|
+
readonly SERVICIOS_MEDICOS: "SERVICIOS MEDICOS";
|
|
25
|
+
readonly SUMINISTROS_GENERALES: "SUMINISTROS GENERALES";
|
|
26
|
+
};
|
|
27
|
+
export declare const QVET_CATALOG: {
|
|
28
|
+
readonly EQUIPAMIENTO: {
|
|
29
|
+
readonly UNICA: readonly ["UNICA"];
|
|
30
|
+
};
|
|
31
|
+
readonly FARMACIA: {
|
|
32
|
+
readonly 'ANESTESICOS O TRANQUILIZANTES': readonly ["UNICA"];
|
|
33
|
+
readonly ANTIBIOTICOS: readonly ["UNICA"];
|
|
34
|
+
readonly 'ANTIINFLAMATORIOS O ANALGESICOS': readonly ["UNICA"];
|
|
35
|
+
readonly ANTIMICOTICOS: readonly ["UNICA"];
|
|
36
|
+
readonly ANTIPARASITARIOS: readonly ["UNICA"];
|
|
37
|
+
readonly CARDIOLOGICOS: readonly ["UNICA"];
|
|
38
|
+
readonly DERMATOLOGICOS: readonly ["UNICA"];
|
|
39
|
+
readonly GASTROENTEROLOGICOS: readonly ["UNICA"];
|
|
40
|
+
readonly OFTALMOLOGICOS: readonly ["UNICA"];
|
|
41
|
+
readonly OTOLOGICOS: readonly ["UNICA"];
|
|
42
|
+
readonly OTROS: readonly ["UNICA"];
|
|
43
|
+
readonly SUPLEMENTOS: readonly ["UNICA"];
|
|
44
|
+
readonly TIROIDEOS: readonly ["UNICA"];
|
|
45
|
+
};
|
|
46
|
+
readonly "FARMACIA INTERNA": {
|
|
47
|
+
readonly 'ANESTESICOS O TRANQUILIZANTES': readonly ["UNICA"];
|
|
48
|
+
readonly ANTIBIOTICOS: readonly ["UNICA"];
|
|
49
|
+
readonly 'ANTIINFLAMATORIOS O ANALGESICOS': readonly ["UNICA"];
|
|
50
|
+
readonly ANTIPARASITARIOS: readonly ["UNICA"];
|
|
51
|
+
readonly CARDIOLOGICOS: readonly ["UNICA"];
|
|
52
|
+
readonly GASTROENTEROLOGICOS: readonly ["UNICA"];
|
|
53
|
+
readonly OFTALMOLOGICOS: readonly ["UNICA"];
|
|
54
|
+
readonly OTROS: readonly ["UNICA"];
|
|
55
|
+
};
|
|
56
|
+
readonly "INSUMOS MEDICOS": {
|
|
57
|
+
readonly AGUJAS: readonly ["UNICA"];
|
|
58
|
+
readonly CATETERES: readonly ["UNICA"];
|
|
59
|
+
readonly CURACION: readonly ["UNICA"];
|
|
60
|
+
readonly 'INDUMENTARIA SANITARIA': readonly ["UNICA"];
|
|
61
|
+
readonly 'INSUMOS PARA PRUEBAS': readonly ["UNICA"];
|
|
62
|
+
readonly JERINGAS: readonly ["UNICA"];
|
|
63
|
+
readonly OFTALMOLOGIA: readonly ["UNICA"];
|
|
64
|
+
readonly OTROS: readonly ["UNICA"];
|
|
65
|
+
readonly SONDAS: readonly ["UNICA"];
|
|
66
|
+
readonly 'SUEROS Y SOLUCIONES': readonly ["UNICA"];
|
|
67
|
+
readonly SUTURAS: readonly ["UNICA"];
|
|
68
|
+
readonly TESTS: readonly ["UNICA"];
|
|
69
|
+
readonly VACUNAS: readonly ["UNICA"];
|
|
70
|
+
readonly VENDAS: readonly ["UNICA"];
|
|
71
|
+
};
|
|
72
|
+
readonly "OTROS ARTICULOS": {
|
|
73
|
+
readonly MICROCHIP: readonly ["UNICA"];
|
|
74
|
+
readonly OTROS: readonly ["UNICA"];
|
|
75
|
+
};
|
|
76
|
+
readonly "OTROS SERVICIOS": {
|
|
77
|
+
readonly FCM: readonly ["UNICA"];
|
|
78
|
+
readonly GUARDERIA: readonly ["UNICA"];
|
|
79
|
+
readonly 'OTROS SERVICIOS': readonly ["UNICA"];
|
|
80
|
+
readonly PAQUETES: readonly ["UNICA"];
|
|
81
|
+
readonly PENSION: readonly ["UNICA"];
|
|
82
|
+
readonly 'RENTA QUIROFANO': readonly ["UNICA"];
|
|
83
|
+
};
|
|
84
|
+
readonly "SERVICIOS EXTERNOS": {
|
|
85
|
+
readonly 'CONSULTAS EXTERNAS': readonly ["UNICA"];
|
|
86
|
+
readonly INCINERACION: readonly ["INCINERACION", "SERVICIOS ADICIONALES", "URNAS Y RELICARIOS"];
|
|
87
|
+
readonly LABORATORIO: readonly ["COPROPARASITOSCOPICO", "CULTIVOS", "CUSHING", "HEMOGRAMA", "HEMOPARASITOS", "OTROS", "PATOLOGIA CLINICA", "PERFIL HORMONAL", "PERFIL TIROIDEO", "QUIMICA SANGUINEA", "TOMOGRAFIA"];
|
|
88
|
+
readonly OTROS: readonly ["UNICA"];
|
|
89
|
+
readonly 'PRUEBAS DE GABINETE': readonly ["ELECTROCARDIOGRAMA", "OTROS", "RADIOLOGIA", "ULTRASONIDO"];
|
|
90
|
+
};
|
|
91
|
+
readonly "SERVICIOS MEDICOS": {
|
|
92
|
+
readonly 'ASISTENCIA QUIRURGICA': readonly ["UNICA"];
|
|
93
|
+
readonly 'CERTIFICADOS DE SALUD': readonly ["UNICA"];
|
|
94
|
+
readonly 'CIRUGIA DE TEJIDOS BLANDOS': readonly ["ABDOMEN", "CABEZA", "NEOPLASIA", "OTROS", "PERINEO", "TORAX"];
|
|
95
|
+
readonly CONSULTA: readonly ["DOMICILIARIA", "ESPECIALIDAD", "GENERAL", "REVISION"];
|
|
96
|
+
readonly DESPARASITACION: readonly ["UNICA"];
|
|
97
|
+
readonly DIAGNOSTICO: readonly ["UNICA"];
|
|
98
|
+
readonly EMERGENCIA: readonly ["UNICA"];
|
|
99
|
+
readonly EUTANASIA: readonly ["UNICA"];
|
|
100
|
+
readonly HOSPITALIZACION: readonly ["UNICA"];
|
|
101
|
+
readonly OFTALMOLOGIA: readonly ["UNICA"];
|
|
102
|
+
readonly ORTOPEDIA: readonly ["UNICA"];
|
|
103
|
+
readonly OTROS: readonly ["UNICA"];
|
|
104
|
+
readonly TRATAMIENTO: readonly ["UNICA"];
|
|
105
|
+
readonly VACUNAS: readonly ["UNICA"];
|
|
106
|
+
};
|
|
107
|
+
readonly "SUMINISTROS GENERALES": {
|
|
108
|
+
readonly ALIMENTOS: readonly ["UNICA"];
|
|
109
|
+
readonly ETIQUETAS: readonly ["UNICA"];
|
|
110
|
+
readonly IMPRESOS: readonly ["UNICA"];
|
|
111
|
+
readonly LIMPIEZA: readonly ["UNICA"];
|
|
112
|
+
readonly OTROS: readonly ["UNICA"];
|
|
113
|
+
readonly PAPELERIA: readonly ["UNICA"];
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* All section values as array
|
|
118
|
+
*/
|
|
119
|
+
export declare const QVET_SECTIONS_LIST: ("EQUIPAMIENTO" | "FARMACIA" | "FARMACIA INTERNA" | "INSUMOS MEDICOS" | "OTROS ARTICULOS" | "OTROS SERVICIOS" | "SERVICIOS EXTERNOS" | "SERVICIOS MEDICOS" | "SUMINISTROS GENERALES")[];
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QVET Catalog
|
|
4
|
+
*
|
|
5
|
+
* Complete hierarchy of sections, families, and subfamilies from QVET system.
|
|
6
|
+
* Source: QVET system export (Updated 2026-01-10)
|
|
7
|
+
*
|
|
8
|
+
* Structure: SECTION → FAMILY → SUBFAMILY[]
|
|
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
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.QVET_SECTIONS_LIST = exports.QVET_CATALOG = exports.QVET_SECTIONS = void 0;
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// SECTIONS (Single source of truth for section strings)
|
|
21
|
+
// =============================================================================
|
|
22
|
+
exports.QVET_SECTIONS = {
|
|
23
|
+
EQUIPAMIENTO: 'EQUIPAMIENTO',
|
|
24
|
+
FARMACIA: 'FARMACIA',
|
|
25
|
+
FARMACIA_INTERNA: 'FARMACIA INTERNA',
|
|
26
|
+
INSUMOS_MEDICOS: 'INSUMOS MEDICOS',
|
|
27
|
+
OTROS_ARTICULOS: 'OTROS ARTICULOS',
|
|
28
|
+
OTROS_SERVICIOS: 'OTROS SERVICIOS',
|
|
29
|
+
SERVICIOS_EXTERNOS: 'SERVICIOS EXTERNOS',
|
|
30
|
+
SERVICIOS_MEDICOS: 'SERVICIOS MEDICOS',
|
|
31
|
+
SUMINISTROS_GENERALES: 'SUMINISTROS GENERALES',
|
|
32
|
+
};
|
|
33
|
+
// =============================================================================
|
|
34
|
+
// COMPLETE CATALOG (Section → Family → Subfamilies)
|
|
35
|
+
// =============================================================================
|
|
36
|
+
exports.QVET_CATALOG = {
|
|
37
|
+
[exports.QVET_SECTIONS.EQUIPAMIENTO]: {
|
|
38
|
+
'UNICA': ['UNICA'],
|
|
39
|
+
},
|
|
40
|
+
[exports.QVET_SECTIONS.FARMACIA]: {
|
|
41
|
+
'ANESTESICOS O TRANQUILIZANTES': ['UNICA'],
|
|
42
|
+
'ANTIBIOTICOS': ['UNICA'],
|
|
43
|
+
'ANTIINFLAMATORIOS O ANALGESICOS': ['UNICA'],
|
|
44
|
+
'ANTIMICOTICOS': ['UNICA'],
|
|
45
|
+
'ANTIPARASITARIOS': ['UNICA'],
|
|
46
|
+
'CARDIOLOGICOS': ['UNICA'],
|
|
47
|
+
'DERMATOLOGICOS': ['UNICA'],
|
|
48
|
+
'GASTROENTEROLOGICOS': ['UNICA'],
|
|
49
|
+
'OFTALMOLOGICOS': ['UNICA'],
|
|
50
|
+
'OTOLOGICOS': ['UNICA'],
|
|
51
|
+
'OTROS': ['UNICA'],
|
|
52
|
+
'SUPLEMENTOS': ['UNICA'],
|
|
53
|
+
'TIROIDEOS': ['UNICA'],
|
|
54
|
+
},
|
|
55
|
+
[exports.QVET_SECTIONS.FARMACIA_INTERNA]: {
|
|
56
|
+
'ANESTESICOS O TRANQUILIZANTES': ['UNICA'],
|
|
57
|
+
'ANTIBIOTICOS': ['UNICA'],
|
|
58
|
+
'ANTIINFLAMATORIOS O ANALGESICOS': ['UNICA'],
|
|
59
|
+
'ANTIPARASITARIOS': ['UNICA'],
|
|
60
|
+
'CARDIOLOGICOS': ['UNICA'],
|
|
61
|
+
'GASTROENTEROLOGICOS': ['UNICA'],
|
|
62
|
+
'OFTALMOLOGICOS': ['UNICA'],
|
|
63
|
+
'OTROS': ['UNICA'],
|
|
64
|
+
},
|
|
65
|
+
[exports.QVET_SECTIONS.INSUMOS_MEDICOS]: {
|
|
66
|
+
'AGUJAS': ['UNICA'],
|
|
67
|
+
'CATETERES': ['UNICA'],
|
|
68
|
+
'CURACION': ['UNICA'],
|
|
69
|
+
'INDUMENTARIA SANITARIA': ['UNICA'],
|
|
70
|
+
'INSUMOS PARA PRUEBAS': ['UNICA'],
|
|
71
|
+
'JERINGAS': ['UNICA'],
|
|
72
|
+
'OFTALMOLOGIA': ['UNICA'],
|
|
73
|
+
'OTROS': ['UNICA'],
|
|
74
|
+
'SONDAS': ['UNICA'],
|
|
75
|
+
'SUEROS Y SOLUCIONES': ['UNICA'],
|
|
76
|
+
'SUTURAS': ['UNICA'],
|
|
77
|
+
'TESTS': ['UNICA'],
|
|
78
|
+
'VACUNAS': ['UNICA'],
|
|
79
|
+
'VENDAS': ['UNICA'],
|
|
80
|
+
},
|
|
81
|
+
[exports.QVET_SECTIONS.OTROS_ARTICULOS]: {
|
|
82
|
+
'MICROCHIP': ['UNICA'],
|
|
83
|
+
'OTROS': ['UNICA'],
|
|
84
|
+
},
|
|
85
|
+
[exports.QVET_SECTIONS.OTROS_SERVICIOS]: {
|
|
86
|
+
'FCM': ['UNICA'],
|
|
87
|
+
'GUARDERIA': ['UNICA'],
|
|
88
|
+
'OTROS SERVICIOS': ['UNICA'],
|
|
89
|
+
'PAQUETES': ['UNICA'],
|
|
90
|
+
'PENSION': ['UNICA'],
|
|
91
|
+
'RENTA QUIROFANO': ['UNICA'],
|
|
92
|
+
},
|
|
93
|
+
[exports.QVET_SECTIONS.SERVICIOS_EXTERNOS]: {
|
|
94
|
+
'CONSULTAS EXTERNAS': ['UNICA'],
|
|
95
|
+
'INCINERACION': ['INCINERACION', 'SERVICIOS ADICIONALES', 'URNAS Y RELICARIOS'],
|
|
96
|
+
'LABORATORIO': [
|
|
97
|
+
'COPROPARASITOSCOPICO',
|
|
98
|
+
'CULTIVOS',
|
|
99
|
+
'CUSHING',
|
|
100
|
+
'HEMOGRAMA',
|
|
101
|
+
'HEMOPARASITOS',
|
|
102
|
+
'OTROS',
|
|
103
|
+
'PATOLOGIA CLINICA',
|
|
104
|
+
'PERFIL HORMONAL',
|
|
105
|
+
'PERFIL TIROIDEO',
|
|
106
|
+
'QUIMICA SANGUINEA',
|
|
107
|
+
'TOMOGRAFIA',
|
|
108
|
+
],
|
|
109
|
+
'OTROS': ['UNICA'],
|
|
110
|
+
'PRUEBAS DE GABINETE': ['ELECTROCARDIOGRAMA', 'OTROS', 'RADIOLOGIA', 'ULTRASONIDO'],
|
|
111
|
+
},
|
|
112
|
+
[exports.QVET_SECTIONS.SERVICIOS_MEDICOS]: {
|
|
113
|
+
'ASISTENCIA QUIRURGICA': ['UNICA'],
|
|
114
|
+
'CERTIFICADOS DE SALUD': ['UNICA'],
|
|
115
|
+
'CIRUGIA DE TEJIDOS BLANDOS': ['ABDOMEN', 'CABEZA', 'NEOPLASIA', 'OTROS', 'PERINEO', 'TORAX'],
|
|
116
|
+
'CONSULTA': ['DOMICILIARIA', 'ESPECIALIDAD', 'GENERAL', 'REVISION'],
|
|
117
|
+
'DESPARASITACION': ['UNICA'],
|
|
118
|
+
'DIAGNOSTICO': ['UNICA'],
|
|
119
|
+
'EMERGENCIA': ['UNICA'],
|
|
120
|
+
'EUTANASIA': ['UNICA'],
|
|
121
|
+
'HOSPITALIZACION': ['UNICA'],
|
|
122
|
+
'OFTALMOLOGIA': ['UNICA'],
|
|
123
|
+
'ORTOPEDIA': ['UNICA'],
|
|
124
|
+
'OTROS': ['UNICA'],
|
|
125
|
+
'TRATAMIENTO': ['UNICA'],
|
|
126
|
+
'VACUNAS': ['UNICA'],
|
|
127
|
+
},
|
|
128
|
+
[exports.QVET_SECTIONS.SUMINISTROS_GENERALES]: {
|
|
129
|
+
'ALIMENTOS': ['UNICA'],
|
|
130
|
+
'ETIQUETAS': ['UNICA'],
|
|
131
|
+
'IMPRESOS': ['UNICA'],
|
|
132
|
+
'LIMPIEZA': ['UNICA'],
|
|
133
|
+
'OTROS': ['UNICA'],
|
|
134
|
+
'PAPELERIA': ['UNICA'],
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
// =============================================================================
|
|
138
|
+
// DERIVED LISTS
|
|
139
|
+
// =============================================================================
|
|
140
|
+
/**
|
|
141
|
+
* All section values as array
|
|
142
|
+
*/
|
|
143
|
+
exports.QVET_SECTIONS_LIST = Object.values(exports.QVET_SECTIONS);
|
|
@@ -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,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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
|
+
}
|