import type { RecordEngagementOutput } from '@core/analytics/application/use-cases/RecordEngagementUseCase';
import type { RecordEngagementOutputDTO } from '../dtos/RecordEngagementOutputDTO';

export class RecordEngagementPresenter {
  private model: RecordEngagementOutputDTO | null = null;

  transform(output: RecordEngagementOutput): RecordEngagementOutputDTO {
    this.model = {
      eventId: output.eventId,
      engagementWeight: output.engagementWeight,
    };
    return this.model;
  }

  get responseModel(): RecordEngagementOutputDTO {
    if (!this.model) throw new Error('Presenter not transformed');
    return this.model;
  }
}