hvp-shared 14.8.0 → 14.10.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,11 +25,13 @@ var PaymentType;
|
|
|
25
25
|
PaymentType["qvet_credit"] = "qvet_credit";
|
|
26
26
|
PaymentType["recurring"] = "recurring";
|
|
27
27
|
PaymentType["adhoc"] = "adhoc";
|
|
28
|
+
PaymentType["discount"] = "discount";
|
|
28
29
|
})(PaymentType || (exports.PaymentType = PaymentType = {}));
|
|
29
30
|
exports.PAYMENT_TYPE_LABELS = {
|
|
30
31
|
[PaymentType.qvet_credit]: "Crédito QVET",
|
|
31
32
|
[PaymentType.recurring]: "Recurrente",
|
|
32
33
|
[PaymentType.adhoc]: "Esporádico",
|
|
34
|
+
[PaymentType.discount]: "Descuento",
|
|
33
35
|
};
|
|
34
36
|
// --- Payment status ---
|
|
35
37
|
/**
|
|
@@ -56,6 +56,30 @@ export interface CreateAdhocPaymentRequest {
|
|
|
56
56
|
notes?: string;
|
|
57
57
|
}
|
|
58
58
|
export type UpdateAdhocPaymentRequest = Partial<CreateAdhocPaymentRequest>;
|
|
59
|
+
/**
|
|
60
|
+
* Apply a discount to a supplier for a period as an extra (negative) line.
|
|
61
|
+
* If `percentage` is omitted, the supplier's active discount rule is used.
|
|
62
|
+
* @example POST /api/supplier-payments/discount
|
|
63
|
+
*/
|
|
64
|
+
export interface ApplyDiscountRequest {
|
|
65
|
+
supplier: string;
|
|
66
|
+
year: number;
|
|
67
|
+
month: number;
|
|
68
|
+
/** Percentage over the supplier's period invoice total. */
|
|
69
|
+
percentage?: number;
|
|
70
|
+
/** Fixed discount amount (takes precedence over percentage). */
|
|
71
|
+
amount?: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Mark several payment items at once (e.g. "pagar todo TELVET").
|
|
75
|
+
* @example PATCH /api/supplier-payments/mark-bulk
|
|
76
|
+
*/
|
|
77
|
+
export interface MarkPaymentsBulkRequest {
|
|
78
|
+
ids: string[];
|
|
79
|
+
status: PaymentStatus;
|
|
80
|
+
paidAt?: string;
|
|
81
|
+
paymentMethod?: string;
|
|
82
|
+
}
|
|
59
83
|
export interface CreateSupplierDiscountRuleRequest {
|
|
60
84
|
supplier: string;
|
|
61
85
|
type: DiscountRuleType;
|