<?php

namespace App\Modules\BookingEquipment\Domain;

use App\Modules\BookingTour\Domain\IdBookingTour;
use App\Modules\Equipment\Domain\IdEquipment;
use App\Modules\Shared\Domain\Aggregate\AggregateAttribute;
use App\Modules\Shared\Domain\Aggregate\AggregateRoot;

class BookingEquipment extends AggregateRoot
{

    /** @return AgregateAttribute[] */
    public static function attributes(): array
    {
        return [
            new AggregateAttribute('id', IdBookingEquipment::class, 'Id_BookingEquipment', 'primary'),
            new AggregateAttribute('quantity', BookingEquipmentQuantity::class, 'BookingEquipment_Quantity'),
            new AggregateAttribute('price', BookingEquipmentPrice::class, 'BookingEquipment_Price'),
            new AggregateAttribute('total', BookingEquipmentTotal::class, 'BookingEquipment_Total'),
            new AggregateAttribute('show', BookingEquipmentShow::class, 'BookingEquipment_Show'),
            new AggregateAttribute('included', BookingEquipmentIncluded::class, 'BookingEquipment_Included'),
            new AggregateAttribute('mode', BookingEquipmentMode::class, 'BookingEquipment_Mode'),
            new AggregateAttribute('status', BookingEquipmentStatus::class, 'BookingEquipment_Status'),
            new AggregateAttribute('idBookingTour', IdBookingTour::class, 'Id_BookingTour'),
            new AggregateAttribute('idEquipment', IdEquipment::class, 'Id_Equipment'),
        ];
    }

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

    public function __construct(
        protected IdBookingEquipment $id,
        protected BookingEquipmentQuantity $quantity,
        protected BookingEquipmentPrice $price,
        protected BookingEquipmentTotal $total,
        protected BookingEquipmentShow $show,
        protected BookingEquipmentIncluded $included,
        protected BookingEquipmentMode $mode,
        protected BookingEquipmentStatus $status,
        protected IdBookingTour $idBookingTour,
        protected IdEquipment $idEquipment,
    ) {}

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

    public function quantity(): BookingEquipmentQuantity
    {
        return $this->quantity;
    }

    public function price(): BookingEquipmentPrice
    {
        return $this->price;
    }

    public function total(): BookingEquipmentTotal
    {
        return $this->total;
    }

    public function show(): BookingEquipmentShow
    {
        return $this->show;
    }

    public function included(): BookingEquipmentIncluded
    {
        return $this->included;
    }

    public function mode(): BookingEquipmentMode
    {
        return $this->mode;
    }

    public function status(): BookingEquipmentStatus
    {
        return $this->status;
    }

    public function idBookingTour(): IdBookingTour
    {
        return $this->idBookingTour;
    }

    public function idEquipment(): IdEquipment
    {
        return $this->idEquipment;
    }

    public function setShow(BookingEquipmentShow $show): void
    {
        $this->show = $show;
        $this->updateAttribute('show');
    }

    public function setIncluded(BookingEquipmentIncluded $included): void
    {
        $this->included = $included;
        $this->updateAttribute('included');
    }

    public function setMode(BookingEquipmentMode $mode): void
    {
        $this->mode = $mode;
        $this->updateAttribute('mode');
    }

    public function setId(IdBookingEquipment $id): void
    {
        $this->id = $id;
    }
}
