refactor(policy): add centralized decision helpers

This commit is contained in:
zetaloop
2026-02-22 14:50:54 +08:00
parent d0d21fa935
commit 03fa447864
3 changed files with 42 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
export type ReasonCode =
| "AUTH_REQUIRED"
| "NOT_FOUND"
| "NOT_PARTICIPANT"
| "ROLE_FORBIDDEN"
| "INVALID_STATUS"
| "ALREADY_DONE"
| "DISPUTE_LOCKED"
| "PAYMENT_FAILED"
| "IDEMPOTENT_NOOP"
| "VALIDATION_FAILED"
export interface PolicyDecision {
ok: boolean
reasonCode?: ReasonCode
message?: string
}