- 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
25 lines
562 B
TypeScript
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);
|
|
}
|
|
}
|