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: unknown;
  members: LeagueMemberViewModel[];
  joinRequests: LeagueJoinRequestViewModel[];

  constructor(dto: {
    config: unknown;
    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;
  }
}