[200~feat: add CustomsPaymentsCard and PaymentsTab components for handling customs payments and payment summaries

This commit is contained in:
Marshal
2026-08-20 15:45:42 +00:00
committed by Hagernesh
parent 2e28b10610
commit c5909b8ec7
57 changed files with 3255 additions and 787 deletions

View File

@@ -769,6 +769,7 @@ export interface IContract extends BaseEntity {
includesFirstMile?: boolean;
includesLastMile?: boolean;
includesCustoms: boolean;
includesEthiopianCustomsOnly?: boolean;
} | null;
paymentCurrency: string;
customsClearingEnabled: boolean;

View File

@@ -833,17 +833,22 @@ export type ClearanceChargeType = "PORT_CHARGES" | "MISCELLANEOUS";
/**
* DOC_UPLOADED: GL Djibouti uploaded the supporting document (port charges).
* BILLED: GL Ethiopia set amount + currency. SENT: invoice issued to the
* customer (ETB pays via gateway, other currencies via Finance's manual
* settlement). PAID: the invoice settled.
* BILLED: GL Ethiopia set amount + currency (draft, customer does not see it).
* SENT: price proposed to the customer, awaiting their decision.
* REJECTED: customer declined with a note; GL revises and re-sends.
* ACCEPTED: customer agreed — invoice issued (ETB pays via gateway, other
* currencies via Finance's manual settlement); GL can no longer edit.
* PAID: the invoice settled.
*/
export type ClearanceChargeStatus =
| "DOC_UPLOADED"
| "BILLED"
| "SENT"
| "REJECTED"
| "ACCEPTED"
| "PAID";
/** One clearance charge level on a booking — at most one per type. */
/** One clearance charge on a booking — one port charge, any number of miscellaneous. */
export interface ClearanceCharge {
id: string;
bookingId: string;
@@ -852,6 +857,11 @@ export interface ClearanceCharge {
file: { id: string; name: string; url: string } | null;
amount: number | null;
currency: string | null;
/** What the price is for, written by GL (required for miscellaneous). */
description: string | null;
/** Customer's reason when REJECTED; cleared when GL revises. */
customerNote: string | null;
customerDecidedAt: string | null;
invoiceId: string | null;
invoiceNumber: string | null;
uploadedByName: string | null;
@@ -861,6 +871,18 @@ export interface ClearanceCharge {
paidAt: string | null;
}
/**
* One booking's outstanding customer payments — invoices to pay, prices to
* accept, slips to upload — for the "Pay" badge on list/home rows.
*/
export interface BookingPayableSummary {
bookingId: string;
/** Items waiting on the customer (payable + needing review). */
count: number;
/** Amounts actually payable now, per currency (items under review excluded). */
totals: Array<{ currency: string; amount: number }>;
}
/** A GL→customer request for additional clearance document(s). */
export interface ClearanceDocRequest {
id: string;
@@ -1179,6 +1201,8 @@ export interface BookingReferenceService {
includesFirstMile: boolean;
includesLastMile: boolean;
includesCustoms: boolean;
/** Customs cleared on the Ethiopian side only (prices off the Ethiopian customs rate). */
includesEthiopianCustomsOnly?: boolean;
isActive: boolean;
displayOrder: number;
createdAt: string;