project = $project; $this->filters = $filters; $this->dataAggregator = $dataAggregator ?? new DataAggregator($project, $filters); $this->htmlExporter = $htmlExporter ?? new HtmlExporter(); $this->excelExporter = $excelExporter ?? new ExcelExporter(); } public function generate(): array { return $this->dataAggregator->aggregate(); } public function renderHtml(): View { $data = $this->generate(); return $this->htmlExporter->export($this->project, $data); } public function renderPreview(): View { $data = $this->generate(); return $this->htmlExporter->exportPreview($data); } public function exportExcel(): BinaryFileResponse { $data = $this->generate(); return $this->excelExporter->export($this->project, $this->filters, $data); } }