fix: types

This commit is contained in:
Nathnael
2026-06-29 14:10:10 +00:00
parent 6d40d185d6
commit e9f9450b0f
2 changed files with 54 additions and 51 deletions

View File

@@ -6,53 +6,13 @@ import type { InitiateResponse } from "./payments.service";
const B = URL_CONSTANTS.BILLING;
export interface InvoiceCompany {
id: string;
name: string;
}
/** A customer-facing invoice row, as returned by `GET /billing/my-invoices`. */
export type PortalInvoice = Freight.IInvoice;
export interface InvoiceCompanyProfile {
id: string;
type: string;
reference: string | null;
}
/**
* A customer-facing invoice row, as returned by `GET /billing/my-invoices`.
* Mirrors the freight `Invoice` entity (the shared `Freight.IInvoice` type is
* stale and intentionally not reused here).
*/
export interface PortalInvoice {
id: string;
invoiceNumber: string;
totalAmount: number;
currency: string;
status: Freight.InvoiceStatus;
/** Originating subsystem: booking / warehouse / demurrage. */
source: string;
sourceId: string;
/** What the invoice bills for (e.g. PREPAID). */
type: string;
issuedAt: string | null;
dueAt: string;
createdAt: string;
company?: InvoiceCompany;
companyProfile?: InvoiceCompanyProfile;
}
export interface InvoiceLine {
id: string;
chargeType: string;
description?: string | null;
quantity: number;
unitRate: number;
amount: number;
currency: string;
}
export interface PortalInvoiceDetail extends PortalInvoice {
lines: InvoiceLine[];
}
/** An invoice plus its line items, as returned by `GET /billing/my-invoices/:id`. */
export type PortalInvoiceDetail = Freight.IInvoice & {
lines: Freight.IInvoiceLine[];
};
export interface PayInvoicePayload {
method?: string;