<?php

namespace MintyPHP\Service\Access;

final class UiCapabilityMap
{
    /**
     * Core layout capabilities — admin panel visibility checks.
     *
     * Module abilities are collected from UI slot 'permission' fields and
     * merged dynamically in UiAccessService::layoutCapabilities().
     *
     * @var array<string, string>
     */
    public const LAYOUT = [
        'can_view_tenants' => TenantAuthorizationPolicy::ABILITY_ADMIN_TENANTS_VIEW,
        'can_view_departments' => DepartmentAuthorizationPolicy::ABILITY_ADMIN_DEPARTMENTS_VIEW,
        'can_view_users' => UserAuthorizationPolicy::ABILITY_ADMIN_USERS_VIEW,
        'can_view_roles' => RoleAuthorizationPolicy::ABILITY_ADMIN_ROLES_VIEW,
        'can_view_permissions' => PermissionAuthorizationPolicy::ABILITY_ADMIN_PERMISSIONS_VIEW,
        'can_view_settings' => SettingsAuthorizationPolicy::ABILITY_ADMIN_SETTINGS_VIEW,
        'can_view_imports' => OperationsAuthorizationPolicy::ABILITY_ADMIN_IMPORTS_VIEW,
        'can_view_jobs' => OperationsAuthorizationPolicy::ABILITY_ADMIN_JOBS_VIEW,
        'can_view_docs' => OperationsAuthorizationPolicy::ABILITY_ADMIN_DOCS_VIEW,
        'can_view_mail_log' => OperationsAuthorizationPolicy::ABILITY_ADMIN_MAIL_LOG_VIEW,
        'can_view_stats' => OperationsAuthorizationPolicy::ABILITY_ADMIN_STATS_VIEW,
        'can_view_system_info' => OperationsAuthorizationPolicy::ABILITY_ADMIN_SYSTEM_INFO_VIEW,
    ];

    /**
     * @var array<string, string>
     */
    public const PAGE_USERS_INDEX = [
        'can_create_user' => UserAuthorizationPolicy::ABILITY_ADMIN_USERS_CREATE,
        'can_update_users' => UserAuthorizationPolicy::ABILITY_ADMIN_USERS_ACTIVATE,
        'can_delete_users' => UserAuthorizationPolicy::ABILITY_ADMIN_USERS_DELETE,
        'can_access_pdf' => UserAuthorizationPolicy::ABILITY_ADMIN_USERS_ACCESS_PDF,
    ];

    /**
     * @var array<string, string>
     */
    public const PAGE_USERS_CREATE = [
        'can_manage_assignments' => OperationsAuthorizationPolicy::ABILITY_ADMIN_USERS_ASSIGNMENTS_MANAGE,
        'can_edit_custom_field_values' => OperationsAuthorizationPolicy::ABILITY_ADMIN_USERS_CREATE_EDIT_CUSTOM_FIELDS,
    ];

    /**
     * @var array<string, string>
     */
    public const PAGE_STATS_INDEX = [
        'can_view_mail_log' => OperationsAuthorizationPolicy::ABILITY_ADMIN_MAIL_LOG_VIEW,
        'can_view_users' => UserAuthorizationPolicy::ABILITY_ADMIN_USERS_VIEW,
        'can_view_tenants' => TenantAuthorizationPolicy::ABILITY_ADMIN_TENANTS_VIEW,
    ];

    /**
     * @var array<string, string>
     */
    public const PAGE_JOBS_PURGE = [
        'can_purge' => SettingsAuthorizationPolicy::ABILITY_ADMIN_SETTINGS_UPDATE,
    ];

}
