|
|
|
@@ -20,6 +20,8 @@ export interface OutboundDetail { outbound: OutboundRow; pallets?: OutboundPalle
|
|
|
|
|
export interface OutboundQuery { page: number; size: number; documentNo?: string; lxCode?: string; warehouseId?: string; status?: string; outboundType?: string }
|
|
|
|
|
export interface ReturnOutboundCandidate { returnNo?: string | null; overseasWarehouseId?: string | null; cartonMark?: string | null; fbaCartonMark?: string | null; destinationWarehouseCode?: string | null; destinationWarehouseName?: string | null; totalQuantity?: number | null; status?: string | null }
|
|
|
|
|
export interface OneClickOutboundCandidate { inventoryPositionId: string; orderNo?: string | null; customerId?: string | null; customerName?: string | null; overseasWarehouseId?: string | null; overseasWarehouseName?: string | null; palletNo?: string | null; inboundCode?: string | null; skuCode?: string | null; productName?: string | null; availablePackages: number }
|
|
|
|
|
export interface WarehouseTransferOutboundCandidate { customerId: string; customerName?: string | null; transferNo: string; overseasWarehouseId: string; transferStatus: string; needRelabel: boolean; relabelNo?: string | null; packageCount: number; grossWeightKg?: number | null; volumeCbm?: number | null }
|
|
|
|
|
export interface WarehouseTransferDestinationPayload { transfers: Array<{ customerId: string; transferNo: string }>; destinationType: 'FBA' | 'PRIVATE'; destinationWarehouseId?: string; destinationWarehouseCode?: string; destinationWarehouseName?: string; privateDestinationAddress?: string; privateDestinationPostalCode?: string; privateDestinationContactName?: string; privateDestinationContactPhone?: string; idempotencyKey: string }
|
|
|
|
|
export async function listOutbounds(query: OutboundQuery) {
|
|
|
|
|
const response = await overseasHttp.get<ApiEnvelope<OverseasPagePayload<OutboundRow>>, ApiEnvelope<OverseasPagePayload<OutboundRow>>>('/platform/v1/last-leg/outbound-orders', { params: query })
|
|
|
|
|
return normalizeOverseasPage(unwrapApiResponse(response))
|
|
|
|
@@ -44,6 +46,14 @@ export async function createReturnOutbound(customerId: string, payload: { recipi
|
|
|
|
|
const response = await overseasHttp.post<ApiEnvelope<OutboundRow>, ApiEnvelope<OutboundRow>>('/platform/v1/last-leg/outbound-orders/return', payload, { params: { customerId } })
|
|
|
|
|
return unwrapApiResponse(response)
|
|
|
|
|
}
|
|
|
|
|
export async function listWarehouseTransferOutboundCandidates(query: { customerId?: string; warehouseId?: string } = {}) {
|
|
|
|
|
const response = await overseasHttp.get<ApiEnvelope<WarehouseTransferOutboundCandidate[]>, ApiEnvelope<WarehouseTransferOutboundCandidate[]>>('/platform/v1/last-leg/outbound-orders/warehouse-transfer/candidates', { params: query })
|
|
|
|
|
return unwrapApiResponse(response).map(item => ({ ...item, packageCount: Number(item.packageCount || 0) }))
|
|
|
|
|
}
|
|
|
|
|
export async function bindWarehouseTransferDestination(payload: WarehouseTransferDestinationPayload) {
|
|
|
|
|
const response = await overseasHttp.post<ApiEnvelope<unknown[]>, ApiEnvelope<unknown[]>>('/platform/v1/last-leg/warehouse-transfers/bind-destination', payload)
|
|
|
|
|
return unwrapApiResponse(response)
|
|
|
|
|
}
|
|
|
|
|
export async function cancelOutbound(outboundNo: string, reason: string) {
|
|
|
|
|
const response = await overseasHttp.post<ApiEnvelope<null>, ApiEnvelope<null>>(`/platform/v1/last-leg/outbound-orders/${encodeURIComponent(outboundNo)}/cancel`, { reason })
|
|
|
|
|
return unwrapApiResponse(response)
|
|
|
|
|