This commit is contained in:
2026-09-22 13:51:58 +08:00
parent aefcd2565f
commit fed257a720
8 changed files with 174 additions and 45 deletions
@@ -186,6 +186,11 @@ export interface PreloadConfirmationResponse {
readiness: PreloadReadiness
}
export interface DomesticPdaOperator {
userId: string
displayName: string
}
type RawId = string | number | null | undefined
type RawPage<T extends LoadingListSummary> = Omit<LoadingListPage<T>, 'page' | 'size' | 'total' | 'pages'> & {
page: string | number
@@ -359,10 +364,17 @@ export async function updateLoadingItemRemarks(planId: string, itemId: string, r
}
}
export async function confirmPreloadPlan(planId: string, expectedVersion: number, operationId: string) {
export async function listDomesticPdaOperators(warehouseId: string, keyword?: string): Promise<DomesticPdaOperator[]> {
const response = await http.get<ApiEnvelope<DomesticPdaOperator[]>, ApiEnvelope<DomesticPdaOperator[]>>(
'/platform/v1/iam/users/domestic-pda-operators', { params: { warehouseId, keyword } },
)
return unwrapApiResponse(response).map((operator) => ({ ...operator, userId: requiredId(operator.userId) }))
}
export async function confirmPreloadPlan(planId: string, expectedVersion: number, assigneeId: string, operationId: string) {
const response = await http.post<ApiEnvelope<PreloadConfirmationResponse>, ApiEnvelope<PreloadConfirmationResponse>>(
`${basePath}/loading-plans/${encodeURIComponent(planId)}/confirm`,
{ expectedVersion },
{ expectedVersion, assigneeId },
{ headers: { 'Idempotency-Key': operationId } },
)
const result = unwrapApiResponse(response)