82 lines
3.7 KiB
TypeScript
82 lines
3.7 KiB
TypeScript
import { overseasHttp } from '@/shared/api/overseasHttp'
|
|
import { unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
|
|
import { normalizeOverseasPage, type OverseasPagePayload } from './lastMileOrders'
|
|
|
|
export interface InboundPlanQuery {
|
|
customerId: string
|
|
page: number
|
|
size: number
|
|
planNo?: string
|
|
inboundCode?: string
|
|
status?: string
|
|
overseasWarehouseId?: string
|
|
destinationWarehouseCode?: string
|
|
fbaWarehouseCode?: string
|
|
appointmentStatus?: string
|
|
createdFrom?: string
|
|
createdTo?: string
|
|
}
|
|
|
|
export interface InboundPlanSummaryDto {
|
|
id: string
|
|
planNo: string
|
|
sourceOrderId: string
|
|
customerId: string
|
|
customerName?: string | null
|
|
orderType?: string | null
|
|
inboundCode?: string | null
|
|
containerNo?: string | null
|
|
overseasWarehouseId?: string | null
|
|
overseasWarehouseCode?: string | null
|
|
overseasWarehouseName?: string | null
|
|
destinationWarehouseId?: string | null
|
|
destinationWarehouseCode?: string | null
|
|
destinationWarehouseName?: string | null
|
|
fbaWarehouseCode?: string | null
|
|
packageCount?: number | null
|
|
grossWeightKg?: number | null
|
|
netWeightKg?: number | null
|
|
totalVolumeCbm?: number | null
|
|
palletCount?: number | null
|
|
status?: string | null
|
|
appointmentStatus?: string | null
|
|
createdAt?: string | null
|
|
updatedAt?: string | null
|
|
}
|
|
|
|
export interface InboundPlanDetailDto {
|
|
id: string
|
|
planNo: string
|
|
customerId: string
|
|
sourceOrderId: string
|
|
sourceOrderNo?: string | null
|
|
customerName?: string | null
|
|
orderType?: string | null
|
|
containerNo?: string | null
|
|
overseasWarehouseCode?: string | null
|
|
overseasWarehouseName?: string | null
|
|
status?: string | null
|
|
lineCount: number
|
|
palletCount: number
|
|
totalGrossWeightKg: number
|
|
totalNetWeightKg: number
|
|
totalVolumeCbm: number
|
|
expectedPackageCount?: number
|
|
pickedPackageCount?: number
|
|
createdAt?: string | null
|
|
updatedAt?: string | null
|
|
remark?: string | null
|
|
lines: Array<{ id: string; orderId: string; inboundCode?: string | null; fbaWarehouseCode?: string | null; destinationWarehouseId?: string | null; destinationWarehouseCode?: string | null; destinationWarehouseName?: string | null; grossWeightKg?: number | null; netWeightKg?: number | null; volumeCbm?: number | null; requiredPackageCount: number; plannedPalletCount: number }>
|
|
pallets: Array<{ id: string; palletNo?: string | null; destinationWarehouseId?: string | null; destinationWarehouseCode?: string | null; destinationWarehouseName?: string | null; capacityCbm?: number | null; allocatedVolumeCbm?: number | null; sequenceNo: number; warehousePalletId?: string | null; warehouseLocationId?: string | null; warehouseResourceLockId?: string | null; assignmentStatus?: string | null; lockedAt?: string | null; actualVolumeCbm?: number | null; actualPackageCount: number }>
|
|
allocations: Array<{ lineId: string; palletId: string; palletNo: string; palletOwnerPlanNo: string; palletOwnedByCurrentPlan: boolean; allocatedVolumeCbm?: number | null; plannedPackageCount: number; countedPackageCount: number; pickedPackageCount: number; actualVolumeCbm?: number | null; status?: string | null; version: number }>
|
|
}
|
|
|
|
export async function listInboundPlans(query: InboundPlanQuery) {
|
|
const { customerId, ...params } = query
|
|
return normalizeOverseasPage(unwrapApiResponse(await overseasHttp.get<ApiEnvelope<OverseasPagePayload<InboundPlanSummaryDto>>, ApiEnvelope<OverseasPagePayload<InboundPlanSummaryDto>>>('/platform/v1/last-leg/inbound-plans', { params: { customerId, ...params } })))
|
|
}
|
|
|
|
export async function getInboundPlan(planNo: string, customerId: string) {
|
|
return unwrapApiResponse(await overseasHttp.get<ApiEnvelope<InboundPlanDetailDto>, ApiEnvelope<InboundPlanDetailDto>>(`/platform/v1/last-leg/inbound-plans/${encodeURIComponent(planNo)}`, { params: { customerId } }))
|
|
}
|