view models

This commit is contained in:
2025-12-18 00:08:47 +01:00
parent f7a56a92ce
commit 7c449af311
56 changed files with 2594 additions and 206 deletions

View File

@@ -1,6 +1,13 @@
import { TeamSummaryDto } from '../dtos';
// Note: No generated DTO available for TeamSummary yet
interface TeamSummaryDTO {
id: string;
name: string;
logoUrl?: string;
memberCount: number;
rating: number;
}
export class TeamSummaryViewModel implements TeamSummaryDto {
export class TeamSummaryViewModel {
id: string;
name: string;
logoUrl?: string;
@@ -9,8 +16,12 @@ export class TeamSummaryViewModel implements TeamSummaryDto {
private maxMembers = 10; // Assuming max members
constructor(dto: TeamSummaryDto) {
Object.assign(this, dto);
constructor(dto: TeamSummaryDTO) {
this.id = dto.id;
this.name = dto.name;
if (dto.logoUrl !== undefined) this.logoUrl = dto.logoUrl;
this.memberCount = dto.memberCount;
this.rating = dto.rating;
}
/** UI-specific: Whether team is full */