23 lines
795 B
TypeScript
23 lines
795 B
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { PortfolioSummaryDto } from './analytics-response.dto';
|
|
import { PositionWithPriceDto } from './position-with-price.dto';
|
|
|
|
export class PortfolioResponseDto {
|
|
@ApiProperty() id!: number;
|
|
@ApiProperty() name!: string;
|
|
@ApiPropertyOptional({ type: String, nullable: true }) description!: string | null;
|
|
@ApiProperty({ default: 'RUB' }) currency!: string;
|
|
@ApiProperty() createdAt!: string;
|
|
@ApiProperty() updatedAt!: string;
|
|
}
|
|
|
|
export class PortfolioDetailResponseDto extends PortfolioResponseDto {
|
|
@ApiProperty({ type: [PositionWithPriceDto] })
|
|
positions!: PositionWithPriceDto[];
|
|
|
|
@ApiProperty() totalValue!: number;
|
|
|
|
@ApiProperty({ type: PortfolioSummaryDto })
|
|
analytics!: PortfolioSummaryDto;
|
|
}
|