import { DomainEvent } from './domain-event.base';
import { OutputFormat } from '../value-objects/output-format.enum';

export interface ReportExportedPayload {
  fileId: string;
  snapshotId: string;
  format: OutputFormat;
  fileName: string;
  fileSize: number;
  exportedAt: Date;
}

export class ReportExportedEvent extends DomainEvent {
  constructor(private readonly payload: ReportExportedPayload) {
    super();
  }

  get eventType(): string {
    return 'ReportExported';
  }

  get aggregateId(): string {
    return this.payload.fileId;
  }

  get aggregateType(): string {
    return 'ReportFile';
  }

  toPayload(): ReportExportedPayload {
    return { ...this.payload };
  }
}
