@acontplus/ng-common 1.0.0 → 1.0.2

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.
@@ -102,7 +102,7 @@ interface PrinterPort {
102
102
  createNotaEntregaPrint(id: number, documentoId: number): void;
103
103
  }
104
104
 
105
- interface ReportGenerationOptions<T = any> {
105
+ interface ReportOptions<T = any> {
106
106
  data: T;
107
107
  format?: 'pdf' | 'excel' | 'word';
108
108
  useV1Api?: boolean;
@@ -114,11 +114,150 @@ interface ReportGenerationOptions<T = any> {
114
114
  * Solo se encarga de generar reportes, no de impresión
115
115
  */
116
116
  interface ReportPort {
117
- generate<T>(options: ReportGenerationOptions<T>): Observable<HttpResponse<Blob>> | void;
117
+ generate<T>(options: ReportOptions<T>): Observable<HttpResponse<Blob>> | void;
118
118
  saveFile(response: any, format?: string, forceDownload?: boolean): void;
119
119
  getFileName(response: any): string;
120
120
  }
121
121
 
122
+ /**
123
+ * Códigos de reportes de ventas
124
+ */
125
+ declare const enum SALE_CODE_REPORT {
126
+ /**
127
+ * SALE REPORT RENTABILIDAD
128
+ */
129
+ SRR = "SRR",
130
+ /**
131
+ * SALE REPORT RENTABILIDAD CUSTOM
132
+ */
133
+ SRRC = "SRRC",
134
+ /**
135
+ * SALE REPORT INVOICE GENERAL
136
+ */
137
+ FG = "FG"
138
+ }
139
+ /**
140
+ * Códigos de reportes de compras
141
+ */
142
+ declare const enum PURCHASE_CODE_REPORT {
143
+ /**
144
+ * REPORTE COMPRAS NOTA HIDDEN
145
+ */
146
+ RCNH = "RCNH",
147
+ /**
148
+ * REPORTE LIQUIDACION COMPRA
149
+ */
150
+ RLC = "RLC"
151
+ }
152
+ /**
153
+ * Códigos de reportes de contabilidad
154
+ */
155
+ declare const enum ACCOUNTING_CODE_REPORT {
156
+ /**
157
+ * REPORTE CONTABLE ESTADO GENERAL RESULTADO
158
+ */
159
+ RCEGR = "RCEGR",
160
+ /**
161
+ * ASIENTO CONTABLE ESTADO DE FLUJO DE PAGO
162
+ */
163
+ ACEDFP = "ACEDFP",
164
+ /**
165
+ * ASIENTO CONTABLE ESTADO LIBRO CAJA
166
+ */
167
+ ACELC = "ACELC"
168
+ }
169
+ /**
170
+ * Códigos de reportes de clientes
171
+ */
172
+ declare const enum CUSTOMER_CODE_REPORT {
173
+ /**
174
+ * REPORTE CLIENTE LISTADO
175
+ */
176
+ RCL = "RCL"
177
+ }
178
+ /**
179
+ * Códigos de reportes de inventario
180
+ */
181
+ declare const enum INVENTORY_CODE_REPORT {
182
+ /**
183
+ * REPORTE KARDEX
184
+ */
185
+ RK = "RK",
186
+ /**
187
+ * CONSOLIDADO DE ARTICULOS AGRUPADO
188
+ */
189
+ CDAA = "CDAA",
190
+ /**
191
+ * CONSOLIDADO DE ARTICULOS
192
+ */
193
+ CDA = "CDA",
194
+ /**
195
+ * INVENTARIO REPORTE VALORACION
196
+ */
197
+ STOCK_VALORACION = "INVRV",
198
+ /**
199
+ * INVENTARIO ARTICULO TABLA
200
+ */
201
+ ARTICULO_PVP = "INVAT",
202
+ /**
203
+ * REPORTE DE ARTICULOS FRACCIONADOS
204
+ */
205
+ RAF = "RAF",
206
+ /**
207
+ * REPORTE DE CADUCIDAD DE ARTICULOS
208
+ */
209
+ RCAA = "RCAA",
210
+ /**
211
+ * REPORTE DE ARTICULO STOCK VALORACION
212
+ */
213
+ RASR = "RASR",
214
+ /**
215
+ * REPORTE CONSOLIDACION DETALLE
216
+ */
217
+ RCD = "RCD",
218
+ /**
219
+ * REPORTE TRANSFERENCIA BODEGA
220
+ */
221
+ RTB = "RTB"
222
+ }
223
+ /**
224
+ * Códigos de documentos electrónicos
225
+ */
226
+ declare const enum ELECTRONIC_DOCUMENT_CODE {
227
+ /**
228
+ * FACTURA
229
+ */
230
+ FV = "FV",
231
+ /**
232
+ * NOTA DE ENTREGA
233
+ */
234
+ NE = "NE",
235
+ /**
236
+ * NOTA DE CREDITO
237
+ */
238
+ NC = "NC",
239
+ /**
240
+ * NOTA DE DEBITO
241
+ */
242
+ ND = "ND",
243
+ /**
244
+ * GUIA DE REMISION
245
+ */
246
+ GR = "GR",
247
+ /**
248
+ * ORDEN DE PEDIDO
249
+ */
250
+ NORMAL = "NORMAL"
251
+ }
252
+ /**
253
+ * Formatos de reporte disponibles
254
+ */
255
+ declare const enum REPORT_FORMAT {
256
+ PDF = "pdf",
257
+ EXCEL = "excel",
258
+ WORD = "word"
259
+ }
260
+
122
261
  declare const API_PATHS: {
123
262
  readonly WHATSAPP: "/api/common/whatsapp-cloud";
124
263
  readonly REPORTS: "/api/reports";
@@ -138,7 +277,7 @@ declare const PRINTER_PORT: InjectionToken<PrinterPort>;
138
277
 
139
278
  declare class ReportFacade {
140
279
  private readonly reportPort;
141
- generate<T>(options: ReportGenerationOptions<T>): Observable<any> | void;
280
+ generate<T>(options: ReportOptions<T>): Observable<any> | void;
142
281
  generatePDF<T>(data: T, forceDownload?: boolean): void;
143
282
  generateExcel<T>(data: T, forceDownload?: boolean): void;
144
283
  generateWord<T>(data: T, forceDownload?: boolean): void;
@@ -149,7 +288,6 @@ declare class ReportFacade {
149
288
 
150
289
  declare class WhatsAppMessagingFacade {
151
290
  private readonly messagingPort;
152
- private readonly messageBuilder;
153
291
  sendSimpleText(to: string, message: string, previewUrl?: boolean): Observable<WhatsAppResponse>;
154
292
  sendTemplateText(to: string, templateName: string, params?: string[], languageCode?: string): Observable<WhatsAppResponse>;
155
293
  sendDocument(to: string, documentUrl: string, caption?: string, filename?: string): Observable<WhatsAppResponse>;
@@ -222,7 +360,7 @@ declare class GreenWhatsAppAdapter implements WhatsAppMessagingPort {
222
360
 
223
361
  declare class ReportAdapter implements ReportPort {
224
362
  private readonly http;
225
- generate<T>(options: ReportGenerationOptions<T>): Observable<HttpResponse<Blob>> | void;
363
+ generate<T>(options: ReportOptions<T>): Observable<HttpResponse<Blob>> | void;
226
364
  getFileName(response: any): string;
227
365
  saveFile(response: any, format?: string, forceDownload?: boolean): void;
228
366
  static ɵfac: i0.ɵɵFactoryDeclaration<ReportAdapter, never>;
@@ -248,38 +386,53 @@ interface ReportDocumentData {
248
386
  codEstab?: string;
249
387
  id?: number;
250
388
  serie?: string;
389
+ [key: string]: any;
251
390
  }
252
391
  interface ReportParams {
253
392
  hasService?: boolean;
254
393
  reportParams: string;
255
394
  dataParams: string;
256
395
  }
396
+ interface ReportConfig {
397
+ codigo: string;
398
+ hasService: boolean;
399
+ useV1Api: boolean;
400
+ idField: string;
401
+ extraDataParams?: Record<string, any>;
402
+ includeEstabInData?: boolean;
403
+ includeCodigoInData?: boolean;
404
+ hasParams?: boolean;
405
+ }
406
+ /**
407
+ * Builder para construir parámetros de reportes
408
+ * Clase utilitaria con métodos estáticos
409
+ */
257
410
  declare class ReportParamsBuilder {
258
- private readonly reportConfigs;
411
+ private static readonly reportConfigs;
259
412
  /**
260
413
  * Construye los parámetros de reporte según el tipo de documento
261
414
  */
262
- buildParams(docData: ReportDocumentData, format?: 'pdf' | 'excel' | 'word'): ReportParams;
415
+ static buildParams(docData: ReportDocumentData, format?: 'pdf' | 'excel' | 'word'): ReportParams;
263
416
  /**
264
417
  * Determina si debe usar la API v1 según el tipo de documento
265
418
  */
266
- shouldUseV1Api(codDoc: string): boolean;
419
+ static shouldUseV1Api(codDoc: string): boolean;
267
420
  /**
268
421
  * Obtiene la configuración para un tipo de documento
269
422
  */
270
- private getReportConfig;
423
+ private static getReportConfig;
271
424
  /**
272
425
  * Construye los parámetros del reporte
273
426
  */
274
- private buildReportParams;
427
+ private static buildReportParams;
275
428
  /**
276
429
  * Construye los parámetros de datos
277
430
  */
278
- private buildDataParams;
431
+ private static buildDataParams;
279
432
  /**
280
- * Método de conveniencia para generar reporte directamente
433
+ * Construye las opciones completas para generar un reporte
281
434
  */
282
- generateReportFor(docData: ReportDocumentData, format?: 'pdf' | 'excel' | 'word', returnBlob?: boolean): {
435
+ static build(docData: ReportDocumentData, format?: 'pdf' | 'excel' | 'word', returnBlob?: boolean): {
283
436
  data: ReportParams;
284
437
  format: "pdf" | "excel" | "word";
285
438
  useV1Api: boolean;
@@ -288,13 +441,15 @@ declare class ReportParamsBuilder {
288
441
  /**
289
442
  * Obtiene la lista de tipos de documento soportados
290
443
  */
291
- getSupportedDocumentTypes(): string[];
444
+ static getSupportedDocumentTypes(): string[];
292
445
  /**
293
446
  * Verifica si un tipo de documento está soportado
294
447
  */
295
- isDocumentTypeSupported(codDoc: string): boolean;
296
- static ɵfac: i0.ɵɵFactoryDeclaration<ReportParamsBuilder, never>;
297
- static ɵprov: i0.ɵɵInjectableDeclaration<ReportParamsBuilder>;
448
+ static isDocumentTypeSupported(codDoc: string): boolean;
449
+ /**
450
+ * Registra un nuevo tipo de reporte dinámicamente
451
+ */
452
+ static registerReportType(codDoc: string, config: ReportConfig): void;
298
453
  }
299
454
 
300
455
  interface DocumentDeliveryData {
@@ -307,16 +462,18 @@ interface WhatsAppMessages {
307
462
  main: string;
308
463
  promo: string;
309
464
  }
465
+ /**
466
+ * Builder para construir mensajes de WhatsApp
467
+ * Clase utilitaria con métodos estáticos
468
+ */
310
469
  declare class WhatsAppMessageBuilder {
311
- buildDocumentDeliveryMessages(data: DocumentDeliveryData): WhatsAppMessages;
312
- buildWelcomeMessage(customerName: string, establishmentName: string): string;
313
- buildOrderConfirmationMessage(orderNumber: string, customerName: string): string;
314
- buildPaymentReminderMessage(customerName: string, amount: number, dueDate: string): string;
315
- private buildMainMessage;
316
- private buildPromoMessage;
317
- private getDocumentTypeDisplay;
318
- static ɵfac: i0.ɵɵFactoryDeclaration<WhatsAppMessageBuilder, never>;
319
- static ɵprov: i0.ɵɵInjectableDeclaration<WhatsAppMessageBuilder>;
470
+ static buildDocumentDeliveryMessages(data: DocumentDeliveryData): WhatsAppMessages;
471
+ static buildWelcomeMessage(customerName: string, establishmentName: string): string;
472
+ static buildOrderConfirmationMessage(orderNumber: string, customerName: string): string;
473
+ static buildPaymentReminderMessage(customerName: string, amount: number, dueDate: string): string;
474
+ private static buildMainMessage;
475
+ private static buildPromoMessage;
476
+ private static getDocumentTypeDisplay;
320
477
  }
321
478
 
322
479
  /**
@@ -416,7 +573,6 @@ declare class WhatsAppSender implements OnInit {
416
573
  private readonly whatsappFacade;
417
574
  private readonly reportFacade;
418
575
  private readonly snackBar;
419
- private readonly reportBuilder;
420
576
  whatsappForm: FormGroup;
421
577
  isLoading: i0.WritableSignal<boolean>;
422
578
  messageLength: number;
@@ -451,5 +607,5 @@ declare class WhatsAppSender implements OnInit {
451
607
  static ɵcmp: i0.ɵɵComponentDeclaration<WhatsAppSender, "acp-whatsapp-sender", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
452
608
  }
453
609
 
454
- export { API_PATHS, DOCUMENT_TYPES, FileMapperUtil, GreenWhatsAppAdapter, MetaWhatsAppAdapter, PRINTER_PORT, PhoneFormatterUtil, PrinterAdapter, PrinterFacade, REPORT_PORT, ReportAdapter, ReportFacade, ReportParamsBuilder, WHATSAPP_MESSAGING_PORT, WhatsAppMessageBuilder, WhatsAppMessagingFacade, WhatsAppSender };
455
- export type { ApiResponse, DocumentData, DocumentDeliveryData, DocumentDeliveryParams, PhoneValidationResult, PrintConfig, PrintParams, PrinterPort, ReportDocumentData, ReportGenerationOptions, ReportParams, ReportPort, WhatsAppDocumentMessage, WhatsAppDocumentRequest, WhatsAppDocumentTemplateMessage, WhatsAppDocumentTemplateRequest, WhatsAppMessageResponse, WhatsAppMessages, WhatsAppMessagingPort, WhatsAppProviderStatus, WhatsAppResponse, WhatsAppSendConfig, WhatsAppStatusResponse, WhatsAppTemplateMessage, WhatsAppTextMessage, WhatsAppTextRequest, WhatsAppTextTemplateRequest };
610
+ export { ACCOUNTING_CODE_REPORT, API_PATHS, CUSTOMER_CODE_REPORT, DOCUMENT_TYPES, ELECTRONIC_DOCUMENT_CODE, FileMapperUtil, GreenWhatsAppAdapter, INVENTORY_CODE_REPORT, MetaWhatsAppAdapter, PRINTER_PORT, PURCHASE_CODE_REPORT, PhoneFormatterUtil, PrinterAdapter, PrinterFacade, REPORT_FORMAT, REPORT_PORT, ReportAdapter, ReportFacade, ReportParamsBuilder, SALE_CODE_REPORT, WHATSAPP_MESSAGING_PORT, WhatsAppMessageBuilder, WhatsAppMessagingFacade, WhatsAppSender };
611
+ export type { ApiResponse, DocumentData, DocumentDeliveryData, DocumentDeliveryParams, PhoneValidationResult, PrintConfig, PrintParams, PrinterPort, ReportDocumentData, ReportOptions, ReportParams, ReportPort, WhatsAppDocumentMessage, WhatsAppDocumentRequest, WhatsAppDocumentTemplateMessage, WhatsAppDocumentTemplateRequest, WhatsAppMessageResponse, WhatsAppMessages, WhatsAppMessagingPort, WhatsAppProviderStatus, WhatsAppResponse, WhatsAppSendConfig, WhatsAppStatusResponse, WhatsAppTemplateMessage, WhatsAppTextMessage, WhatsAppTextRequest, WhatsAppTextTemplateRequest };