view models
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user