<?php

namespace App\Http\Controllers\Owner\BriefingPassenger\Dto;

use App\Modules\DefinedService\BriefingPassenger\Domain\BriefingPassengerType;

final class BriefingPassengerUpdateDTO
{
    public static function validateData(): array
    {
        return [
            'idBriefingPassenger'   =>  'required|integer|min:1',
            'type'                  =>  'required|in:' . implode(',', BriefingPassengerType::validValues()),
            'hotel'                 =>  'nullable|string|max:150',
            'time'                  =>  'required|date_format:H:i:s',
            'phone'                 =>  'required_if:type,2|nullable|string|max:20',
            'other'                 =>  'nullable|string|max:500',
            'observations'          =>  'nullable|string',
            'idGroup'               =>  'required|integer|min:1',
            'idBooking'             =>  'required|integer|min:1',
            'idBriefingOffice'      =>  'nullable|integer',
            'idPassenger'           =>  'required|integer|min:1',
            'idAdmin'               =>  'required|integer|min:1',
        ];
    }

    public function __construct(
        public int $idBriefingPassenger,
        public int $type,
        public ?string $hotel,
        public string $time,
        public ?string $phone,
        public ?string $other,
        public ?string $observations,
        public int $idGroup,
        public int $idBooking,
        public ?int $idBriefingOffice,
        public int $idPassenger,
        public int $idAdmin
    ) {}
}

