refactor: centralize domain values and enforce numeric lint

This commit is contained in:
2026-09-13 14:37:39 +03:00
parent 8ba005346d
commit 8637ad2f34
44 changed files with 543 additions and 174 deletions
@@ -1,4 +1,4 @@
import { applyDecorators } from '@nestjs/common';
import { HttpStatus, applyDecorators } from '@nestjs/common';
import {
ApiExtraModels,
ApiProperty,
@@ -35,10 +35,13 @@ function problemResponse(status: number, description: string) {
export function ApiProblemResponses(): MethodDecorator & ClassDecorator {
return applyDecorators(
ApiExtraModels(ProblemDetailsDto),
problemResponse(400, 'Invalid request'),
problemResponse(401, 'Authentication required'),
problemResponse(404, 'Resource not found'),
problemResponse(503, 'Upstream service unavailable'),
problemResponse(500, 'Internal server error'),
problemResponse(HttpStatus.BAD_REQUEST, 'Invalid request'),
problemResponse(HttpStatus.UNAUTHORIZED, 'Authentication required'),
problemResponse(HttpStatus.NOT_FOUND, 'Resource not found'),
problemResponse(
HttpStatus.SERVICE_UNAVAILABLE,
'Upstream service unavailable',
),
problemResponse(HttpStatus.INTERNAL_SERVER_ERROR, 'Internal server error'),
);
}