<?php

namespace MintyPHP\Repository\Access;

/** Contract for permission CRUD and lookup by key or ID. */
interface PermissionRepositoryInterface
{
    public function list(): array;

    public function listActive(): array;

    public function listPaged(array $options): array;

    public function find(int $id): ?array;

    public function findByKey(string $key): ?array;

    public function create(array $data): ?int;

    public function update(int $id, array $data): bool;

    public function delete(int $id): bool;

    /** @return list<array{id: int, key: string, description: string, active: int, is_system: int}> */
    public function listSystem(): array;
}
