<?php

namespace App\Modules\TourLock\Domain;

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

class TourLock extends AggregateRoot
{

    /** @return AgregateAttribute[] */
    public static function attributes(): array
    {
        return [
            new AggregateAttribute('id', IdTourLock::class, 'Id_TourLock', 'primary'),
            new AggregateAttribute('dateStart', TourLockDateStart::class, 'TourLock_DateStart'),
            new AggregateAttribute('dateEnd', TourLockDateEnd::class, 'TourLock_DateEnd'),
            new AggregateAttribute('remark', TourLockRemark::class, 'TourLock_Remark'),
            new AggregateAttribute('idTour', IdTour::class, 'Id_Tour'),
        ];
    }

    public static function table(): string
    {
        return 't_tour_lock';
    }

    public function __construct(
        protected IdTourLock $id,
        protected TourLockDateStart $dateStart,
        protected TourLockDateEnd $dateEnd,
        protected TourLockRemark $remark,
        protected IdTour $idTour,

    ) {}

    public static function create(
        IdTourLock $id,
        TourLockDateStart $dateStart,
        TourLockDateEnd $dateEnd,
        TourLockRemark $remark,
        IdTour $idTour,

    ) {
        $model = new self($id, $dateStart, $dateEnd, $remark, $idTour);
        return $model;
    }

    public function id(): IdTourLock
    {
        return $this->id;
    }

    public function dateStart(): TourLockDateStart
    {
        return $this->dateStart;
    }

    public function dateEnd(): TourLockDateEnd
    {
        return $this->dateEnd;
    }

    public function remark(): TourLockRemark
    {
        return $this->remark;
    }
    public function idTour(): IdTour
    {
        return $this->idTour;
    }
}
