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
@@ -16,6 +16,10 @@ import { MoneyDto } from '../../../../common/money.dto';
import { AccountReferenceDto } from '../../account-reference.dto';
const MAX_CURSOR_LENGTH = 4096;
const MAX_OPERATIONS_PAGE_SIZE = 1000;
export const DEFAULT_OPERATIONS_PAGE_SIZE = 100;
export const operationCategories = [
'trade',
'income',
@@ -58,15 +62,19 @@ export class BrokerageOperationsQueryDto {
@ApiPropertyOptional()
@IsOptional()
@IsString()
@MaxLength(4096)
@MaxLength(MAX_CURSOR_LENGTH)
cursor?: string;
@ApiPropertyOptional({ minimum: 1, maximum: 1000, default: 100 })
@ApiPropertyOptional({
minimum: 1,
maximum: MAX_OPERATIONS_PAGE_SIZE,
default: DEFAULT_OPERATIONS_PAGE_SIZE,
})
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(1000)
@Max(MAX_OPERATIONS_PAGE_SIZE)
limit?: number;
}