<?php

namespace App\Modules\DefinedService\BriefingPassenger\Domain;

use App\Modules\Shared\Domain\Aggregate\AggregateAttribute;
use App\Modules\Shared\Domain\Aggregate\AggregateRoot;

class BriefingPassenger extends AggregateRoot
{
    public static function attributes(): array
    {
        return [
            new AggregateAttribute('id', IdBriefingPassenger::class, 'Id_BriefingPassenger', 'primary'),
            new AggregateAttribute('date', BriefingPassengerDate::class, 'BriefingPassenger_Date'),
            new AggregateAttribute('dateUpdate', BriefingPassengerDateUpdate::class, 'BriefingPassenger_DateUpdate'),
            new AggregateAttribute('type', BriefingPassengerType::class, 'BriefingPassenger_Type'),
            new AggregateAttribute('hotel', BriefingPassengerHotel::class, 'BriefingPassenger_Hotel'),
            new AggregateAttribute('time', BriefingPassengerTime::class, 'BriefingPassenger_Time'),
            new AggregateAttribute('phone', BriefingPassengerPhone::class, 'BriefingPassenger_Phone'),
            new AggregateAttribute('other', BriefingPassengerOther::class, 'BriefingPassenger_Other'),
            new AggregateAttribute('observations', BriefingPassengerObservations::class, 'BriefingPassenger_Observations'),
            new AggregateAttribute('idGroup', IdGroup::class, 'Id_Group'),
            new AggregateAttribute('idBooking', IdBooking::class, 'Id_Booking'),
            new AggregateAttribute('idBriefingOffice', IdBriefingOffice::class, 'Id_BriefingOffice'),
            new AggregateAttribute('idPassenger', IdPassenger::class, 'Id_Passenger'),
            new AggregateAttribute('idAdmin', IdAdmin::class, 'Id_Admin'),
        ];
    }
    public static function table(): string
    {
        return 't_briefing_passenger';
    }
    public function __construct(
        protected IdBriefingPassenger $id,
        protected BriefingPassengerDate $date,
        protected BriefingPassengerDateUpdate $dateUpdate,
        protected BriefingPassengerType $type,
        protected ?BriefingPassengerHotel $hotel,
        protected ?BriefingPassengerTime $time,
        protected ?BriefingPassengerPhone $phone,
        protected ?BriefingPassengerOther $other,
        protected ?BriefingPassengerObservations $observations,
        protected IdGroup $idGroup,
        protected IdBooking $idBooking,
        protected ?IdBriefingOffice $idBriefingOffice,
        protected IdPassenger $idPassenger,
        protected IdAdmin $idAdmin
    ) {}

    public static function create(
        IdBriefingPassenger $id,
        BriefingPassengerDate $date,
        BriefingPassengerDateUpdate $dateUpdate,
        BriefingPassengerType $type,
        ?BriefingPassengerHotel $hotel,
        ?BriefingPassengerTime $time,
        ?BriefingPassengerPhone $phone,
        ?BriefingPassengerOther $other,
        ?BriefingPassengerObservations $observations,
        IdGroup $idGroup,
        IdBooking $idBooking,
        ?IdBriefingOffice $idBriefingOffice,
        IdPassenger $idPassenger,
        IdAdmin $idAdmin
    ): self {
        return new self(
            $id,
            $date,
            $dateUpdate,
            $type,
            $hotel,
            $time,
            $phone,
            $other,
            $observations,
            $idGroup,
            $idBooking,
            $idBriefingOffice,
            $idPassenger,
            $idAdmin
        );
    }

    public function id(): IdBriefingPassenger
    {
        return $this->id;
    }
    public function date(): BriefingPassengerDate
    {
        return $this->date;
    }
    public function dateUpdate(): BriefingPassengerDateUpdate
    {
        return $this->dateUpdate;
    }
    public function type(): BriefingPassengerType
    {
        return $this->type;
    }
    public function hotel(): ?BriefingPassengerHotel
    {
        return $this->hotel;
    }
    public function time(): ?BriefingPassengerTime
    {
        return $this->time;
    }
    public function phone(): ?BriefingPassengerPhone
    {
        return $this->phone;
    }
    public function other(): ?BriefingPassengerOther
    {
        return $this->other;
    }
    public function observations(): ?BriefingPassengerObservations
    {
        return $this->observations;
    }
    public function idGroup(): IdGroup
    {
        return $this->idGroup;
    }
    public function idBooking(): IdBooking
    {
        return $this->idBooking;
    }
    public function idBriefingOffice(): ?IdBriefingOffice
    {
        return $this->idBriefingOffice;
    }
    public function idPassenger(): IdPassenger
    {
        return $this->idPassenger;
    }
    public function idAdmin(): IdAdmin
    {
        return $this->idAdmin;
    }
    public function setId(IdBriefingPassenger $id): void
    {
        $this->id = $id;
    }

    public function setDate(BriefingPassengerDate $date): void
    {
        $this->date = $date;
    }

    public function setDateUpdate(BriefingPassengerDateUpdate $dateUpdate): void
    {
        $this->dateUpdate = $dateUpdate;
    }

    public function setType(BriefingPassengerType $type): void
    {
        $this->type = $type;
    }

    public function setHotel(?BriefingPassengerHotel $hotel): void
    {
        $this->hotel = $hotel;
    }

    public function setTime(?BriefingPassengerTime $time): void
    {
        $this->time = $time;
    }

    public function setPhone(?BriefingPassengerPhone $phone): void
    {
        $this->phone = $phone;
    }

    public function setOther(?BriefingPassengerOther $other): void
    {
        $this->other = $other;
    }

    public function setObservations(?BriefingPassengerObservations $observations): void
    {
        $this->observations = $observations;
    }

    public function setIdGroup(IdGroup $idGroup): void
    {
        $this->idGroup = $idGroup;
    }

    public function setIdBooking(IdBooking $idBooking): void
    {
        $this->idBooking = $idBooking;
    }

    public function setIdBriefingOffice(?IdBriefingOffice $idBriefingOffice): void
    {
        $this->idBriefingOffice = $idBriefingOffice;
    }

    public function setIdPassenger(IdPassenger $idPassenger): void
    {
        $this->idPassenger = $idPassenger;
    }

    public function setIdAdmin(IdAdmin $idAdmin): void
    {
        $this->idAdmin = $idAdmin;
    }

    public function updateDateUpdate(): void
    {
        $this->dateUpdate = BriefingPassengerDateUpdate::reduceDatetimeToPeru(
            BriefingPassengerDateUpdate::now()
        );
    }
}
