refactor: organize backend by business responsibility

This commit is contained in:
2026-09-13 13:52:57 +03:00
parent 7fde3ece6e
commit 8ba005346d
145 changed files with 3027 additions and 2346 deletions
@@ -0,0 +1,74 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsDateString, IsOptional, Matches } from 'class-validator';
import { MoneyDto } from '../../../common/money.dto';
import { AccountReferenceDto } from '../account-reference.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;
@ApiProperty({ enum: ['coupon', 'dividend', 'maturity', 'offer'] })
declare type: 'coupon' | 'dividend' | 'maturity' | 'offer';
@ApiProperty({ format: 'date' })
declare date: string;
@ApiProperty({ enum: ['event', 'registry'] })
declare dateKind: 'event' | 'registry';
@ApiProperty({ type: String, nullable: true })
declare figi: string | null;
@ApiProperty({ type: String, nullable: true })
declare instrumentUid: string | null;
@ApiProperty()
declare ticker: string;
@ApiProperty()
declare displayName: string;
@ApiProperty({ type: String, nullable: true })
declare isin: string | null;
@ApiProperty({ type: String, nullable: true })
declare logoName: string | null;
@ApiProperty({ type: MoneyDto, nullable: true })
declare projectedAmount: MoneyDto | null;
}
export class UpcomingEventsDto {
@ApiProperty()
declare accountId: string;
@ApiProperty({ format: 'date-time' })
declare calculatedAt: string;
@ApiProperty({ type: UpcomingEventDto, isArray: true })
declare events: UpcomingEventDto[];
@ApiProperty({ type: MoneyDto, isArray: true })
declare incomeTotalsByCurrency: MoneyDto[];
}