feat: show overseas funding and pallet summaries
This commit is contained in:
@@ -43,6 +43,7 @@ export interface SavePalletPayload {
|
||||
export interface UpdatePalletPayload extends SavePalletPayload {
|
||||
version: number
|
||||
}
|
||||
export interface PalletSummaryDto { totalCount: number; idleCount: number; occupiedCount: number; scrappedCount: number }
|
||||
|
||||
export async function listReceivingOverseasWarehouses() {
|
||||
const records: ReceivingOverseasWarehouseDto[] = (await listSharedReceivingOverseasWarehouseOptions()).map((warehouse) => ({
|
||||
@@ -63,6 +64,11 @@ export async function listPallets(warehouseId: string | undefined, query: { page
|
||||
)
|
||||
return normalizeOverseasPage(unwrapApiResponse(response))
|
||||
}
|
||||
export async function getPalletSummary(warehouseId: string, query: { keyword?: string; palletType?: string }) {
|
||||
const path = warehouseId ? `/platform/v1/warehouse-admin/${encodeURIComponent(warehouseId)}/pallets/summary` : '/platform/v1/warehouse-admin/pallets/summary'
|
||||
const response = await overseasHttp.get<ApiEnvelope<PalletSummaryDto>, ApiEnvelope<PalletSummaryDto>>(path, { params: { page: 1, size: 1, ...query } })
|
||||
const value = unwrapApiResponse(response); return { totalCount: Number(value.totalCount), idleCount: Number(value.idleCount), occupiedCount: Number(value.occupiedCount), scrappedCount: Number(value.scrappedCount) }
|
||||
}
|
||||
|
||||
export async function getPallet(warehouseId: string, palletId: string) {
|
||||
const response = await overseasHttp.get<ApiEnvelope<PalletDto>, ApiEnvelope<PalletDto>>(
|
||||
|
||||
Reference in New Issue
Block a user