{
        "type": "form",
        "dataSource": {
            "get": "/api/taxcore/configuration/{org_id}",
            "save": "/api/taxcore/configuration",
            "method": "POST"
        },
        "sections": [
            {
                "title": "API Configuration",
                "fields": [
                    {
                        "key": "api_base_url",
                        "label": "API Base URL",
                        "type": "text",
                        "placeholder": "https://sandbox.vms.frcs.org.fj:8888",
                        "required": true,
                        "help": "TaxCore API endpoint (sandbox or production)"
                    },
                    {
                        "key": "org_tin",
                        "label": "Organization TIN",
                        "type": "text",
                        "placeholder": "20f351f3-9b39-4c63-b9e0-d8a00b6e93fb",
                        "required": true,
                        "help": "Your organization Tax Identification Number in TaxCore"
                    },
                    {
                        "key": "api_version",
                        "label": "API Version",
                        "type": "select",
                        "options": [
                            {"value": "v3", "label": "Version 3 (Current)"},
                            {"value": "v2", "label": "Version 2 (Legacy)"}
                        ],
                        "default": "v3",
                        "required": true
                    }
                ]
            },
            {
                "title": "Certificate Configuration",
                "fields": [
                    {
                        "key": "certificate_file",
                        "label": "Certificate File (.pfx)",
                        "type": "file",
                        "accept": ".pfx,.p12",
                        "maxSize": "5MB",
                        "help": "Upload your P12/PFX certificate for API authentication"
                    },
                    {
                        "key": "certificate_password",
                        "label": "Certificate Password",
                        "type": "password",
                        "help": "Password to decrypt the certificate",
                        "encrypted": true
                    },
                    {
                        "key": "certificate_expiry",
                        "label": "Certificate Expiry",
                        "type": "date",
                        "readonly": true,
                        "help": "Automatically detected from certificate"
                    }
                ]
            },
            {
                "title": "Submission Settings",
                "fields": [
                    {
                        "key": "auto_submit_invoices",
                        "label": "Auto-Submit Invoices",
                        "type": "checkbox",
                        "default": true,
                        "help": "Automatically submit invoices when finalized"
                    },
                    {
                        "key": "auto_submit_receipts",
                        "label": "Auto-Submit Sales Receipts",
                        "type": "checkbox",
                        "default": true,
                        "help": "Automatically submit POS sales receipts"
                    },
                    {
                        "key": "default_submission_type",
                        "label": "Default Submission Type",
                        "type": "select",
                        "options": [
                            {"value": "Normal", "label": "Normal"},
                            {"value": "Training", "label": "Training"},
                            {"value": "Proforma", "label": "Proforma"}
                        ],
                        "default": "Normal"
                    },
                    {
                        "key": "retry_max_attempts",
                        "label": "Max Retry Attempts",
                        "type": "number",
                        "min": 1,
                        "max": 10,
                        "default": 5,
                        "help": "Maximum number of retry attempts for failed submissions"
                    },
                    {
                        "key": "retry_delay_minutes",
                        "label": "Initial Retry Delay (minutes)",
                        "type": "number",
                        "min": 1,
                        "max": 60,
                        "default": 5,
                        "help": "Base delay before first retry (exponential backoff applied)"
                    }
                ]
            },
            {
                "title": "Environment",
                "fields": [
                    {
                        "key": "is_sandbox",
                        "label": "Use Sandbox Environment",
                        "type": "checkbox",
                        "default": true,
                        "help": "Enable for testing, disable for production submissions"
                    },
                    {
                        "key": "is_active",
                        "label": "Enable TaxCore Integration",
                        "type": "checkbox",
                        "default": true,
                        "help": "Master switch to enable/disable TaxCore for this org"
                    }
                ]
            }
        ],
        "actions": [
            {
                "label": "Test Connection",
                "icon": "fa-plug",
                "action": "taxcore:test-connection",
                "color": "info",
                "confirm": "Test connection to TaxCore API?"
            },
            {
                "label": "Save Configuration",
                "icon": "fa-save",
                "action": "save",
                "color": "primary",
                "type": "submit"
            }
        ],
        "validation": {
            "api_base_url": "required|url",
            "org_tin": "required|uuid",
            "certificate_password": "required_if:certificate_file"
        }
    }