This commit is contained in:
2026-10-21 16:58:38 +08:00
parent e2f99b4f4b
commit c510cc4e2e
15 changed files with 481 additions and 23 deletions
@@ -15,7 +15,7 @@ export function validateCommandResult(result: CommandResult, pending: PendingDis
|| result.action !== pending.action || result.idempotencyKey !== pending.body.idempotencyKey
|| !result.dispatchNo || !result.result) throw new Error('操作结果与原排车请求不一致,请保留原请求核对')
requireVersion(result.recordVersion)
if (pending.action === 'LOADING_COMPLETE' && result.stage !== 'DELIVERING') throw new Error('装车结果未确认派送中,请核对原请求')
if (pending.action === 'LOADING_COMPLETE' && result.stage !== 'AFTER_LOADING') throw new Error('装车结果未确认装车后,请核对原请求')
}
export function validateCurrentDispatch(value: unknown, result: CommandResult) {
const current = value as { dispatchNo?: string; recordVersion?: unknown } | null