29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import { http, unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
|
|
|
|
export interface ArrivalCalendarEntry {
|
|
containerBookingId: string
|
|
bookingNo: string
|
|
containerNo?: string | null
|
|
vesselName?: string | null
|
|
voyageNo?: string | null
|
|
destinationPortName?: string | null
|
|
destinationWarehouseCode?: string | null
|
|
arrivalAt: string
|
|
arrivalType: 'ACTUAL' | 'ESTIMATED'
|
|
}
|
|
|
|
export async function listArrivalCalendar(query: { from: string; to: string }, signal?: AbortSignal) {
|
|
const response = await http.get<ApiEnvelope<ArrivalCalendarEntry[]>, ApiEnvelope<ArrivalCalendarEntry[]>>(
|
|
'/platform/v1/port-schedules/arrival-calendar', { params: query, signal },
|
|
)
|
|
return unwrapApiResponse(response)
|
|
}
|
|
|
|
export async function deleteAppointment(appointmentNo: string, version: number) {
|
|
const response = await http.delete<ApiEnvelope<void>, ApiEnvelope<void>>(
|
|
`/platform/v1/last-leg/inbound-plans/fba-appointments/${encodeURIComponent(appointmentNo)}`,
|
|
{ params: { version } },
|
|
)
|
|
return unwrapApiResponse(response)
|
|
}
|