<?php

namespace App\Modules\Pilkades\Support;

/**
 * Fixed catalogue of API token abilities. Intentionally excludes anything
 * touching Voter/NIK data — the API layer (Phase "remote management") is
 * scoped to wilayah (Kabupaten/Kecamatan/Desa) management only, never voter
 * PII, per the explicit decision to keep that data out of API reach.
 */
class ApiAbility
{
    public const KABUPATEN_READ = 'kabupaten:read';

    public const KABUPATEN_WRITE = 'kabupaten:write';

    public const KECAMATAN_READ = 'kecamatan:read';

    public const KECAMATAN_WRITE = 'kecamatan:write';

    public const DESA_READ = 'desa:read';

    public const DESA_WRITE = 'desa:write';

    public static function all(): array
    {
        return [
            self::KABUPATEN_READ,
            self::KABUPATEN_WRITE,
            self::KECAMATAN_READ,
            self::KECAMATAN_WRITE,
            self::DESA_READ,
            self::DESA_WRITE,
        ];
    }

    public static function labels(): array
    {
        return [
            self::KABUPATEN_READ => 'Lihat Kabupaten',
            self::KABUPATEN_WRITE => 'Kelola Kabupaten',
            self::KECAMATAN_READ => 'Lihat Kecamatan',
            self::KECAMATAN_WRITE => 'Kelola Kecamatan',
            self::DESA_READ => 'Lihat Desa',
            self::DESA_WRITE => 'Kelola Desa',
        ];
    }
}
