hvp-shared 6.15.0 → 6.17.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.
@@ -510,3 +510,187 @@ export interface QvetCollectionsQueryParams {
510
510
  page?: number;
511
511
  skip?: number;
512
512
  }
513
+ /**
514
+ * Single cash closing record from QVET
515
+ * Represents a cash register closing entry - one row per payment method per closing
516
+ *
517
+ * A single closing (closingNumber) has multiple rows, one for each payment method.
518
+ * To get the total for a closing, sum all rows with the same closingNumber.
519
+ */
520
+ export interface QvetCashClosingResponse {
521
+ id: string;
522
+ cashRegister: string;
523
+ closingNumber: number;
524
+ paymentMethod: string;
525
+ saleAmount: number;
526
+ closingTotal: number;
527
+ collectedAmount: number;
528
+ dayCollections: number;
529
+ cashOut: number;
530
+ closingDate: string;
531
+ previousClosingDate: string;
532
+ branch: string;
533
+ staffName: string;
534
+ syncedAt: string;
535
+ }
536
+ /**
537
+ * Cash closings summary statistics data.
538
+ * Backend wraps with: ApiSingleSuccessResponse<QvetCashClosingsSummaryData>
539
+ */
540
+ export interface QvetCashClosingsSummaryData {
541
+ totalRecords: number;
542
+ totalClosings: number;
543
+ totalSales: number;
544
+ totalCollected: number;
545
+ totalCashOut: number;
546
+ byPaymentMethod: {
547
+ method: string;
548
+ totalAmount: number;
549
+ count: number;
550
+ }[];
551
+ }
552
+ /**
553
+ * Cash closings grouped by cash register.
554
+ * Backend returns: ApiSingleSuccessResponse<QvetCashClosingsByCashRegisterItem[]>
555
+ */
556
+ export interface QvetCashClosingsByCashRegisterItem {
557
+ cashRegister: string;
558
+ totalSales: number;
559
+ totalClosings: number;
560
+ totalCashOut: number;
561
+ }
562
+ /**
563
+ * Cash closings grouped by staff member.
564
+ * Backend returns: ApiSingleSuccessResponse<QvetCashClosingsByStaffItem[]>
565
+ */
566
+ export interface QvetCashClosingsByStaffItem {
567
+ staffName: string;
568
+ totalClosings: number;
569
+ totalSales: number;
570
+ branches: string[];
571
+ }
572
+ /**
573
+ * Cash closing grouped response - one entry per closing with payment methods nested.
574
+ * Used for displaying closings as single cards/rows in the UI.
575
+ * Backend returns: ApiListSuccessResponse<QvetCashClosingGroupedResponse>
576
+ *
577
+ * @example GET /api/qvet/cash-closings/grouped?year=2026&month=1
578
+ */
579
+ export interface QvetCashClosingGroupedResponse {
580
+ closingNumber: number;
581
+ closingDate: string;
582
+ previousClosingDate: string;
583
+ cashRegister: string;
584
+ branch: string;
585
+ staffName: string;
586
+ closingTotal: number;
587
+ collectedAmount: number;
588
+ dayCollections: number;
589
+ cashOut: number;
590
+ syncedAt: string;
591
+ paymentMethods: {
592
+ method: string;
593
+ amount: number;
594
+ }[];
595
+ }
596
+ /**
597
+ * Query parameters for cash closings endpoint
598
+ */
599
+ export interface QvetCashClosingsQueryParams {
600
+ startDate?: string;
601
+ endDate?: string;
602
+ year?: number;
603
+ month?: number;
604
+ halfMonth?: 1 | 2;
605
+ branch?: string;
606
+ cashRegister?: string;
607
+ paymentMethod?: string;
608
+ staffName?: string;
609
+ limit?: number;
610
+ page?: number;
611
+ skip?: number;
612
+ sort?: string;
613
+ }
614
+ /**
615
+ * Single cash flow record from QVET (Entradas/Salidas de Caja)
616
+ * Represents cash in/out transactions outside of regular sales
617
+ * Examples: petty cash, reimbursements, supplier payments
618
+ *
619
+ * Transaction types:
620
+ * - ENTRADA CAJA: Cash in (positive amount)
621
+ * - SALIDA CAJA: Cash out (negative amount)
622
+ */
623
+ export interface QvetCashFlowResponse {
624
+ id: string;
625
+ branch: string;
626
+ cashRegister: string;
627
+ transactionDate: string;
628
+ transactionType: string;
629
+ paymentMethod: string;
630
+ amount: number;
631
+ comments: string;
632
+ supplier: string;
633
+ staffName: string;
634
+ closingDate: string;
635
+ syncedAt: string;
636
+ }
637
+ /**
638
+ * Cash flows summary statistics data.
639
+ * Backend wraps with: ApiSingleSuccessResponse<QvetCashFlowsSummaryData>
640
+ */
641
+ export interface QvetCashFlowsSummaryData {
642
+ totalRecords: number;
643
+ totalCashIn: number;
644
+ totalCashOut: number;
645
+ netFlow: number;
646
+ byTransactionType: {
647
+ type: string;
648
+ totalAmount: number;
649
+ count: number;
650
+ }[];
651
+ byPaymentMethod: {
652
+ method: string;
653
+ totalAmount: number;
654
+ count: number;
655
+ }[];
656
+ }
657
+ /**
658
+ * Cash flows grouped by staff member.
659
+ * Backend returns: ApiSingleSuccessResponse<QvetCashFlowsByStaffItem[]>
660
+ */
661
+ export interface QvetCashFlowsByStaffItem {
662
+ staffName: string;
663
+ totalCashIn: number;
664
+ totalCashOut: number;
665
+ netFlow: number;
666
+ recordCount: number;
667
+ }
668
+ /**
669
+ * Cash flows grouped by supplier/recipient.
670
+ * Backend returns: ApiSingleSuccessResponse<QvetCashFlowsBySupplierItem[]>
671
+ */
672
+ export interface QvetCashFlowsBySupplierItem {
673
+ supplier: string;
674
+ totalAmount: number;
675
+ recordCount: number;
676
+ }
677
+ /**
678
+ * Query parameters for cash flows endpoint
679
+ */
680
+ export interface QvetCashFlowsQueryParams {
681
+ startDate?: string;
682
+ endDate?: string;
683
+ year?: number;
684
+ month?: number;
685
+ halfMonth?: 1 | 2;
686
+ branch?: string;
687
+ cashRegister?: string;
688
+ transactionType?: string;
689
+ paymentMethod?: string;
690
+ staffName?: string;
691
+ supplier?: string;
692
+ limit?: number;
693
+ page?: number;
694
+ skip?: number;
695
+ sort?: string;
696
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "6.15.0",
3
+ "version": "6.17.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",