feat: add service type fitler

This commit is contained in:
Nathnael
2026-08-18 11:38:07 +00:00
parent 2f293e4ae4
commit 03b16b4ee8
9 changed files with 103 additions and 4 deletions

View File

@@ -2741,6 +2741,13 @@ export const api = {
({ id }) => QUERY_KEYS.BOOKINGS.byId(id),
),
referenceData: endpoint<void, Freight.BookingReferenceData>(
"bookings",
"referenceData",
() => bookingsService.getReferenceData() as Promise<Freight.BookingReferenceData>,
() => ["bookings", "reference-data"],
),
remove: endpoint<{ id: string }, void>("bookings", "remove", ({ id }) =>
bookingsService.remove(id),
),

View File

@@ -19,6 +19,8 @@ export interface BookingListFilter {
/** Bookings drawn down under this contract (contract detail's Shipments tab). */
contractId?: string;
freightType?: string;
/** Service type (rule-engine service_types.id). */
serviceTypeId?: string;
/** ONE_TIME | GENERAL_CONTRACT — the booking-kind tab filter. */
bookingType?: string;
/** 'true' → customs bookings, 'false' → self-clearance (non-customs). */
@@ -142,6 +144,7 @@ export const bookingsService = {
if (filter.pageSize != null) params.pageSize = filter.pageSize;
if (filter.companyId) params.companyId = filter.companyId;
if (filter.freightType) params.freightType = filter.freightType;
if (filter.serviceTypeId) params.serviceTypeId = filter.serviceTypeId;
if (filter.bookingType) params.bookingType = filter.bookingType;
if (filter.tradeDirection) params.tradeDirection = filter.tradeDirection;
if (filter.paymentCurrency) params.paymentCurrency = filter.paymentCurrency;
@@ -176,6 +179,7 @@ export const bookingsService = {
if (filter.companyId) params.companyId = filter.companyId;
if (filter.contractId) params.contractId = filter.contractId;
if (filter.freightType) params.freightType = filter.freightType;
if (filter.serviceTypeId) params.serviceTypeId = filter.serviceTypeId;
if (filter.bookingType) params.bookingType = filter.bookingType;
if (filter.tradeDirection) params.tradeDirection = filter.tradeDirection;
if (filter.paymentCurrency) params.paymentCurrency = filter.paymentCurrency;

View File

@@ -13,6 +13,8 @@ export interface ContractListFilter {
tab?: string;
companyId?: string;
freightType?: string;
/** Service type (rule-engine service_types.id). */
serviceTypeId?: string;
tradeDirection?: string;
contractKind?: string;
paymentCurrency?: string;
@@ -171,6 +173,7 @@ function buildListParams(filter?: ContractListFilter) {
if (filter.sortOrder) params.sortOrder = filter.sortOrder;
if (filter.companyId) params.companyId = filter.companyId;
if (filter.freightType) params.freightType = filter.freightType;
if (filter.serviceTypeId) params.serviceTypeId = filter.serviceTypeId;
if (filter.tradeDirection) params.tradeDirection = filter.tradeDirection;
if (filter.contractKind) params.contractKind = filter.contractKind;
if (filter.paymentCurrency) params.paymentCurrency = filter.paymentCurrency;