Merge origin/release/test and preserve procurement direction with request unlock
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { isAxiosError } from 'axios'
|
||||
import { ApiResponseError } from '@/shared/api/http'
|
||||
import type { ProcurementCommand, ProcurementCommandBody } from './api/procurementCommands'
|
||||
export interface PendingProcurement { command: ProcurementCommand; payload: ProcurementCommandBody }
|
||||
const commands = new Set(['review', 'purchase', 'purchase/confirm', 'budget-authorizations', 'planned-warehouse', 'cancel', 'overseas-receipts', 'domestic-receipts', 'overseas-receipts/complete', 'domestic-receipts/complete', 'packing', 'packing/confirm', 'packing/withdraw', 'dispositions', 'receipts/correct', 'dispositions/revoke', 'labels', 'international-estimate', 'labels/apply', 'domestic-repack', 'overseas-shipment', 'customer-shipment', 'charges/confirm', 'fees/retry', 'fees/terminate', 'fees/release-estimate', 'fees/correct-target', 'fees/refund', 'fees/replace-failed', 'fees/additional', 'control-notes', 'control-notes/resolve', 'actual-warehouse/correct', 'exception-close'])
|
||||
@@ -126,8 +124,3 @@ export function readPendingProcurement(raw: string | null): PendingProcurement |
|
||||
if (value.command === 'fees/additional' && (!nonempty('name') || !nonempty('businessDate') || !['CNY', 'USD'].includes(String(body.currency)) || !/^\d{1,16}(?:\.\d{1,2})?$/.test(String(body.amount)) || Number(body.amount) <= 0 || !positiveId('voucherFileId'))) throw new Error('invalid independent financial fee')
|
||||
return value as PendingProcurement
|
||||
}
|
||||
export function definitelyRejected(error: unknown) {
|
||||
const status = error instanceof ApiResponseError ? error.status : isAxiosError(error) ? error.response?.status : undefined
|
||||
const code = error instanceof ApiResponseError ? error.code : ''
|
||||
return [400, 401, 403, 404, 409, 422].includes(status ?? 0) || ['A0400', 'A0401', 'A0403', 'A0404', 'A0409', 'A0422'].includes(code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user