<?php
namespace Incoviba\Model\Venta\Reservation;

use DateTimeInterface;
use Incoviba\Common;
use Incoviba\Model;

class State extends Common\Ideal\Model
{
    public Model\Venta\Reservation $reservation;
    public DateTimeInterface $date;
    public int $type;

    protected function jsonComplement(): array
    {
        return [
            'reservation_id' => $this->reservation->id,
            'date' => $this->date->format('Y-m-d'),
            'type' => [
                'id' => $this->type,
                'description' => State\Type::name($this->type)
            ]
        ];
    }
}