hvp-shared 6.47.1 → 6.49.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/index.js
CHANGED
|
@@ -30,3 +30,4 @@ __exportStar(require("./job-category.constants"), exports);
|
|
|
30
30
|
__exportStar(require("./special-collaborators.constants"), exports);
|
|
31
31
|
__exportStar(require("./commissions.constants"), exports);
|
|
32
32
|
__exportStar(require("./hr.enums"), exports);
|
|
33
|
+
__exportStar(require("./qvet-cash-flow.enums"), exports);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QVET Cash Flow Review Enums
|
|
3
|
+
*
|
|
4
|
+
* Used in the cash flow review workflow where collaborators and admins
|
|
5
|
+
* annotate QVET cash transactions (entradas/salidas de caja) with
|
|
6
|
+
* supplier, account type, evidence, and invoice status.
|
|
7
|
+
*
|
|
8
|
+
* DB values use QVET abbreviations (CE, SE, FA, etc.) for historical
|
|
9
|
+
* compatibility. Enum keys use descriptive English names.
|
|
10
|
+
*/
|
|
11
|
+
/** Whether the transaction goes through formal or informal accounting */
|
|
12
|
+
export declare enum CashFlowAccountType {
|
|
13
|
+
FORMAL = "FORMAL",
|
|
14
|
+
INFORMAL = "INFORMAL"
|
|
15
|
+
}
|
|
16
|
+
/** Evidence status for the transaction receipt/voucher */
|
|
17
|
+
export declare enum CashFlowEvidence {
|
|
18
|
+
/** Comprobante guardado (receipt saved in Dropbox) */
|
|
19
|
+
SAVED = "CE",
|
|
20
|
+
/** Se extravió (receipt existed but was lost/not captured) */
|
|
21
|
+
MISSING = "SE",
|
|
22
|
+
/** Sin comprobantes (no receipt for this type of payment) */
|
|
23
|
+
NO_RECEIPT = "SC"
|
|
24
|
+
}
|
|
25
|
+
/** Invoice status for formal transactions */
|
|
26
|
+
export declare enum CashFlowInvoiceStatus {
|
|
27
|
+
/** Factura recibida */
|
|
28
|
+
INVOICED = "FA",
|
|
29
|
+
/** Proveedor factura automáticamente */
|
|
30
|
+
AUTO_INVOICED = "FA_AUTO",
|
|
31
|
+
/** Pendiente de factura */
|
|
32
|
+
PENDING = "PE",
|
|
33
|
+
/** No facturable (informales, etc.) */
|
|
34
|
+
NOT_APPLICABLE = "SF"
|
|
35
|
+
}
|
|
36
|
+
/** Validation result for a cash flow entry */
|
|
37
|
+
export declare enum CashFlowValidationStatus {
|
|
38
|
+
VALID = "valid",
|
|
39
|
+
INVALID = "invalid"
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Invoice statuses allowed when accountType is FORMAL.
|
|
43
|
+
* NOT_APPLICABLE is only valid for INFORMAL accounts.
|
|
44
|
+
*/
|
|
45
|
+
export declare const FORMAL_ALLOWED_INVOICE_STATUSES: readonly [CashFlowInvoiceStatus.INVOICED, CashFlowInvoiceStatus.AUTO_INVOICED, CashFlowInvoiceStatus.PENDING];
|
|
46
|
+
/**
|
|
47
|
+
* Structured reasons why a cash flow entry is invalid.
|
|
48
|
+
* Replaces free-text auto-generated observations.
|
|
49
|
+
* Only applies to SALIDA CAJA; ENTRADA CAJA is always valid.
|
|
50
|
+
*/
|
|
51
|
+
export declare enum CashFlowInvalidReason {
|
|
52
|
+
/** accountType missing (except DIFERENCIAS → always INFORMAL) */
|
|
53
|
+
MISSING_ACCOUNT_TYPE = "SIN_TIPO_CUENTA",
|
|
54
|
+
/** review.supplier missing/empty (SALIDA only) */
|
|
55
|
+
MISSING_SUPPLIER = "SIN_PROVEEDOR",
|
|
56
|
+
/** FORMAL account with invoiceStatus NOT_APPLICABLE */
|
|
57
|
+
FORMAL_WITHOUT_INVOICE = "FORMAL_SIN_FACTURA",
|
|
58
|
+
/** evidence field missing */
|
|
59
|
+
MISSING_EVIDENCE = "SIN_EVIDENCIA"
|
|
60
|
+
}
|
|
61
|
+
/** Spanish labels for displaying invalid reasons in UI */
|
|
62
|
+
export declare const INVALID_REASON_LABELS: Record<CashFlowInvalidReason, string>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QVET Cash Flow Review Enums
|
|
4
|
+
*
|
|
5
|
+
* Used in the cash flow review workflow where collaborators and admins
|
|
6
|
+
* annotate QVET cash transactions (entradas/salidas de caja) with
|
|
7
|
+
* supplier, account type, evidence, and invoice status.
|
|
8
|
+
*
|
|
9
|
+
* DB values use QVET abbreviations (CE, SE, FA, etc.) for historical
|
|
10
|
+
* compatibility. Enum keys use descriptive English names.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.INVALID_REASON_LABELS = exports.CashFlowInvalidReason = exports.FORMAL_ALLOWED_INVOICE_STATUSES = exports.CashFlowValidationStatus = exports.CashFlowInvoiceStatus = exports.CashFlowEvidence = exports.CashFlowAccountType = void 0;
|
|
14
|
+
/** Whether the transaction goes through formal or informal accounting */
|
|
15
|
+
var CashFlowAccountType;
|
|
16
|
+
(function (CashFlowAccountType) {
|
|
17
|
+
CashFlowAccountType["FORMAL"] = "FORMAL";
|
|
18
|
+
CashFlowAccountType["INFORMAL"] = "INFORMAL";
|
|
19
|
+
})(CashFlowAccountType || (exports.CashFlowAccountType = CashFlowAccountType = {}));
|
|
20
|
+
/** Evidence status for the transaction receipt/voucher */
|
|
21
|
+
var CashFlowEvidence;
|
|
22
|
+
(function (CashFlowEvidence) {
|
|
23
|
+
/** Comprobante guardado (receipt saved in Dropbox) */
|
|
24
|
+
CashFlowEvidence["SAVED"] = "CE";
|
|
25
|
+
/** Se extravió (receipt existed but was lost/not captured) */
|
|
26
|
+
CashFlowEvidence["MISSING"] = "SE";
|
|
27
|
+
/** Sin comprobantes (no receipt for this type of payment) */
|
|
28
|
+
CashFlowEvidence["NO_RECEIPT"] = "SC";
|
|
29
|
+
})(CashFlowEvidence || (exports.CashFlowEvidence = CashFlowEvidence = {}));
|
|
30
|
+
/** Invoice status for formal transactions */
|
|
31
|
+
var CashFlowInvoiceStatus;
|
|
32
|
+
(function (CashFlowInvoiceStatus) {
|
|
33
|
+
/** Factura recibida */
|
|
34
|
+
CashFlowInvoiceStatus["INVOICED"] = "FA";
|
|
35
|
+
/** Proveedor factura automáticamente */
|
|
36
|
+
CashFlowInvoiceStatus["AUTO_INVOICED"] = "FA_AUTO";
|
|
37
|
+
/** Pendiente de factura */
|
|
38
|
+
CashFlowInvoiceStatus["PENDING"] = "PE";
|
|
39
|
+
/** No facturable (informales, etc.) */
|
|
40
|
+
CashFlowInvoiceStatus["NOT_APPLICABLE"] = "SF";
|
|
41
|
+
})(CashFlowInvoiceStatus || (exports.CashFlowInvoiceStatus = CashFlowInvoiceStatus = {}));
|
|
42
|
+
/** Validation result for a cash flow entry */
|
|
43
|
+
var CashFlowValidationStatus;
|
|
44
|
+
(function (CashFlowValidationStatus) {
|
|
45
|
+
CashFlowValidationStatus["VALID"] = "valid";
|
|
46
|
+
CashFlowValidationStatus["INVALID"] = "invalid";
|
|
47
|
+
})(CashFlowValidationStatus || (exports.CashFlowValidationStatus = CashFlowValidationStatus = {}));
|
|
48
|
+
/**
|
|
49
|
+
* Invoice statuses allowed when accountType is FORMAL.
|
|
50
|
+
* NOT_APPLICABLE is only valid for INFORMAL accounts.
|
|
51
|
+
*/
|
|
52
|
+
exports.FORMAL_ALLOWED_INVOICE_STATUSES = [
|
|
53
|
+
CashFlowInvoiceStatus.INVOICED,
|
|
54
|
+
CashFlowInvoiceStatus.AUTO_INVOICED,
|
|
55
|
+
CashFlowInvoiceStatus.PENDING,
|
|
56
|
+
];
|
|
57
|
+
/**
|
|
58
|
+
* Structured reasons why a cash flow entry is invalid.
|
|
59
|
+
* Replaces free-text auto-generated observations.
|
|
60
|
+
* Only applies to SALIDA CAJA; ENTRADA CAJA is always valid.
|
|
61
|
+
*/
|
|
62
|
+
var CashFlowInvalidReason;
|
|
63
|
+
(function (CashFlowInvalidReason) {
|
|
64
|
+
/** accountType missing (except DIFERENCIAS → always INFORMAL) */
|
|
65
|
+
CashFlowInvalidReason["MISSING_ACCOUNT_TYPE"] = "SIN_TIPO_CUENTA";
|
|
66
|
+
/** review.supplier missing/empty (SALIDA only) */
|
|
67
|
+
CashFlowInvalidReason["MISSING_SUPPLIER"] = "SIN_PROVEEDOR";
|
|
68
|
+
/** FORMAL account with invoiceStatus NOT_APPLICABLE */
|
|
69
|
+
CashFlowInvalidReason["FORMAL_WITHOUT_INVOICE"] = "FORMAL_SIN_FACTURA";
|
|
70
|
+
/** evidence field missing */
|
|
71
|
+
CashFlowInvalidReason["MISSING_EVIDENCE"] = "SIN_EVIDENCIA";
|
|
72
|
+
})(CashFlowInvalidReason || (exports.CashFlowInvalidReason = CashFlowInvalidReason = {}));
|
|
73
|
+
/** Spanish labels for displaying invalid reasons in UI */
|
|
74
|
+
exports.INVALID_REASON_LABELS = {
|
|
75
|
+
[CashFlowInvalidReason.MISSING_ACCOUNT_TYPE]: "Sin tipo de cuenta",
|
|
76
|
+
[CashFlowInvalidReason.MISSING_SUPPLIER]: "Sin proveedor",
|
|
77
|
+
[CashFlowInvalidReason.FORMAL_WITHOUT_INVOICE]: "Formal sin factura",
|
|
78
|
+
[CashFlowInvalidReason.MISSING_EVIDENCE]: "Sin evidencia",
|
|
79
|
+
};
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* }
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
+
import { CashFlowAccountType, CashFlowEvidence, CashFlowInvalidReason, CashFlowInvoiceStatus, CashFlowValidationStatus } from '../../constants/qvet-cash-flow.enums';
|
|
26
27
|
/**
|
|
27
28
|
* @deprecated No longer used. Backend uses standard ApiListSuccessResponse with meta.
|
|
28
29
|
* Kept for backward compatibility during migration.
|
|
@@ -613,6 +614,54 @@ export interface QvetCashClosingsQueryParams {
|
|
|
613
614
|
skip?: number;
|
|
614
615
|
sort?: string;
|
|
615
616
|
}
|
|
617
|
+
/**
|
|
618
|
+
* Review data added by collaborators/admins to a QVET cash flow entry.
|
|
619
|
+
*
|
|
620
|
+
* QVET-sourced fields (branch, amount, etc.) remain immutable.
|
|
621
|
+
* All editable data lives in this subdocument.
|
|
622
|
+
*
|
|
623
|
+
* @example PATCH /api/qvet/cash-flows/:id/review
|
|
624
|
+
*/
|
|
625
|
+
export interface CashFlowReview {
|
|
626
|
+
/** Proveedor (may differ from QVET's supplier field) */
|
|
627
|
+
supplier?: string;
|
|
628
|
+
/** Tipo de cuenta assigned by collaborator */
|
|
629
|
+
accountType?: CashFlowAccountType;
|
|
630
|
+
/** Receipt/voucher evidence status */
|
|
631
|
+
evidence?: CashFlowEvidence;
|
|
632
|
+
/** Invoice status (FORMAL accounts cannot be NOT_APPLICABLE) */
|
|
633
|
+
invoiceStatus?: CashFlowInvoiceStatus;
|
|
634
|
+
/** Auto-calculated or admin-overridden validation result */
|
|
635
|
+
validationStatus?: CashFlowValidationStatus;
|
|
636
|
+
/** Tipo de cuenta overridden by admin (used for accounting export) */
|
|
637
|
+
adminAccountType?: CashFlowAccountType;
|
|
638
|
+
/** Structured reasons why this entry is invalid (SALIDA only) */
|
|
639
|
+
invalidReasons?: CashFlowInvalidReason[];
|
|
640
|
+
/** Free-text observations (human notes only, not auto-generated) */
|
|
641
|
+
observations?: string;
|
|
642
|
+
/** Collaborator ID who last updated */
|
|
643
|
+
lastUpdatedBy?: string;
|
|
644
|
+
/** ISO 8601 timestamp of last update */
|
|
645
|
+
lastUpdatedAt?: string;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Request body for updating a cash flow review.
|
|
649
|
+
*
|
|
650
|
+
* @example PATCH /api/qvet/cash-flows/:id/review
|
|
651
|
+
*/
|
|
652
|
+
export interface UpdateCashFlowReviewRequest {
|
|
653
|
+
supplier?: string;
|
|
654
|
+
accountType?: CashFlowAccountType;
|
|
655
|
+
evidence?: CashFlowEvidence;
|
|
656
|
+
invoiceStatus?: CashFlowInvoiceStatus;
|
|
657
|
+
/** Only admin can override */
|
|
658
|
+
validationStatus?: CashFlowValidationStatus;
|
|
659
|
+
/** Only admin can set */
|
|
660
|
+
adminAccountType?: CashFlowAccountType;
|
|
661
|
+
/** Structured reasons why this entry is invalid */
|
|
662
|
+
invalidReasons?: CashFlowInvalidReason[];
|
|
663
|
+
observations?: string;
|
|
664
|
+
}
|
|
616
665
|
/**
|
|
617
666
|
* Single cash flow record from QVET (Entradas/Salidas de Caja)
|
|
618
667
|
* Represents cash in/out transactions outside of regular sales
|
|
@@ -634,6 +683,7 @@ export interface QvetCashFlowResponse {
|
|
|
634
683
|
supplier: string;
|
|
635
684
|
staffName: string;
|
|
636
685
|
closingDate: string;
|
|
686
|
+
review?: CashFlowReview;
|
|
637
687
|
syncedAt: string;
|
|
638
688
|
}
|
|
639
689
|
/**
|