Files
2026-05-30 01:11:35 -04:00

13 lines
876 B
PHP

<?php declare(strict_types=1);
namespace App\Http\Requests\Reporting;
use Illuminate\Foundation\Http\FormRequest;
use App\Domain\SchoolCore\Reporting\DTO\ScheduledReportData;
final class ScheduleReportRequest extends FormRequest
{
public function authorize(): bool { return true; }
public function rules(): array { return ['report_key' => ['required','string'], 'filters' => ['sometimes','array'], 'columns' => ['sometimes','array']]; }
public function toDTO(): ScheduledReportData { return new ScheduledReportData((string) $this->input('report_key'), $this->input('filters', []), $this->input('columns'), (string) $this->input('format', 'csv'), (string) $this->input('frequency', 'weekly'), (string) $this->input('run_at'), $this->input('recipient_user_ids', []), $this->input('recipient_emails'), $this->input('expires_at'), $this->input('metadata', [])); }
}