<?php

declare(strict_types=1);

namespace PHPMax\Api\Telemetry;

use PHPMax\Support\Model;

class TelemetryEvent extends Model
{
     
    public $time;
     
    public $userId;
     
    public $type;
     
    public $event;
     
    public $params = [];
     
    public $sessionId;

    protected static function schema(): array
    {
        return [
            'time' => ['type' => 'int', 'required' => true],
            'userId' => ['type' => 'int', 'required' => true],
            'type' => ['type' => 'string', 'required' => true],
            'event' => ['type' => 'string', 'required' => true],
            'params' => ['type' => 'array', 'default' => static function (): array {
                return [];
            }],
            'sessionId' => ['type' => 'int', 'required' => true],
        ];
    }
}

