feat(12-01): add Pax8Invoice/Pax8InvoiceItem types

- Replace stale unused Pax8Order/Pax8OrderItem stubs with live-verified
  Pax8Invoice (header) and Pax8InvoiceItem (per-company line item) types
- Field shapes sourced from 12-RESEARCH.md live PAX8 API verification
This commit is contained in:
lorentz 2026-07-10 22:41:20 -04:00
parent 111ef56e45
commit 5197cbebf1

View file

@ -62,28 +62,49 @@ export interface Pax8Product {
// NOTE: the deprecated alternate-vendor-SKU field per PAX8's own schema is intentionally omitted.
}
// Modeled on PAX8's Invoice object (not the bare Order object, which lacks
// pricing/status) — see 10-RESEARCH.md Pitfall 1.
export interface Pax8Order {
// Live-verified against PAX8's real /invoices response (12-RESEARCH.md
// Pitfall 2) — the header is the partner's consolidated monthly bill.
export interface Pax8Invoice {
id: string;
companyId: string;
orderDate: string | null;
// Always null on the header for this single-tenant reseller account —
// per-company data lives on each invoice item (Pax8InvoiceItem), not here.
companyId: string | null;
invoiceDate: string | null;
total: number | null;
status: string | null;
currencyCode: string | null;
[key: string]: unknown; // escape hatch for fields not yet modeled
}
// Modeled on PAX8's Invoice Item object (not the bare LineItem object,
// which lacks pricing) — see 10-RESEARCH.md Pitfall 1.
export interface Pax8OrderItem {
// Live-verified against PAX8's real /invoices response (12-RESEARCH.md
// Pitfall 2) — the line item carries the actual per-company, per-period cost.
export interface Pax8InvoiceItem {
id: string;
orderId: string;
productId: string;
quantity: number;
type: string | null;
externalId: string | null;
companyId: string | null;
forCompanyId: string | null;
companyName: string | null;
startPeriod: string | null;
endPeriod: string | null;
quantity: number | null;
unitOfMeasure: string | null;
term: string | null;
sku: string | null;
description: string | null;
rateType: string | null;
chargeType: string | null;
price: number | null;
subTotal: number | null;
cost: number | null;
costTotal: number | null;
total: number | null;
amountDue: number | null;
productId: string | null;
productName: string | null;
vendorName: string | null;
currencyCode: string | null;
subscriptionId: string | null;
[key: string]: unknown; // escape hatch for fields not yet modeled
}