moex-vibe/apps/backend/src/common/dto/api-response.dto.ts
Sergey Krylov 063e80c375 feat(openapi): unify frontend types with codegen, fix backend nullable DTOs
- Fix ApiResponseMeta nullable property (add type: String) to prevent Record<string, never> in codegen
- Fix broker events DTO nullable fields with proper type annotations
- Regenerate frontend types.ts from updated Swagger schema
- Replace all hand-written types in responses.ts with codegen aliases
- Remove stale BrokerPortfolioEvent/BrokerEventsSummary/BrokerEventsData interfaces
- Fix codegen output path in frontend package.json
2026-06-23 19:58:23 +03:00

25 lines
562 B
TypeScript

import { ApiProperty } from '@nestjs/swagger';
export class ApiResponseMeta {
@ApiProperty({ type: String, nullable: true })
cachedAt: string | null;
@ApiProperty()
fromCache: boolean;
constructor(fromCache: boolean, cachedAt: string | null = null) {
this.fromCache = fromCache;
this.cachedAt = cachedAt;
}
}
export class ApiResponse<T> {
data: T;
meta: ApiResponseMeta;
constructor(data: T, fromCache = false, cachedAt: string | null = null) {
this.data = data;
this.meta = new ApiResponseMeta(fromCache, cachedAt);
}
}