philipgreat's picture
Deploy traceable order management playground
aa89cb5 verified
Raw History Blame Contribute Delete
454 Bytes
import { UserContext } from './context';
import { CheckResult } from './i18n';
export interface EntityChecker {
checkAndFix(context: UserContext, mutation: any, results: CheckResult[]): void;
}
export class CheckException extends Error {
constructor(public readonly violations: readonly CheckResult[]) {
super(`Check failed: ${violations.map(v => v.message ?? `${v.ruleId}:${v.location}`).join('; ')}`);
this.name = 'CheckException';
}
}