refactor: enforce enum machine codes
Use owner enums for error and T-Bank protocol values with ESLint regression checks. Preserve open wire fallbacks and keep protocol imports independent of DI and Prisma. Verified npm ci, verify, 226 unit tests, 262 isolated e2e tests and unchanged OpenAPI.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
export enum PrismaErrorCode {
|
||||
TransactionFailure = 'P2028',
|
||||
UniqueConstraint = 'P2002',
|
||||
WriteConflict = 'P2034',
|
||||
}
|
||||
|
||||
export function isPrismaErrorCode(value: unknown, expected: PrismaErrorCode): boolean {
|
||||
return value === expected;
|
||||
}
|
||||
Reference in New Issue
Block a user