2025-10-03 14:26:55 +09:00
|
|
|
/**
|
|
|
|
|
* Billing Domain - Contract
|
2025-12-25 17:30:02 +09:00
|
|
|
*
|
2025-10-08 10:33:33 +09:00
|
|
|
* Constants and types for the billing domain.
|
|
|
|
|
* All validated types are derived from schemas (see schema.ts).
|
2025-10-03 14:26:55 +09:00
|
|
|
*/
|
|
|
|
|
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Invoice Status Constants
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
2026-02-03 11:48:49 +09:00
|
|
|
/**
|
|
|
|
|
* All possible invoice statuses in WHMCS.
|
|
|
|
|
*
|
|
|
|
|
* Note: Only a subset of these (Paid, Unpaid, Cancelled, Overdue, Collections)
|
|
|
|
|
* can be used as filters in the GetInvoices API. Draft, Pending, and Refunded
|
|
|
|
|
* exist on invoices but cannot be used as query filters.
|
|
|
|
|
*
|
|
|
|
|
* @see VALID_INVOICE_QUERY_STATUSES in constants.ts for queryable statuses
|
|
|
|
|
* @see InvoiceQueryStatus type for the query filter type
|
|
|
|
|
*/
|
2025-10-03 14:26:55 +09:00
|
|
|
export const INVOICE_STATUS = {
|
|
|
|
|
DRAFT: "Draft",
|
|
|
|
|
PENDING: "Pending",
|
|
|
|
|
PAID: "Paid",
|
|
|
|
|
UNPAID: "Unpaid",
|
|
|
|
|
OVERDUE: "Overdue",
|
|
|
|
|
CANCELLED: "Cancelled",
|
|
|
|
|
REFUNDED: "Refunded",
|
|
|
|
|
COLLECTIONS: "Collections",
|
|
|
|
|
} as const;
|
|
|
|
|
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Re-export Types from Schema (Schema-First Approach)
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
export type {
|
|
|
|
|
InvoiceStatus,
|
2026-02-03 11:48:49 +09:00
|
|
|
InvoiceQueryStatus,
|
2025-10-08 10:33:33 +09:00
|
|
|
InvoiceItem,
|
|
|
|
|
Invoice,
|
|
|
|
|
InvoicePagination,
|
|
|
|
|
InvoiceList,
|
|
|
|
|
InvoiceSsoLink,
|
|
|
|
|
PaymentInvoiceRequest,
|
|
|
|
|
BillingSummary,
|
|
|
|
|
InvoiceQueryParams,
|
|
|
|
|
InvoiceListQuery,
|
2025-12-25 17:30:02 +09:00
|
|
|
} from "./schema.js";
|