hvp-shared 14.8.0 → 14.9.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.
@@ -19,7 +19,8 @@
19
19
  export declare enum PaymentType {
20
20
  qvet_credit = "qvet_credit",
21
21
  recurring = "recurring",
22
- adhoc = "adhoc"
22
+ adhoc = "adhoc",
23
+ discount = "discount"
23
24
  }
24
25
  export declare const PAYMENT_TYPE_LABELS: Record<PaymentType, string>;
25
26
  /**
@@ -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,18 @@ 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
+ /** Optional override; falls back to the supplier's active rule. */
69
+ percentage?: number;
70
+ }
59
71
  export interface CreateSupplierDiscountRuleRequest {
60
72
  supplier: string;
61
73
  type: DiscountRuleType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "14.8.0",
3
+ "version": "14.9.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",