mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 03:38:17 +00:00
general contrat
This commit is contained in:
@@ -531,6 +531,24 @@ export const api = {
|
||||
contractsService.createBookingUnderContract(id, dto),
|
||||
),
|
||||
|
||||
initiateBookingUnderContract: endpoint<
|
||||
{ id: string; contractRouteId?: string },
|
||||
Freight.IBooking
|
||||
>("contracts", "initiateBookingUnderContract", ({ id, contractRouteId }) =>
|
||||
contractsService.initiateBookingUnderContract(id, contractRouteId),
|
||||
),
|
||||
|
||||
completeBookingUnderContract: endpoint<
|
||||
{
|
||||
id: string;
|
||||
bookingId: string;
|
||||
dto: Freight.CreateBookingUnderContractDto;
|
||||
},
|
||||
Freight.IBooking
|
||||
>("contracts", "completeBookingUnderContract", ({ id, bookingId, dto }) =>
|
||||
contractsService.completeBookingUnderContract(id, bookingId, dto),
|
||||
),
|
||||
|
||||
validateShipment: endpoint<
|
||||
{ id: string; dto: Freight.CreateBookingUnderContractDto },
|
||||
ShipmentValidation
|
||||
|
||||
@@ -329,6 +329,32 @@ export const contractsService = {
|
||||
return data.data.booking ?? data.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* One-click bare booking instance under a GENERAL non-customs contract — no
|
||||
* cargo, no date. The instance enters per-booking clearance; the customer
|
||||
* completes it (cargo + shipment day) once Operations finalizes.
|
||||
*/
|
||||
initiateBookingUnderContract: async (
|
||||
id: string,
|
||||
contractRouteId?: string,
|
||||
): Promise<Freight.IBooking> => {
|
||||
const { data } = await client.post(
|
||||
C.BOOKINGS_INITIATE(id),
|
||||
contractRouteId ? { contractRouteId } : {},
|
||||
);
|
||||
return data.data.booking ?? data.data;
|
||||
},
|
||||
|
||||
/** Complete an initiated booking after clearance — same DTO as create. */
|
||||
completeBookingUnderContract: async (
|
||||
id: string,
|
||||
bookingId: string,
|
||||
dto: Freight.CreateBookingUnderContractDto,
|
||||
): Promise<Freight.IBooking> => {
|
||||
const { data } = await client.post(C.BOOKINGS_COMPLETE(id, bookingId), dto);
|
||||
return data.data.booking ?? data.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Pre-submit validation of a shipment booking (same DTO as
|
||||
* `createBookingUnderContract`). Returns overweight warnings and hard-block
|
||||
|
||||
Reference in New Issue
Block a user