add customs clearing filter and enhance clearance documents page for non-customs contracts

This commit is contained in:
Marshal
2026-07-12 14:14:21 +00:00
parent 84ba56f7d0
commit e7e5b93ffc
10 changed files with 417 additions and 10 deletions

View File

@@ -19,6 +19,8 @@ export interface BookingListFilter {
freightType?: string;
/** ONE_TIME | GENERAL_CONTRACT — the booking-kind tab filter. */
bookingType?: string;
/** 'true' → customs bookings, 'false' → self-clearance (non-customs). */
customsClearingEnabled?: "true" | "false";
tradeDirection?: string;
paymentCurrency?: string;
paymentStatus?: string;
@@ -185,6 +187,8 @@ export const bookingsService = {
if (filter.originYardId) params.originYardId = filter.originYardId;
if (filter.destinationYardId) params.destinationYardId = filter.destinationYardId;
if (filter.isGovernment) params.isGovernment = filter.isGovernment;
if (filter.customsClearingEnabled)
params.customsClearingEnabled = filter.customsClearingEnabled;
if (filter.search) params.search = filter.search;
}
const response = await client.get<PaginatedBookings>(B.BASE, {

View File

@@ -457,9 +457,14 @@ export const contractsService = {
},
// ── Path A self-clearance (Operations review) ──
getOpsClearanceQueue: async (): Promise<PaginatedContracts> => {
getOpsClearanceQueue: async (filter?: {
page?: number;
pageSize?: number;
search?: string;
}): Promise<PaginatedContracts> => {
const response = await client.get<PaginatedContracts>(
C.OPS_CLEARANCE_QUEUE,
{ params: filter },
);
const data = unwrap(response.data);
return {
@@ -474,8 +479,15 @@ export const contractsService = {
return { items: (data.items ?? []) as Freight.IContract[], total: data.total ?? 0 };
},
getOpsClearanceHistory: async (): Promise<PaginatedContracts> => {
const response = await client.get<PaginatedContracts>(C.OPS_CLEARANCE_HISTORY);
getOpsClearanceHistory: async (filter?: {
page?: number;
pageSize?: number;
search?: string;
}): Promise<PaginatedContracts> => {
const response = await client.get<PaginatedContracts>(
C.OPS_CLEARANCE_HISTORY,
{ params: filter },
);
const data = unwrap(response.data);
return { items: (data.items ?? []) as Freight.IContract[], total: data.total ?? 0 };
},