<?php

namespace Shm\ShmChat\SchemaChat;

use Shm\Collection\Collection;
use Shm\Shm;
use Shm\ShmAuth\Auth;
use Shm\ShmChat\ShmChat;
use Shm\ShmTypes\StructureType;

class ShmChannelMembers extends Collection
{



    public function schema(): ?StructureType
    {
        $schema = Shm::structure([

            "member" => Shm::ID(),
            "memberCollection" => Shm::string(),
            'avatar' => Shm::string(),
            "name" => Shm::string(),
            'channel' => ShmChannels::ID(),

            "role" => Shm::enum([
                "member" => "Участник",
                "owner" => "Владелец",
                "admin" => "Администратор",
                "support" => "Поддержка",
            ])->default("member"),

            "payload" =>  Shm::structure([
                "*" => Shm::mixed()
            ]),



        ]);


        return $schema;
    }
}