hvp-shared 6.89.0 → 6.91.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.
@@ -25,6 +25,8 @@ export declare enum JobType {
25
25
  SYNC_INVENTORY_SNAPSHOT = "SYNC_INVENTORY_SNAPSHOT",
26
26
  SYNC_COLLECTION_DETAILS = "SYNC_COLLECTION_DETAILS",
27
27
  SYNC_SALE_DETAILS = "SYNC_SALE_DETAILS",
28
+ SYNC_PAYABLES = "SYNC_PAYABLES",
29
+ SYNC_STAFF = "SYNC_STAFF",
28
30
  SYNC_BATCH = "SYNC_BATCH",
29
31
  SYNC_ALL = "SYNC_ALL",
30
32
  SYNC_FACTURAMA_PRODUCTS = "SYNC_FACTURAMA_PRODUCTS"
@@ -65,7 +67,11 @@ export declare enum ReportType {
65
67
  /** Collection details (Cobros detalle) - uses date range params */
66
68
  COLLECTION_DETAILS = "COLLECTION_DETAILS",
67
69
  /** Sale details (Detalle ventas, Report 89) - uses date range params */
68
- SALE_DETAILS = "SALE_DETAILS"
70
+ SALE_DETAILS = "SALE_DETAILS",
71
+ /** Payables / Accounts payable (Vencimientos, Report 718) - uses date range params */
72
+ PAYABLES = "PAYABLES",
73
+ /** Staff / Personnel catalog (Report 102) - no date params required */
74
+ STAFF = "STAFF"
69
75
  }
70
76
  /**
71
77
  * Sub-task status within a batch job
@@ -29,6 +29,8 @@ var JobType;
29
29
  JobType["SYNC_INVENTORY_SNAPSHOT"] = "SYNC_INVENTORY_SNAPSHOT";
30
30
  JobType["SYNC_COLLECTION_DETAILS"] = "SYNC_COLLECTION_DETAILS";
31
31
  JobType["SYNC_SALE_DETAILS"] = "SYNC_SALE_DETAILS";
32
+ JobType["SYNC_PAYABLES"] = "SYNC_PAYABLES";
33
+ JobType["SYNC_STAFF"] = "SYNC_STAFF";
32
34
  JobType["SYNC_BATCH"] = "SYNC_BATCH";
33
35
  JobType["SYNC_ALL"] = "SYNC_ALL";
34
36
  JobType["SYNC_FACTURAMA_PRODUCTS"] = "SYNC_FACTURAMA_PRODUCTS";
@@ -71,6 +73,10 @@ var ReportType;
71
73
  ReportType["COLLECTION_DETAILS"] = "COLLECTION_DETAILS";
72
74
  /** Sale details (Detalle ventas, Report 89) - uses date range params */
73
75
  ReportType["SALE_DETAILS"] = "SALE_DETAILS";
76
+ /** Payables / Accounts payable (Vencimientos, Report 718) - uses date range params */
77
+ ReportType["PAYABLES"] = "PAYABLES";
78
+ /** Staff / Personnel catalog (Report 102) - no date params required */
79
+ ReportType["STAFF"] = "STAFF";
74
80
  })(ReportType || (exports.ReportType = ReportType = {}));
75
81
  /**
76
82
  * Sub-task status within a batch job
@@ -103,6 +109,8 @@ exports.REPORT_PARAM_TYPES = {
103
109
  [ReportType.SUPPLIERS]: 'no_params',
104
110
  [ReportType.COLLECTION_DETAILS]: 'date_range',
105
111
  [ReportType.SALE_DETAILS]: 'date_range',
112
+ [ReportType.PAYABLES]: 'date_range',
113
+ [ReportType.STAFF]: 'no_params',
106
114
  };
107
115
  /**
108
116
  * Job execution status
@@ -146,6 +154,8 @@ exports.JOB_TYPE_LABELS = {
146
154
  [JobType.SYNC_INVENTORY_SNAPSHOT]: 'Sincronizar Snapshot Inventario',
147
155
  [JobType.SYNC_COLLECTION_DETAILS]: 'Sincronizar Cobros Detalle',
148
156
  [JobType.SYNC_SALE_DETAILS]: 'Sincronizar Detalle Ventas',
157
+ [JobType.SYNC_PAYABLES]: 'Sincronizar Cuentas por Pagar',
158
+ [JobType.SYNC_STAFF]: 'Sincronizar Personal',
149
159
  [JobType.SYNC_BATCH]: 'Sincronización por Lotes',
150
160
  [JobType.SYNC_ALL]: 'Sincronizar Todo',
151
161
  [JobType.SYNC_FACTURAMA_PRODUCTS]: 'Sincronizar Productos Facturama',
@@ -170,6 +180,8 @@ exports.REPORT_TYPE_LABELS = {
170
180
  [ReportType.SUPPLIERS]: 'Proveedores',
171
181
  [ReportType.COLLECTION_DETAILS]: 'Cobros Detalle',
172
182
  [ReportType.SALE_DETAILS]: 'Detalle Ventas',
183
+ [ReportType.PAYABLES]: 'Cuentas por Pagar',
184
+ [ReportType.STAFF]: 'Personal',
173
185
  };
174
186
  /**
175
187
  * Human-readable labels for sub-task status (Spanish for UI)
@@ -34,12 +34,6 @@ export declare const SAT_GLOBAL_PERIODICITY: {
34
34
  readonly bimonthly: "05";
35
35
  };
36
36
  export type SATGlobalPeriodicityCode = (typeof SAT_GLOBAL_PERIODICITY)[keyof typeof SAT_GLOBAL_PERIODICITY];
37
- /**
38
- * Maps QVET product sections to SAT ClaveProdServ codes.
39
- * Used when individual products don't have assigned SAT codes.
40
- * Admin-configurable via company settings.
41
- */
42
- export declare const DEFAULT_SECTION_SAT_CODES: Record<string, string>;
43
37
  /**
44
38
  * Fallback SAT product code when section mapping is not found.
45
39
  */
@@ -6,7 +6,7 @@
6
6
  * (Público en General) per Mexican SAT requirements.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.DEFAULT_SAT_PRODUCT_CODE = exports.DEFAULT_SECTION_SAT_CODES = exports.SAT_GLOBAL_PERIODICITY = exports.GLOBAL_INVOICE_RECEIVER = exports.GLOBAL_INVOICE_STATUS_LABELS = exports.GlobalInvoiceStatus = void 0;
9
+ exports.DEFAULT_SAT_PRODUCT_CODE = exports.SAT_GLOBAL_PERIODICITY = exports.GLOBAL_INVOICE_RECEIVER = exports.GLOBAL_INVOICE_STATUS_LABELS = exports.GlobalInvoiceStatus = void 0;
10
10
  // ============================================================================
11
11
  // Global Invoice Status
12
12
  // ============================================================================
@@ -52,26 +52,6 @@ exports.SAT_GLOBAL_PERIODICITY = {
52
52
  monthly: "04",
53
53
  bimonthly: "05",
54
54
  };
55
- // ============================================================================
56
- // Default Section-to-SAT Code Mapping
57
- // ============================================================================
58
- /**
59
- * Maps QVET product sections to SAT ClaveProdServ codes.
60
- * Used when individual products don't have assigned SAT codes.
61
- * Admin-configurable via company settings.
62
- */
63
- exports.DEFAULT_SECTION_SAT_CODES = {
64
- CONSULTAS: "85121800", // Servicios veterinarios
65
- CIRUGIAS: "85121801", // Servicios quirúrgicos
66
- LABORATORIO: "85121802", // Servicios de laboratorio clínico
67
- HOSPITALIZACION: "85121800", // Servicios médicos
68
- FARMACIA: "51101500", // Productos farmacéuticos
69
- ACCESORIOS: "10191500", // Accesorios para mascotas
70
- ALIMENTO: "10191500", // Alimento para mascotas
71
- ESTETICA: "85121800", // Servicios de estética animal
72
- IMAGENOLOGIA: "85121802", // Servicios de diagnóstico por imagen
73
- VACUNAS: "51101500", // Vacunas
74
- };
75
55
  /**
76
56
  * Fallback SAT product code when section mapping is not found.
77
57
  */
@@ -43,20 +43,6 @@ describe("SAT_GLOBAL_PERIODICITY", () => {
43
43
  expect(values).toEqual(["01", "02", "03", "04", "05"]);
44
44
  });
45
45
  });
46
- describe("DEFAULT_SECTION_SAT_CODES", () => {
47
- it("should have all SAT codes as 8-digit numeric strings", () => {
48
- for (const [section, code] of Object.entries(global_invoice_enums_1.DEFAULT_SECTION_SAT_CODES)) {
49
- expect(code).toMatch(/^\d{8}$/);
50
- }
51
- });
52
- it("should map veterinary sections to known SAT codes", () => {
53
- expect(global_invoice_enums_1.DEFAULT_SECTION_SAT_CODES["CONSULTAS"]).toBe("85121800");
54
- expect(global_invoice_enums_1.DEFAULT_SECTION_SAT_CODES["FARMACIA"]).toBe("51101500");
55
- });
56
- it("should not be empty", () => {
57
- expect(Object.keys(global_invoice_enums_1.DEFAULT_SECTION_SAT_CODES).length).toBeGreaterThan(0);
58
- });
59
- });
60
46
  describe("DEFAULT_SAT_PRODUCT_CODE", () => {
61
47
  it("should be 01010101 (No identificado)", () => {
62
48
  expect(global_invoice_enums_1.DEFAULT_SAT_PRODUCT_CODE).toBe("01010101");
@@ -33,6 +33,8 @@ export interface GlobalInvoiceLineItemResponse {
33
33
  section: string;
34
34
  family: string;
35
35
  satProductCode: string;
36
+ satUnitCode: string;
37
+ facturamaProductId?: string;
36
38
  quantity: number;
37
39
  unitPrice: number;
38
40
  subtotal: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.89.0",
3
+ "version": "6.91.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",