feat(phase4): automate admin integration acceptance

This commit is contained in:
2026-08-24 15:41:36 +08:00
parent 91db777cb8
commit 964480a617
34 changed files with 1231 additions and 202 deletions
@@ -23,6 +23,7 @@ export interface PalletDto {
unitPrice: number
status: string
remark?: string | null
version: number
createdAt?: string | null
updatedAt?: string | null
}
@@ -38,6 +39,10 @@ export interface SavePalletPayload {
remark?: string | null
}
export interface UpdatePalletPayload extends SavePalletPayload {
version: number
}
export async function listCustomerWarehouses() {
const response = await overseasHttp.get<ApiEnvelope<OverseasPageResult<CustomerWarehouseDto>>, ApiEnvelope<OverseasPageResult<CustomerWarehouseDto>>>(
'/platform/v1/warehouse-admin',
@@ -69,18 +74,10 @@ export async function createPallet(warehouseId: string, payload: SavePalletPaylo
return unwrapApiResponse(response)
}
export async function updatePallet(warehouseId: string, palletId: string, payload: SavePalletPayload) {
export async function updatePallet(warehouseId: string, palletId: string, payload: UpdatePalletPayload) {
const response = await overseasHttp.put<ApiEnvelope<null>, ApiEnvelope<null>>(
`/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets/${encodeURIComponent(palletId)}`,
payload,
)
return unwrapApiResponse(response)
}
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)}`,
{},
)
return unwrapApiResponse(response)
}