feat: Phase 6.2 - Split ReportGenerator into DataAggregator + HtmlExporter + ExcelExporter
Code Style & Quality / Laravel Pint (push) Waiting to run
Code Style & Quality / PHPStan Static Analysis (push) Waiting to run
Code Style & Quality / Test Suite (push) Waiting to run
Code Style & Quality / Browser Tests (Dusk) (push) Waiting to run

- Create DataAggregator service (data aggregation logic)
- Create HtmlExporter service (HTML/preview rendering)
- Create ExcelExporter service (Excel download)
- Refactor ReportGenerator to delegate to services

Tests: 101 passing (319 assertions)
This commit is contained in:
Javier Braña
2026-09-01 14:44:11 +02:00
parent 1d508adc8b
commit 136219f592
4 changed files with 618 additions and 521 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace App\Services\Report;
use App\Models\Project;
use App\DTO\ReportFilters;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\ProjectReportExport;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class ExcelExporter
{
public function export(Project $project, ReportFilters $filters, array $data): BinaryFileResponse
{
$export = new ProjectReportExport($project, $filters, $data);
$filename = 'informe_'.$project->name.'_'.now()->format('Ymd_His').'.xlsx';
return Excel::download($export, $filename);
}
}