import type { AcceptSponsorshipResult } from '@core/racing/application/use-cases/AcceptSponsorshipRequestUseCase';

export interface AcceptSponsorshipRequestResultViewModel {
  requestId: string;
  sponsorshipId: string;
  status: 'accepted';
  acceptedAt: Date;
  platformFee: number;
  netAmount: number;
}

export class AcceptSponsorshipRequestPresenter {
  private result: AcceptSponsorshipRequestResultViewModel | null = null;

  reset() {
    this.result = null;
  }

  present(output: AcceptSponsorshipResult | null) {
    if (!output) {
      this.result = null;
      return;
    }

    this.result = {
      requestId: output.requestId,
      sponsorshipId: output.sponsorshipId,
      status: output.status,
      acceptedAt: output.acceptedAt,
      platformFee: output.platformFee,
      netAmount: output.netAmount,
    };
  }

  getViewModel(): AcceptSponsorshipRequestResultViewModel | null {
    return this.result;
  }

  get viewModel(): AcceptSponsorshipRequestResultViewModel | null {
    return this.result;
  }
}
