This commit is contained in:
2026-08-21 11:20:09 +08:00
parent 595c998214
commit 6e9bb6e00c
45 changed files with 1051 additions and 329 deletions
+14 -12
View File
@@ -18,6 +18,7 @@ export interface PalletDto {
locationId?: string | null
palletCode: string
palletType: string
fbaWarehouseCode: string
capacityCbm: number
unitPrice: number
status: string
@@ -29,6 +30,7 @@ export interface PalletDto {
export interface SavePalletPayload {
palletCode: string
palletType: string
fbaWarehouseCode: string
capacityCbm: number
unitPrice: number
status: string
@@ -36,49 +38,49 @@ export interface SavePalletPayload {
remark?: string | null
}
export async function listCustomerWarehouses(customerId: string) {
export async function listCustomerWarehouses() {
const response = await overseasHttp.get<ApiEnvelope<OverseasPageResult<CustomerWarehouseDto>>, ApiEnvelope<OverseasPageResult<CustomerWarehouseDto>>>(
'/platform/v1/warehouse-admin',
{ params: { customerId, page: 1, size: 200, status: 'ACTIVE' } },
{ params: { page: 1, size: 200, status: 'ACTIVE' } },
)
return unwrapApiResponse(response)
}
export async function listPallets(customerId: string, warehouseId: string, query: { page: number; size: number; keyword?: string; palletType?: string; status?: string }) {
export async function listPallets(warehouseId: string, query: { page: number; size: number; keyword?: string; palletType?: string; status?: string }) {
const response = await overseasHttp.get<ApiEnvelope<OverseasPageResult<PalletDto>>, ApiEnvelope<OverseasPageResult<PalletDto>>>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets`,
{ params: { customerId, ...query } },
{ params: { ...query } },
)
return unwrapApiResponse(response)
}
export async function getPallet(customerId: string, warehouseId: string, palletId: string) {
export async function getPallet(warehouseId: string, palletId: string) {
const response = await overseasHttp.get<ApiEnvelope<PalletDto>, ApiEnvelope<PalletDto>>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets/${encodeURIComponent(palletId)}`,
{ params: { customerId } },
{},
)
return unwrapApiResponse(response)
}
export async function createPallet(customerId: string, warehouseId: string, payload: SavePalletPayload) {
export async function createPallet(warehouseId: string, payload: SavePalletPayload) {
const response = await overseasHttp.post<ApiEnvelope<string>, ApiEnvelope<string>>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets`, payload, { params: { customerId } },
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets`, payload,
)
return unwrapApiResponse(response)
}
export async function updatePallet(customerId: string, warehouseId: string, palletId: string, payload: SavePalletPayload) {
export async function updatePallet(warehouseId: string, palletId: string, payload: SavePalletPayload) {
const response = await overseasHttp.put<ApiEnvelope<null>, ApiEnvelope<null>>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets/${encodeURIComponent(palletId)}`,
payload, { params: { customerId } },
payload,
)
return unwrapApiResponse(response)
}
export async function deletePallet(customerId: string, warehouseId: string, palletId: string) {
export async function deletePallet(warehouseId: string, palletId: string) {
const response = await overseasHttp.delete<ApiEnvelope<null>, ApiEnvelope<null>>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets/${encodeURIComponent(palletId)}`,
{ params: { customerId } },
{},
)
return unwrapApiResponse(response)
}