code quality

This commit is contained in:
2026-01-26 01:36:22 +01:00
parent f06a00da1b
commit 49cc91e046
23 changed files with 68 additions and 54 deletions

View File

@@ -92,16 +92,16 @@ describe('ApplicationErrorCode', () => {
// This test verifies the type compatibility
type MyErrorCodes = 'USER_NOT_FOUND' | 'VALIDATION_ERROR' | 'PERMISSION_DENIED';
const userNotFound: ApplicationErrorCode<'USER_NOT_FOUND'> = {
const userNotFound: ApplicationErrorCode<MyErrorCodes> = {
code: 'USER_NOT_FOUND'
};
const validationError: ApplicationErrorCode<'VALIDATION_ERROR', { field: string }> = {
const validationError: ApplicationErrorCode<MyErrorCodes, { field: string }> = {
code: 'VALIDATION_ERROR',
details: { field: 'email' }
};
const permissionError: ApplicationErrorCode<'PERMISSION_DENIED', { resource: string }> = {
const permissionError: ApplicationErrorCode<MyErrorCodes, { resource: string }> = {
code: 'PERMISSION_DENIED',
details: { resource: 'admin-panel' }
};