<?php

declare(strict_types=1);

namespace App\Scolarite\Application\Query\GetStudentSchedule;

use DateTimeImmutable;
use InvalidArgumentException;

use function sprintf;

final readonly class GetStudentScheduleQuery
{
    public function __construct(
        public string $studentId,
        public string $tenantId,
        public string $date,
    ) {
        if (DateTimeImmutable::createFromFormat('Y-m-d', $date) === false) {
            throw new InvalidArgumentException(sprintf('Date invalide : "%s". Format attendu : YYYY-MM-DD.', $date));
        }
    }
}
