<?php

namespace GriffinForms\Admin\Language;

class CapabilityMatrix extends \GriffinForms\Admin\Language\Settings
{
    private static $instance;

    protected function capabilitymatrixTitle()
    {
        return __('API Access & Webhooks', 'griffinforms-form-builder');
    }

    protected function apiFeatureEnabledLabel()
    {
        return __('Enable Companion API Endpoints', 'griffinforms-form-builder');
    }

    protected function apiFeatureEnabledDescription()
    {
        return __('Master feature flag for app-facing submissions REST endpoints.', 'griffinforms-form-builder');
    }

    protected function apiKillSwitchLabel()
    {
        return __('Emergency API Kill Switch', 'griffinforms-form-builder');
    }

    protected function apiKillSwitchDescription()
    {
        return __('Immediately disables app-facing API endpoints without full rollback.', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedEnabledLabel()
    {
        return __('Enable Submission Created Webhook', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedEnabledDescription()
    {
        return __('Queues signed outbound webhook deliveries for new submissions.', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedUrlLabel()
    {
        return __('Submission Webhook URL', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedUrlDescription()
    {
        return __('HTTPS endpoint to receive submission.created events.', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedSecretLabel()
    {
        return __('Submission Webhook Secret', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedSecretDescription()
    {
        return __('Shared secret used to sign outbound webhook payloads (HMAC SHA-256).', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedTimeoutLabel()
    {
        return __('Submission Webhook Timeout (seconds)', 'griffinforms-form-builder');
    }

    protected function apiWebhookSubmissionCreatedTimeoutDescription()
    {
        return __('HTTP timeout for webhook delivery attempts (3-30 seconds).', 'griffinforms-form-builder');
    }

    protected function apiRoleCapabilityMapLabel()
    {
        return __('Role Capability Matrix', 'griffinforms-form-builder');
    }

    protected function apiRoleCapabilityMapDescription()
    {
        return __('Grant or revoke submission capabilities by WordPress role.', 'griffinforms-form-builder');
    }

    protected function apiUserCapabilityOverridesLabel()
    {
        return __('User Capability Overrides (JSON)', 'griffinforms-form-builder');
    }

    protected function apiUserCapabilityOverridesDescription()
    {
        return __('Optional per-user capability overrides as JSON: {"user_id": {"capability": true|false}}.', 'griffinforms-form-builder');
    }

    protected function apiUserCapabilityOverridesInvalidJson()
    {
        return __('Invalid JSON for user capability overrides.', 'griffinforms-form-builder');
    }

    protected function roleAssignmentSectionTitle()
    {
        return __('Role Assignment', 'griffinforms-form-builder');
    }

    protected function roleAssignmentSectionDescription()
    {
        return __('Use WordPress-native capability patterns. Save updates to apply role-level access immediately.', 'griffinforms-form-builder');
    }

    protected function roleAssignmentSavedNote()
    {
        return __('Capabilities synced to roles/users after save.', 'griffinforms-form-builder');
    }

    public static function getInstance()
    {
        if (self::$instance === null) {
            self::$instance = new CapabilityMatrix();
        }

        return self::$instance;
    }

    private function __construct()
    {
    }
}
