32 lines
887 B
TypeScript
32 lines
887 B
TypeScript
import type { LeagueMemberViewModel } from './LeagueMemberViewModel';
|
|
import type { LeagueJoinRequestViewModel } from './LeagueJoinRequestViewModel';
|
|
|
|
/**
|
|
* League admin view model
|
|
* Transform from DTO to ViewModel with UI fields
|
|
*/
|
|
export class LeagueAdminViewModel {
|
|
config: any;
|
|
members: LeagueMemberViewModel[];
|
|
joinRequests: LeagueJoinRequestViewModel[];
|
|
|
|
constructor(dto: {
|
|
config: any;
|
|
members: LeagueMemberViewModel[];
|
|
joinRequests: LeagueJoinRequestViewModel[];
|
|
}) {
|
|
this.config = dto.config;
|
|
this.members = dto.members;
|
|
this.joinRequests = dto.joinRequests;
|
|
}
|
|
|
|
/** UI-specific: Total pending requests count */
|
|
get pendingRequestsCount(): number {
|
|
return this.joinRequests.length;
|
|
}
|
|
|
|
/** UI-specific: Whether there are any pending requests */
|
|
get hasPendingRequests(): boolean {
|
|
return this.joinRequests.length > 0;
|
|
}
|
|
} |