You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

64 lines
1.1 KiB

import { SEARCH_QUERY_MAXIMUM_LENGTH } from '@ghostfolio/common/config';
import { MarketDataPreset } from '@ghostfolio/common/types';
import { Prisma } from '@prisma/client';
import { Type } from 'class-transformer';
import {
IsIn,
IsInt,
IsOptional,
IsString,
MaxLength,
Min
} from 'class-validator';
export class GetAssetProfilesDto {
@IsOptional()
@IsString()
assetSubClasses?: string;
@IsOptional()
@IsString()
dataSource?: string;
@IsIn([
'BENCHMARKS',
'CURRENCIES',
'ETF_WITHOUT_COUNTRIES',
'ETF_WITHOUT_SECTORS',
'NO_ACTIVITIES'
] as MarketDataPreset[])
@IsOptional()
presetId?: MarketDataPreset;
@IsOptional()
@IsString()
@MaxLength(SEARCH_QUERY_MAXIMUM_LENGTH)
query?: string;
@IsInt()
@IsOptional()
@Min(0)
@Type(() => Number)
skip?: number;
@IsIn([
'activitiesCount',
'assetClass',
'assetSubClass',
'dataSource',
'symbol'
])
@IsOptional()
sortColumn?: string;
@IsIn(['asc', 'desc'] as Prisma.SortOrder[])
@IsOptional()
sortDirection?: Prisma.SortOrder;
@IsInt()
@IsOptional()
@Min(0)
@Type(() => Number)
take?: number;
}