refactor: enforce strict backend typing
Enable strict TypeScript and reject non-null and definite-assignment assertions. Declare externally populated DTO fields, preserve runtime validation, and narrow values at their owners. Verified: backend verify (257 tests), unchanged OpenAPI, and 21 SQLite/HTTP tests on retry. The initial SQLite run had two timeouts; baseline HEAD passed 21 tests as well.
This commit is contained in:
@@ -3,29 +3,29 @@ import { MoneyDto } from '../common/money.dto';
|
||||
|
||||
export class PortfolioSummaryDto {
|
||||
@ApiProperty({ type: MoneyDto, isArray: true })
|
||||
totalsByCurrency: MoneyDto[];
|
||||
declare totalsByCurrency: MoneyDto[];
|
||||
|
||||
@ApiProperty({
|
||||
type: 'integer',
|
||||
minimum: 0,
|
||||
description: 'Number of non-zero stock positions, not the number of units.',
|
||||
})
|
||||
stockPositionCount: number;
|
||||
declare stockPositionCount: number;
|
||||
|
||||
@ApiProperty({
|
||||
type: 'integer',
|
||||
minimum: 0,
|
||||
description: 'Number of non-zero bond positions, not the number of units.',
|
||||
})
|
||||
bondPositionCount: number;
|
||||
declare bondPositionCount: number;
|
||||
}
|
||||
|
||||
export class BrokerageAccountDto {
|
||||
@ApiProperty()
|
||||
id: string;
|
||||
declare id: string;
|
||||
|
||||
@ApiProperty()
|
||||
name: string;
|
||||
declare name: string;
|
||||
|
||||
@ApiProperty({
|
||||
enum: [
|
||||
@@ -35,11 +35,11 @@ export class BrokerageAccountDto {
|
||||
'MONEY_MARKET_FUND',
|
||||
],
|
||||
})
|
||||
type:
|
||||
declare type:
|
||||
'BROKERAGE' | 'INDIVIDUAL_INVESTMENT' | 'INVEST_BOX' | 'MONEY_MARKET_FUND';
|
||||
|
||||
@ApiProperty({ type: String, nullable: true, format: 'date' })
|
||||
openedOn: string | null;
|
||||
declare openedOn: string | null;
|
||||
|
||||
@ApiProperty({ type: PortfolioSummaryDto, nullable: true })
|
||||
portfolioSummary?: PortfolioSummaryDto | null;
|
||||
|
||||
Reference in New Issue
Block a user