feat(events): support date range filtering
This commit is contained in:
@@ -1,7 +1,29 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsDateString, IsOptional, Matches } from 'class-validator';
|
||||
import { AccountReferenceDto } from './account-reference.dto';
|
||||
import { MoneyDto } from './portfolio.dto';
|
||||
|
||||
export class UpcomingEventsQueryDto {
|
||||
@ApiPropertyOptional({
|
||||
format: 'date',
|
||||
description: 'Inclusive start date (YYYY-MM-DD). Defaults to today in UTC.',
|
||||
})
|
||||
@IsOptional()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
@IsDateString({ strict: true })
|
||||
from?: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
format: 'date',
|
||||
description:
|
||||
'Inclusive end date (YYYY-MM-DD). Defaults to 30 days after from.',
|
||||
})
|
||||
@IsOptional()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
@IsDateString({ strict: true })
|
||||
to?: string;
|
||||
}
|
||||
|
||||
export class UpcomingEventDto {
|
||||
@ApiPropertyOptional({ type: AccountReferenceDto })
|
||||
account?: AccountReferenceDto;
|
||||
|
||||
Reference in New Issue
Block a user