实现示例type Exception = { id: string; scope: string; policy: string; until: number; approver: string; owner: string }
function valid(e: Exception): boolean { return !!e.id && !!e.scope && !!e.policy && !!e.approver && !!e.owner && e.until > Date.now() }
function expired(e: Exception, now: number): boolean { return now >= e.until }
function sweep(list: Exception[], now: number): { active: Exception[]; restored: Exception[] } {
const active: Exception[] = []
const restored: Exception[] = []
for (const e of list) {
if (!valid(e)) { restored.push(e); continue }
if (expired(e, now)) restored.push(e)
else active.push(e)
}
return { active, restored }
}
审计与运行治理审计例外与到期;到期自动复原并通知责任人与审批人。例外列表版本化管理,支持回溯与对比。

发表评论 取消回复