<?php

declare(strict_types=1);

namespace PHPMax\Session;

use PHPMax\Domain\SyncState;
use PHPMax\Support\Model;

class SessionInfo extends Model
{
     
    public $token;
     
    public $deviceId;
     
    public $phone;
     
    public $mtInstanceId;
     
    public $sync;

    protected static function schema(): array
    {
        return [
            'token' => ['type' => 'string', 'required' => true],
            'deviceId' => ['type' => 'string', 'required' => true],
            'phone' => ['type' => 'string', 'required' => true],
            'mtInstanceId' => ['type' => 'string', 'default' => ''],
            'sync' => ['type' => SyncState::class, 'default' => static function (): SyncState {
                return new SyncState();
            }],
        ];
    }
}

