feat: add src/evidence.ts
This commit is contained in:
9
src/evidence.ts
Normal file
9
src/evidence.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import type { CaseResult } from './model';
|
||||||
|
|
||||||
|
export function evidenceState(result: CaseResult, reviewDate: string): string | null {
|
||||||
|
if (result.status === 'not-run') return '未执行';
|
||||||
|
if (result.status === 'failed') return '验证失败';
|
||||||
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(result.evidenceUntil)) return '证据日期无效';
|
||||||
|
if (result.evidenceUntil < reviewDate) return '证据过期';
|
||||||
|
return null;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user