BUR-61 current.value сделан nullable в бд. Соответствующие сущности скорректированы под изменение бд

This commit is contained in:
Первов Артем
2026-07-05 22:03:47 +03:00
parent 387f6c0613
commit 22529ba0e8
8 changed files with 31 additions and 17 deletions

View File

@@ -0,0 +1,11 @@
import { applyDecorators } from '@nestjs/common';
import { Transform } from 'class-transformer';
import { IsNumber, ValidateIf, ValidationOptions } from 'class-validator';
export function IsNullableNumber(options?: ValidationOptions): PropertyDecorator {
return applyDecorators(
Transform(({ value }) => (value === null ? null : Number(value))),
ValidateIf((_, value) => value !== null),
IsNumber({}, options),
);
}