<?php
namespace Incoviba\Model\Proyecto\Broker\Contract;

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

class State extends Common\Ideal\Model
{
    public Model\Proyecto\Broker\Contract $contract;
    public DateTimeInterface $date;
    public State\Type $type;

    protected function jsonComplement(): array
    {
        return [
            'contract_id' => $this->contract->id,
            'date' => $this->date->format('Y-m-d'),
            'type' => [
                'id' => $this->type->value,
                'description' => $this->type->name
            ]
        ];
    }
}
