import { LeagueAdminDTO } from '../dtos/LeagueAdminDTO';

export class LeagueAdminPresenter {
  private result: LeagueAdminDTO | null = null;

  reset() {
    this.result = null;
  }

  present(data: {
    joinRequests: any[];
    ownerSummary: any;
    config: any;
    protests: any;
    seasons: any[];
  }) {
    this.result = {
      joinRequests: data.joinRequests,
      ownerSummary: data.ownerSummary,
      config: { form: data.config },
      protests: data.protests,
      seasons: data.seasons,
    };
  }

  getViewModel(): LeagueAdminDTO {
    if (!this.result) throw new Error('Presenter not presented');
    return this.result;
  }
}