<?php
namespace Incoviba\Model;

use DateTimeInterface;
use Incoviba\Common\Ideal;

class Login extends Ideal\Model
{
    public User $user;
    public string $selector;
    public string $token;
    public DateTimeInterface $dateTime;
    public bool $status;

    public function jsonSerialize(): mixed
    {
        return array_merge(parent::jsonSerialize(), [
            'user_id' => $this->user->id,
            'selector' => $this->selector,
            'token' => $this->token,
            'date_time' => $this->dateTime->format('Y-m-d H:i:s'),
            'status' => $this->status
        ]);
    }
}
