Files
admin-web/src/modules/overseas-warehouse/api/lastMileOrders.ts
T

111 lines
3.1 KiB
TypeScript
Raw Normal View History

2026-08-20 09:10:36 +08:00
import { overseasHttp } from '@/shared/api/overseasHttp'
import { unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
export interface OverseasPageResult<T> {
records: T[]
page: number
size: number
total: number
pages: number
}
export interface LastMileOrderQuery {
customerId: string
page: number
size: number
orderNo?: string
inboundCode?: string
containerNo?: string
status?: string
}
export interface LastMileOrderSummaryDto {
id: string
orderNo: string
orderType?: string | null
inboundCode?: string | null
sourceOrderNo?: string | null
customerName?: string | null
overseasWarehouseName?: string | null
transferWarehouseName?: string | null
fbaWarehouseCode?: string | null
containerNo?: string | null
containerStatus?: string | null
abnormal?: boolean | null
detained?: boolean | null
palletCount?: number | null
packageCount?: number | null
volumeCbm?: number | null
productQuantity?: number | null
volumeWeightKg?: number | null
estimatedArrivalAt?: string | null
actualArrivalAt?: string | null
estimatedWarehouseAt?: string | null
inboundOrderNo?: string | null
outboundOrderNo?: string | null
deliveryOrderNo?: string | null
relabelOrderNo?: string | null
relabelStatus?: string | null
palletMergeFlag?: string | null
currentStatus?: string | null
privateRemark?: string | null
customerRemark?: string | null
warehouseRemark?: string | null
}
export interface LastMileOrderDto extends LastMileOrderSummaryDto {
customerId: string
sourceOrderNo?: string | null
subOrderStatus?: string | null
createdAt?: string | null
updatedAt?: string | null
}
export interface LastMileCargoDto {
id: string
skuCode?: string | null
productNameZh?: string | null
productNameEn?: string | null
packageCount?: number | null
productQuantity?: number | null
palletCount?: number | null
grossWeightKg?: number | null
dimensionalWeightKg?: number | null
volumeCbm?: number | null
destinationWarehouseName?: string | null
fbaTrackingNo?: string | null
shipmentNo?: string | null
}
export interface LastMileStatusHistoryDto {
id: string
fromStatus?: string | null
toStatus?: string | null
eventId?: string | null
remark?: string | null
createdAt?: string | null
}
export interface LastMileOrderDetailDto {
order: LastMileOrderDto
cargo: LastMileCargoDto[]
statusHistory: LastMileStatusHistoryDto[]
}
export async function listLastMileOrders(query: LastMileOrderQuery) {
const { customerId, ...params } = query
const response = await overseasHttp.get<ApiEnvelope<OverseasPageResult<LastMileOrderSummaryDto>>, ApiEnvelope<OverseasPageResult<LastMileOrderSummaryDto>>>(
'/platform/v1/last-leg/orders',
{ params: { customerId, ...params } },
)
return unwrapApiResponse(response)
}
export async function getLastMileOrder(orderId: string, customerId: string) {
const response = await overseasHttp.get<ApiEnvelope<LastMileOrderDetailDto>, ApiEnvelope<LastMileOrderDetailDto>>(
`/platform/v1/last-leg/orders/${encodeURIComponent(orderId)}`,
{ params: { customerId } },
)
return unwrapApiResponse(response)
}