view models
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
import { LeagueSummaryDto } from '../dtos';
|
||||
import { LeagueSummaryDTO } from '../types/generated/LeagueSummaryDTO';
|
||||
|
||||
export class LeagueSummaryViewModel implements LeagueSummaryDto {
|
||||
export class LeagueSummaryViewModel implements LeagueSummaryDTO {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
constructor(dto: LeagueSummaryDTO) {
|
||||
this.id = dto.id;
|
||||
this.name = dto.name;
|
||||
}
|
||||
|
||||
// Note: The generated DTO only has id and name
|
||||
// These fields will need to be added when the OpenAPI spec is updated
|
||||
description?: string;
|
||||
logoUrl?: string;
|
||||
coverImage?: string;
|
||||
memberCount: number;
|
||||
maxMembers: number;
|
||||
isPublic: boolean;
|
||||
ownerId: string;
|
||||
memberCount: number = 0;
|
||||
maxMembers: number = 0;
|
||||
isPublic: boolean = false;
|
||||
ownerId: string = '';
|
||||
ownerName?: string;
|
||||
scoringType?: string;
|
||||
status?: string;
|
||||
|
||||
constructor(dto: LeagueSummaryDto) {
|
||||
Object.assign(this, dto);
|
||||
}
|
||||
|
||||
/** UI-specific: Formatted capacity display */
|
||||
get formattedCapacity(): string {
|
||||
return `${this.memberCount}/${this.maxMembers}`;
|
||||
|
||||
Reference in New Issue
Block a user