{
    "openapi": "3.1.0",
    "info": {
        "title": "Admin UI",
        "version": "1.0.0",
        "description": "Platform & tenant administration (Admin UI) for the Retailys Business Platform. Converted from the archived old-admin app: tenant (profile / branding / instances / locales), billing (account / plans / seats / invoices / payment methods / usage), users (+ roles / invites / audit log), AI agents (catalog / activity), security (SSO group mappings / API keys), integrations (app registry / webhooks) and platform settings (general / notifications / compliance).\n\nRegistered as an RBP sub-app (App Registry). RBP reads x-rbp-app + x-rbp-app-tree + x-rbp-navigation + x-rbp-canvas and mounts the proxy at /v2/{tenantId}/admin/* -> {proxyBaseUrl}/*. Paths below are declared RELATIVE to proxyBaseUrl (no /v2/{tenantId}/admin prefix — the gateway prepends it; prependSlug=true). Agendas whose data lives in the CENTRAL API (IAM / billing / pay / catalogs modules) are referenced by app-tree resources directly against the central paths (iam/tenants, billing/{tenantId}/invoices, pay/{tenantId}/payment-methods, catalogs/{tenantId}/language-locales, …) — only the agendas without a central counterpart are proxied to this service.",
        "contact": {
            "name": "Retailys",
            "url": "https://admin.sandbox.retailys.com"
        }
    },
    "servers": [
        {
            "url": "https://adminui.inspiritenergy.cz",
            "description": "Admin service origin — matches proxyBaseUrl of the registration (RBP proxies /v2/{tenantId}/admin/* here)."
        }
    ],
    "security": [
        {
            "oauth": []
        }
    ],
    "tags": [
        {
            "name": "health",
            "description": "Liveness & readiness probes (public, no auth)."
        },
        {
            "name": "tenant",
            "description": "Tenant profile, branding, instances."
        },
        {
            "name": "billing",
            "description": "Plans, seats, usage metrics."
        },
        {
            "name": "agents",
            "description": "AI agent catalog + activity."
        },
        {
            "name": "security",
            "description": "API keys, audit trail."
        },
        {
            "name": "integrations",
            "description": "Webhooks."
        },
        {
            "name": "platform",
            "description": "Platform settings, notification channels, compliance."
        }
    ],
    "paths": {
        "/live": {
            "get": {
                "tags": [
                    "health"
                ],
                "operationId": "admin_live",
                "summary": "Liveness probe",
                "security": [],
                "responses": {
                    "200": {
                        "description": "alive",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiveResponse"
                                },
                                "example": {
                                    "status": "alive"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ready": {
            "get": {
                "tags": [
                    "health"
                ],
                "operationId": "admin_ready",
                "summary": "Readiness probe",
                "security": [],
                "responses": {
                    "200": {
                        "description": "ready",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ReadyResponse"
                                },
                                "example": {
                                    "status": "ok"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "degraded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ReadyResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tenant/profile": {
            "get": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_profile_get",
                "responses": {
                    "200": {
                        "description": "Tenant profile",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TenantProfile"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_profile_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TenantProfile"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TenantProfile"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tenant/branding": {
            "get": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_branding_get",
                "responses": {
                    "200": {
                        "description": "Tenant branding",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TenantBranding"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_branding_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TenantBranding"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TenantBranding"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tenant/instances": {
            "get": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_instances_list",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Managed instances",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ManagedInstance"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_instances_create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ManagedInstance"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ManagedInstance"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tenant/instances/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/id"
                }
            ],
            "get": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_instance_get",
                "responses": {
                    "200": {
                        "description": "Instance",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ManagedInstance"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_instance_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/merge-patch+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ManagedInstance"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ManagedInstance"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "tenant"
                ],
                "operationId": "admin_tenant_instance_delete",
                "responses": {
                    "204": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/billing/plans": {
            "get": {
                "tags": [
                    "billing"
                ],
                "operationId": "admin_billing_plans_list",
                "responses": {
                    "200": {
                        "description": "Subscription plans",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/PlanDefinition"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/seats": {
            "get": {
                "tags": [
                    "billing"
                ],
                "operationId": "admin_billing_seats_list",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Unified seats (humans + agents)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Seat"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/usage": {
            "get": {
                "tags": [
                    "billing"
                ],
                "operationId": "admin_billing_usage_list",
                "responses": {
                    "200": {
                        "description": "Usage metrics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/UsageMetric"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/agents": {
            "get": {
                "tags": [
                    "agents"
                ],
                "operationId": "admin_agents_list",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI agent catalog",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/AiAgent"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "agents"
                ],
                "operationId": "admin_agents_create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AiAgent"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiAgent"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/agents/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/id"
                }
            ],
            "get": {
                "tags": [
                    "agents"
                ],
                "operationId": "admin_agent_get",
                "responses": {
                    "200": {
                        "description": "Agent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiAgent"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "agents"
                ],
                "operationId": "admin_agent_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/merge-patch+json": {
                            "schema": {
                                "$ref": "#/components/schemas/AiAgent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiAgent"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "agents"
                ],
                "operationId": "admin_agent_delete",
                "responses": {
                    "204": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/agent-runs": {
            "get": {
                "tags": [
                    "agents"
                ],
                "operationId": "admin_agent_runs_list",
                "summary": "Agent activity (recent runs)",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Agent runs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/AgentRun"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api-keys": {
            "get": {
                "tags": [
                    "security"
                ],
                "operationId": "admin_api_keys_list",
                "responses": {
                    "200": {
                        "description": "API keys",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ApiKey"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "security"
                ],
                "operationId": "admin_api_keys_create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiKey"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiKey"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api-keys/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/id"
                }
            ],
            "get": {
                "tags": [
                    "security"
                ],
                "operationId": "admin_api_key_get",
                "responses": {
                    "200": {
                        "description": "API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiKey"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "security"
                ],
                "operationId": "admin_api_key_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/merge-patch+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiKey"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiKey"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "security"
                ],
                "operationId": "admin_api_key_delete",
                "responses": {
                    "204": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/audit-log": {
            "get": {
                "tags": [
                    "security"
                ],
                "operationId": "admin_audit_log_list",
                "summary": "Tenant activity audit (read-only)",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "name": "action",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "create",
                                "update",
                                "delete",
                                "login",
                                "export"
                            ]
                        }
                    },
                    {
                        "name": "severity",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "info",
                                "warning",
                                "error",
                                "critical"
                            ]
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Audit events",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/AdminAuditEvent"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks": {
            "get": {
                "tags": [
                    "integrations"
                ],
                "operationId": "admin_webhooks_list",
                "responses": {
                    "200": {
                        "description": "Webhooks",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Webhook"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "integrations"
                ],
                "operationId": "admin_webhooks_create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Webhook"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Webhook"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/id"
                }
            ],
            "get": {
                "tags": [
                    "integrations"
                ],
                "operationId": "admin_webhook_get",
                "responses": {
                    "200": {
                        "description": "Webhook",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Webhook"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "integrations"
                ],
                "operationId": "admin_webhook_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/merge-patch+json": {
                            "schema": {
                                "$ref": "#/components/schemas/Webhook"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Webhook"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "integrations"
                ],
                "operationId": "admin_webhook_delete",
                "responses": {
                    "204": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/settings": {
            "get": {
                "tags": [
                    "platform"
                ],
                "operationId": "admin_settings_get",
                "responses": {
                    "200": {
                        "description": "Platform settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PlatformSettings"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "platform"
                ],
                "operationId": "admin_settings_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PlatformSettings"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PlatformSettings"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/compliance": {
            "get": {
                "tags": [
                    "platform"
                ],
                "operationId": "admin_compliance_get",
                "responses": {
                    "200": {
                        "description": "Compliance settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ComplianceSettings"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "platform"
                ],
                "operationId": "admin_compliance_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ComplianceSettings"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ComplianceSettings"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/notification-channels": {
            "get": {
                "tags": [
                    "platform"
                ],
                "operationId": "admin_notification_channels_list",
                "responses": {
                    "200": {
                        "description": "Notification channels",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/NotificationChannel"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/notification-channels/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/id"
                }
            ],
            "patch": {
                "tags": [
                    "platform"
                ],
                "operationId": "admin_notification_channel_update",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/merge-patch+json": {
                            "schema": {
                                "$ref": "#/components/schemas/NotificationChannel"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotificationChannel"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "parameters": {
            "id": {
                "name": "id",
                "in": "path",
                "required": true,
                "schema": {
                    "type": "string"
                }
            },
            "page": {
                "name": "page",
                "in": "query",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                }
            }
        },
        "securitySchemes": {
            "oauth": {
                "type": "oauth2",
                "flows": {
                    "authorizationCode": {
                        "authorizationUrl": "https://api.sandbox.retailys.com/v2/iam/connect/authorize/",
                        "tokenUrl": "https://api.sandbox.retailys.com/v2/iam/connect/token/",
                        "scopes": {
                            "admin:tenant:read": "Read tenant configuration",
                            "admin:tenant:write": "Manage tenant configuration",
                            "admin:billing:read": "Read billing (plans, seats, usage)",
                            "admin:billing:write": "Manage billing",
                            "admin:agents:read": "Read AI agents",
                            "admin:agents:write": "Manage AI agents",
                            "admin:security:read": "Read security (API keys, audit)",
                            "admin:security:write": "Manage API keys",
                            "admin:integrations:read": "Read integrations (webhooks)",
                            "admin:integrations:write": "Manage webhooks",
                            "admin:platform:read": "Read platform settings",
                            "admin:platform:write": "Manage platform settings"
                        }
                    }
                }
            }
        },
        "schemas": {
            "LiveResponse": {
                "type": "object",
                "required": [
                    "status"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "alive"
                        ]
                    }
                }
            },
            "ReadyResponse": {
                "type": "object",
                "required": [
                    "status"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "ok",
                            "degraded"
                        ]
                    },
                    "checks": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "boolean"
                        }
                    }
                }
            },
            "TenantProfile": {
                "type": "object",
                "x-rbp": {
                    "label": "Profil tenantu",
                    "displayField": "companyName",
                    "icon": "building",
                    "description": "Firemní profil tenantu.",
                    "policies": {
                        "read": "admin:tenant:read",
                        "write": "admin:tenant:write"
                    }
                },
                "x-rbp-form": {
                    "layout": "single",
                    "groups": [
                        {
                            "name": "company",
                            "label": "Společnost",
                            "fields": [
                                "companyName",
                                "legalName",
                                "taxId",
                                "vatId"
                            ],
                            "order": 1
                        },
                        {
                            "name": "contact",
                            "label": "Kontakt",
                            "fields": [
                                "email",
                                "phone",
                                "street",
                                "city",
                                "zip",
                                "country"
                            ],
                            "order": 2
                        },
                        {
                            "name": "defaults",
                            "label": "Výchozí hodnoty",
                            "fields": [
                                "defaultLocale",
                                "defaultCurrency",
                                "timezone"
                            ],
                            "order": 3
                        }
                    ],
                    "fields": {}
                },
                "properties": {
                    "companyName": {
                        "type": "string"
                    },
                    "legalName": {
                        "type": "string"
                    },
                    "taxId": {
                        "type": "string"
                    },
                    "vatId": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string",
                        "format": "email"
                    },
                    "phone": {
                        "type": "string"
                    },
                    "street": {
                        "type": "string"
                    },
                    "city": {
                        "type": "string"
                    },
                    "zip": {
                        "type": "string"
                    },
                    "country": {
                        "type": "string"
                    },
                    "defaultLocale": {
                        "type": "string"
                    },
                    "defaultCurrency": {
                        "type": "string"
                    },
                    "timezone": {
                        "type": "string"
                    }
                }
            },
            "TenantBranding": {
                "type": "object",
                "x-rbp": {
                    "label": "Branding tenantu",
                    "displayField": "logoUrl",
                    "icon": "stars",
                    "description": "Vizuální identita tenantu (logo, barvy).",
                    "policies": {
                        "read": "admin:tenant:read",
                        "write": "admin:tenant:write"
                    }
                },
                "x-rbp-form": {
                    "layout": "single",
                    "groups": [
                        {
                            "name": "brand",
                            "label": "Značka",
                            "fields": [
                                "logoUrl",
                                "faviconUrl",
                                "primaryColor",
                                "secondaryColor",
                                "accentColor"
                            ]
                        }
                    ],
                    "fields": {
                        "primaryColor": {
                            "widget": "color"
                        },
                        "secondaryColor": {
                            "widget": "color"
                        },
                        "accentColor": {
                            "widget": "color"
                        }
                    }
                },
                "properties": {
                    "logoUrl": {
                        "type": "string"
                    },
                    "faviconUrl": {
                        "type": "string"
                    },
                    "primaryColor": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                    },
                    "secondaryColor": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                    },
                    "accentColor": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                    }
                }
            },
            "ManagedInstance": {
                "type": "object",
                "x-rbp": {
                    "label": "Instance",
                    "labelPlural": "Instance",
                    "displayField": "name",
                    "icon": "grid",
                    "description": "E-shop instance spravované tenantem.",
                    "policies": {
                        "read": "admin:tenant:read",
                        "write": "admin:tenant:write",
                        "delete": "admin:tenant:write"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "name",
                                "label": "Název",
                                "isRowHeader": true,
                                "sortable": true
                            },
                            {
                                "field": "url",
                                "label": "URL",
                                "renderer": "uri"
                            },
                            {
                                "field": "status",
                                "label": "Stav"
                            },
                            {
                                "field": "plan",
                                "label": "Plán"
                            },
                            {
                                "field": "region",
                                "label": "Region"
                            },
                            {
                                "field": "createdAt",
                                "label": "Vytvořeno",
                                "renderer": "date"
                            }
                        ],
                        "defaultSort": {
                            "field": "createdAt",
                            "direction": "desc"
                        }
                    }
                },
                "required": [
                    "id",
                    "name",
                    "url",
                    "status"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "readOnly": true
                    },
                    "name": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "paused",
                            "archived",
                            "setup"
                        ],
                        "x-rbp-enum": {
                            "active": {
                                "label": "Aktivní",
                                "color": "success"
                            },
                            "paused": {
                                "label": "Pozastaveno",
                                "color": "warning"
                            },
                            "archived": {
                                "label": "Archivováno",
                                "color": "gray"
                            },
                            "setup": {
                                "label": "Nastavení",
                                "color": "gray"
                            }
                        }
                    },
                    "plan": {
                        "type": "string"
                    },
                    "region": {
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true
                    }
                }
            },
            "PlanDefinition": {
                "type": "object",
                "x-rbp": {
                    "label": "Plán",
                    "labelPlural": "Plány",
                    "displayField": "id",
                    "icon": "package",
                    "description": "Předplatitelský plán (Free / Starter / Pro / Enterprise).",
                    "policies": {
                        "read": "admin:billing:read"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "id",
                                "label": "Plán",
                                "isRowHeader": true
                            },
                            {
                                "field": "priceMonthly",
                                "label": "Měsíčně",
                                "align": "right"
                            },
                            {
                                "field": "priceAnnual",
                                "label": "Ročně",
                                "align": "right"
                            },
                            {
                                "field": "humanSeats",
                                "label": "Seats",
                                "align": "right"
                            },
                            {
                                "field": "aiAgentSeats",
                                "label": "AI agenti",
                                "align": "right"
                            },
                            {
                                "field": "featured",
                                "label": "Doporučený",
                                "renderer": "boolean"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "priceMonthly",
                    "priceAnnual",
                    "currency"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "enum": [
                            "free",
                            "starter",
                            "pro",
                            "enterprise"
                        ]
                    },
                    "priceMonthly": {
                        "type": "number"
                    },
                    "priceAnnual": {
                        "type": "number"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "humanSeats": {
                        "type": "integer"
                    },
                    "aiAgentSeats": {
                        "type": "integer"
                    },
                    "apiCallsPerMonth": {
                        "type": "integer"
                    },
                    "storageGb": {
                        "type": "integer"
                    },
                    "aiRunsPerMonth": {
                        "type": "integer"
                    },
                    "featured": {
                        "type": "boolean"
                    },
                    "featureKeys": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "Seat": {
                "type": "object",
                "x-rbp": {
                    "label": "Seat",
                    "labelPlural": "Seats",
                    "displayField": "displayName",
                    "icon": "users",
                    "description": "Unified seat (člověk nebo AI agent) podle plánu.",
                    "policies": {
                        "read": "admin:billing:read",
                        "write": "admin:billing:write"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "displayName",
                                "label": "Jméno",
                                "isRowHeader": true,
                                "sortable": true
                            },
                            {
                                "field": "kind",
                                "label": "Typ"
                            },
                            {
                                "field": "role",
                                "label": "Role"
                            },
                            {
                                "field": "status",
                                "label": "Stav"
                            },
                            {
                                "field": "lastActiveAt",
                                "label": "Poslední aktivita",
                                "renderer": "date"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "displayName",
                    "status"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "human",
                            "agent"
                        ],
                        "x-rbp-enum": {
                            "human": {
                                "label": "Člověk",
                                "color": "blue"
                            },
                            "agent": {
                                "label": "AI agent",
                                "color": "purple"
                            }
                        }
                    },
                    "displayName": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "role": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "inactive",
                            "suspended"
                        ],
                        "x-rbp-enum": {
                            "active": {
                                "label": "Aktivní",
                                "color": "success"
                            },
                            "inactive": {
                                "label": "Neaktivní",
                                "color": "gray"
                            },
                            "suspended": {
                                "label": "Pozastaven",
                                "color": "warning"
                            }
                        }
                    },
                    "lastActiveAt": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "UsageMetric": {
                "type": "object",
                "x-rbp": {
                    "label": "Metrika",
                    "labelPlural": "Využití",
                    "displayField": "label",
                    "icon": "banknote",
                    "description": "Metrika využití plánu (aktuální období).",
                    "policies": {
                        "read": "admin:billing:read"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "label",
                                "label": "Metrika",
                                "isRowHeader": true
                            },
                            {
                                "field": "current",
                                "label": "Aktuálně",
                                "align": "right"
                            },
                            {
                                "field": "limit",
                                "label": "Limit",
                                "align": "right"
                            },
                            {
                                "field": "unit",
                                "label": "Jednotka"
                            },
                            {
                                "field": "usagePercent",
                                "label": "Využití %",
                                "align": "right"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "label",
                    "current"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "current": {
                        "type": "number"
                    },
                    "limit": {
                        "type": "number"
                    },
                    "unit": {
                        "type": "string"
                    },
                    "usagePercent": {
                        "type": "number"
                    },
                    "period": {
                        "type": "string"
                    }
                }
            },
            "AiAgent": {
                "type": "object",
                "x-rbp": {
                    "label": "AI agent",
                    "labelPlural": "AI agenti",
                    "displayField": "name",
                    "icon": "cpu",
                    "description": "AI agent z katalogu (instalace/konfigurace per tenant).",
                    "policies": {
                        "read": "admin:agents:read",
                        "write": "admin:agents:write",
                        "delete": "admin:agents:write"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "name",
                                "label": "Název",
                                "isRowHeader": true,
                                "sortable": true
                            },
                            {
                                "field": "category",
                                "label": "Kategorie"
                            },
                            {
                                "field": "tier",
                                "label": "Tier"
                            },
                            {
                                "field": "status",
                                "label": "Stav"
                            },
                            {
                                "field": "runsThisMonth",
                                "label": "Běhů/měsíc",
                                "align": "right"
                            },
                            {
                                "field": "successRate",
                                "label": "Úspěšnost %",
                                "align": "right"
                            }
                        ],
                        "defaultSort": {
                            "field": "name",
                            "direction": "asc"
                        }
                    },
                    "form": {
                        "layout": "single",
                        "groups": [
                            {
                                "name": "main",
                                "label": "Agent",
                                "fields": [
                                    "name",
                                    "description",
                                    "category",
                                    "group",
                                    "tier",
                                    "status",
                                    "model",
                                    "avatarUrl"
                                ],
                                "order": 1
                            },
                            {
                                "name": "metrics",
                                "label": "Metriky",
                                "fields": [
                                    "runsThisMonth",
                                    "successRate"
                                ],
                                "order": 2
                            }
                        ],
                        "fields": {
                            "description": {
                                "widget": "textarea",
                                "rows": 3
                            }
                        }
                    }
                },
                "required": [
                    "id",
                    "name",
                    "category",
                    "tier",
                    "status"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "readOnly": true
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string",
                        "enum": [
                            "content",
                            "analytics",
                            "ops",
                            "marketing",
                            "security",
                            "support"
                        ],
                        "x-rbp-enum": {
                            "content": {
                                "label": "Obsah",
                                "color": "brand"
                            },
                            "analytics": {
                                "label": "Analytika",
                                "color": "blue"
                            },
                            "ops": {
                                "label": "Provoz",
                                "color": "orange"
                            },
                            "marketing": {
                                "label": "Marketing",
                                "color": "pink"
                            },
                            "security": {
                                "label": "Bezpečnost",
                                "color": "error"
                            },
                            "support": {
                                "label": "Podpora",
                                "color": "success"
                            }
                        }
                    },
                    "group": {
                        "type": "string",
                        "enum": [
                            "content",
                            "marketing",
                            "sales",
                            "support",
                            "warehouse",
                            "product",
                            "security",
                            "assistance"
                        ]
                    },
                    "tier": {
                        "type": "string",
                        "enum": [
                            "basic",
                            "advanced",
                            "enterprise"
                        ],
                        "x-rbp-enum": {
                            "basic": {
                                "label": "Basic",
                                "color": "gray"
                            },
                            "advanced": {
                                "label": "Advanced",
                                "color": "brand"
                            },
                            "enterprise": {
                                "label": "Enterprise",
                                "color": "purple"
                            }
                        }
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "paused",
                            "not_installed",
                            "deprecated"
                        ],
                        "x-rbp-enum": {
                            "active": {
                                "label": "Aktivní",
                                "color": "success"
                            },
                            "paused": {
                                "label": "Pozastaven",
                                "color": "warning"
                            },
                            "not_installed": {
                                "label": "Nenainstalován",
                                "color": "gray"
                            },
                            "deprecated": {
                                "label": "Zastaralý",
                                "color": "error"
                            }
                        }
                    },
                    "model": {
                        "type": "string"
                    },
                    "avatarUrl": {
                        "type": "string"
                    },
                    "runsThisMonth": {
                        "type": "integer"
                    },
                    "successRate": {
                        "type": "number"
                    }
                }
            },
            "AgentRun": {
                "type": "object",
                "x-rbp": {
                    "label": "Běh agenta",
                    "labelPlural": "Aktivita agentů",
                    "displayField": "agentName",
                    "icon": "zap",
                    "description": "Záznam běhu AI agenta (read-only aktivita).",
                    "policies": {
                        "read": "admin:agents:read"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "agentName",
                                "label": "Agent",
                                "isRowHeader": true
                            },
                            {
                                "field": "task",
                                "label": "Úkol"
                            },
                            {
                                "field": "status",
                                "label": "Stav"
                            },
                            {
                                "field": "durationMs",
                                "label": "Trvání (ms)",
                                "align": "right"
                            },
                            {
                                "field": "startedAt",
                                "label": "Spuštěno",
                                "renderer": "date"
                            }
                        ],
                        "defaultSort": {
                            "field": "startedAt",
                            "direction": "desc"
                        }
                    }
                },
                "required": [
                    "id",
                    "agentId",
                    "agentName",
                    "status",
                    "startedAt"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "agentId": {
                        "type": "string"
                    },
                    "agentName": {
                        "type": "string"
                    },
                    "task": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "success",
                            "failed",
                            "running",
                            "queued"
                        ],
                        "x-rbp-enum": {
                            "success": {
                                "label": "Úspěch",
                                "color": "success"
                            },
                            "failed": {
                                "label": "Chyba",
                                "color": "error"
                            },
                            "running": {
                                "label": "Běží",
                                "color": "blue"
                            },
                            "queued": {
                                "label": "Ve frontě",
                                "color": "gray"
                            }
                        }
                    },
                    "durationMs": {
                        "type": "integer"
                    },
                    "startedAt": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "errorMessage": {
                        "type": "string"
                    }
                }
            },
            "ApiKey": {
                "type": "object",
                "x-rbp": {
                    "label": "API klíč",
                    "labelPlural": "API klíče",
                    "displayField": "name",
                    "icon": "key",
                    "description": "Programový přístupový klíč tenanta (rotate/revoke).",
                    "policies": {
                        "read": "admin:security:read",
                        "write": "admin:security:write",
                        "delete": "admin:security:write"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "name",
                                "label": "Název",
                                "isRowHeader": true,
                                "sortable": true
                            },
                            {
                                "field": "scope",
                                "label": "Scope"
                            },
                            {
                                "field": "createdBy",
                                "label": "Vytvořil"
                            },
                            {
                                "field": "createdAt",
                                "label": "Vytvořeno",
                                "renderer": "date"
                            },
                            {
                                "field": "lastUsedAt",
                                "label": "Naposledy použito",
                                "renderer": "date"
                            },
                            {
                                "field": "isActive",
                                "label": "Aktivní",
                                "renderer": "boolean"
                            }
                        ],
                        "defaultSort": {
                            "field": "lastUsedAt",
                            "direction": "desc"
                        }
                    },
                    "form": {
                        "layout": "single",
                        "groups": [
                            {
                                "name": "main",
                                "label": "Klíč",
                                "fields": [
                                    "name",
                                    "scope"
                                ]
                            }
                        ],
                        "fields": {}
                    }
                },
                "required": [
                    "id",
                    "name",
                    "scope",
                    "isActive"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "readOnly": true
                    },
                    "name": {
                        "type": "string"
                    },
                    "prefix": {
                        "type": "string",
                        "readOnly": true
                    },
                    "last4": {
                        "type": "string",
                        "readOnly": true
                    },
                    "scope": {
                        "type": "string",
                        "enum": [
                            "read",
                            "write",
                            "admin"
                        ],
                        "x-rbp-enum": {
                            "read": {
                                "label": "Read",
                                "color": "gray"
                            },
                            "write": {
                                "label": "Write",
                                "color": "blue"
                            },
                            "admin": {
                                "label": "Admin",
                                "color": "warning"
                            }
                        }
                    },
                    "createdBy": {
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true
                    },
                    "lastUsedAt": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "isActive": {
                        "type": "boolean",
                        "default": true
                    }
                }
            },
            "AdminAuditEvent": {
                "type": "object",
                "x-rbp": {
                    "label": "Událost",
                    "labelPlural": "Audit log",
                    "displayField": "summary",
                    "icon": "clipboard-check",
                    "description": "Záznam aktivity v tenantu (read-only).",
                    "policies": {
                        "read": "admin:security:read"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "timestamp",
                                "label": "Čas",
                                "renderer": "date",
                                "sortable": true
                            },
                            {
                                "field": "actor",
                                "label": "Actor"
                            },
                            {
                                "field": "action",
                                "label": "Akce"
                            },
                            {
                                "field": "target",
                                "label": "Cíl"
                            },
                            {
                                "field": "severity",
                                "label": "Závažnost"
                            },
                            {
                                "field": "summary",
                                "label": "Popis"
                            }
                        ],
                        "defaultSort": {
                            "field": "timestamp",
                            "direction": "desc"
                        }
                    }
                },
                "required": [
                    "id",
                    "timestamp",
                    "actor",
                    "action",
                    "severity"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "timestamp": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "actor": {
                        "type": "string"
                    },
                    "action": {
                        "type": "string",
                        "enum": [
                            "create",
                            "update",
                            "delete",
                            "login",
                            "export"
                        ],
                        "x-rbp-enum": {
                            "create": {
                                "label": "Vytvoření",
                                "color": "success"
                            },
                            "update": {
                                "label": "Úprava",
                                "color": "brand"
                            },
                            "delete": {
                                "label": "Smazání",
                                "color": "error"
                            },
                            "login": {
                                "label": "Přihlášení",
                                "color": "gray"
                            },
                            "export": {
                                "label": "Export",
                                "color": "blue"
                            }
                        }
                    },
                    "target": {
                        "type": "string"
                    },
                    "severity": {
                        "type": "string",
                        "enum": [
                            "info",
                            "warning",
                            "error",
                            "critical"
                        ],
                        "x-rbp-enum": {
                            "info": {
                                "label": "Info",
                                "color": "gray"
                            },
                            "warning": {
                                "label": "Varování",
                                "color": "warning"
                            },
                            "error": {
                                "label": "Chyba",
                                "color": "error"
                            },
                            "critical": {
                                "label": "Kritické",
                                "color": "pink"
                            }
                        }
                    },
                    "summary": {
                        "type": "string"
                    },
                    "ip": {
                        "type": "string"
                    }
                }
            },
            "Webhook": {
                "type": "object",
                "x-rbp": {
                    "label": "Webhook",
                    "labelPlural": "Webhooky",
                    "displayField": "name",
                    "icon": "dataflow",
                    "description": "Odchozí webhook na externí systém.",
                    "policies": {
                        "read": "admin:integrations:read",
                        "write": "admin:integrations:write",
                        "delete": "admin:integrations:write"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "name",
                                "label": "Název",
                                "isRowHeader": true
                            },
                            {
                                "field": "url",
                                "label": "URL",
                                "renderer": "uri"
                            },
                            {
                                "field": "events",
                                "label": "Události"
                            },
                            {
                                "field": "status",
                                "label": "Stav"
                            },
                            {
                                "field": "lastDeliveryAt",
                                "label": "Poslední doručení",
                                "renderer": "date"
                            }
                        ]
                    },
                    "form": {
                        "layout": "single",
                        "groups": [
                            {
                                "name": "main",
                                "label": "Webhook",
                                "fields": [
                                    "name",
                                    "url",
                                    "events",
                                    "status",
                                    "secret"
                                ]
                            }
                        ],
                        "fields": {
                            "secret": {
                                "widget": "password"
                            }
                        }
                    }
                },
                "required": [
                    "id",
                    "name",
                    "url",
                    "status"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "readOnly": true
                    },
                    "name": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "paused",
                            "failing"
                        ],
                        "x-rbp-enum": {
                            "active": {
                                "label": "Aktivní",
                                "color": "success"
                            },
                            "paused": {
                                "label": "Pozastaven",
                                "color": "gray"
                            },
                            "failing": {
                                "label": "Selhává",
                                "color": "error"
                            }
                        }
                    },
                    "secret": {
                        "type": "string",
                        "writeOnly": true
                    },
                    "lastDeliveryAt": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "createdAt": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true
                    }
                }
            },
            "PlatformSettings": {
                "type": "object",
                "x-rbp": {
                    "label": "Nastavení platformy",
                    "displayField": "platformName",
                    "icon": "settings",
                    "description": "Obecná nastavení platformy tenanta.",
                    "policies": {
                        "read": "admin:platform:read",
                        "write": "admin:platform:write"
                    }
                },
                "x-rbp-form": {
                    "layout": "single",
                    "groups": [
                        {
                            "name": "general",
                            "label": "Obecné",
                            "fields": [
                                "platformName",
                                "supportEmail",
                                "defaultLanguage",
                                "maintenanceMode"
                            ],
                            "order": 1
                        },
                        {
                            "name": "features",
                            "label": "Funkce",
                            "fields": [
                                "aiAgentsEnabled",
                                "webhooksEnabled",
                                "apiAccessEnabled",
                                "ssoEnforced"
                            ],
                            "order": 2
                        }
                    ],
                    "fields": {}
                },
                "properties": {
                    "platformName": {
                        "type": "string"
                    },
                    "supportEmail": {
                        "type": "string",
                        "format": "email"
                    },
                    "defaultLanguage": {
                        "type": "string"
                    },
                    "maintenanceMode": {
                        "type": "boolean"
                    },
                    "aiAgentsEnabled": {
                        "type": "boolean"
                    },
                    "webhooksEnabled": {
                        "type": "boolean"
                    },
                    "apiAccessEnabled": {
                        "type": "boolean"
                    },
                    "ssoEnforced": {
                        "type": "boolean"
                    }
                }
            },
            "ComplianceSettings": {
                "type": "object",
                "x-rbp": {
                    "label": "Compliance",
                    "displayField": "dataResidency",
                    "icon": "database",
                    "description": "Compliance a data-governance nastavení.",
                    "policies": {
                        "read": "admin:platform:read",
                        "write": "admin:platform:write"
                    }
                },
                "x-rbp-form": {
                    "layout": "single",
                    "groups": [
                        {
                            "name": "data",
                            "label": "Data governance",
                            "fields": [
                                "dataResidency",
                                "gdprMode",
                                "retentionDays"
                            ],
                            "order": 1
                        },
                        {
                            "name": "audit",
                            "label": "Audit",
                            "fields": [
                                "auditLogEnabled",
                                "exportAllowed"
                            ],
                            "order": 2
                        }
                    ],
                    "fields": {}
                },
                "properties": {
                    "dataResidency": {
                        "type": "string",
                        "enum": [
                            "eu",
                            "us",
                            "custom"
                        ],
                        "x-rbp-enum": {
                            "eu": {
                                "label": "EU",
                                "color": "blue"
                            },
                            "us": {
                                "label": "US",
                                "color": "orange"
                            },
                            "custom": {
                                "label": "Vlastní",
                                "color": "purple"
                            }
                        }
                    },
                    "gdprMode": {
                        "type": "boolean"
                    },
                    "retentionDays": {
                        "type": "integer"
                    },
                    "auditLogEnabled": {
                        "type": "boolean"
                    },
                    "exportAllowed": {
                        "type": "boolean"
                    }
                }
            },
            "NotificationChannel": {
                "type": "object",
                "x-rbp": {
                    "label": "Kanál",
                    "labelPlural": "Notifikační kanály",
                    "displayField": "label",
                    "icon": "flag",
                    "description": "Notifikační kanál (e-mail, Slack, webhook, SMS).",
                    "policies": {
                        "read": "admin:platform:read",
                        "write": "admin:platform:write"
                    }
                },
                "x-rbp-admin": {
                    "datagrid": {
                        "columns": [
                            {
                                "field": "label",
                                "label": "Kanál",
                                "isRowHeader": true
                            },
                            {
                                "field": "kind",
                                "label": "Typ"
                            },
                            {
                                "field": "target",
                                "label": "Cíl"
                            },
                            {
                                "field": "enabled",
                                "label": "Povoleno",
                                "renderer": "boolean"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "label",
                    "enabled"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "email",
                            "slack",
                            "webhook",
                            "sms"
                        ],
                        "x-rbp-enum": {
                            "email": {
                                "label": "E-mail",
                                "color": "blue"
                            },
                            "slack": {
                                "label": "Slack",
                                "color": "purple"
                            },
                            "webhook": {
                                "label": "Webhook",
                                "color": "brand"
                            },
                            "sms": {
                                "label": "SMS",
                                "color": "orange"
                            }
                        }
                    },
                    "label": {
                        "type": "string"
                    },
                    "target": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean",
                        "default": true
                    }
                }
            }
        }
    },
    "x-rbp-app": {
        "apps": {
            "admin": {
                "name": "Admin UI",
                "type": "admin",
                "treeNodeId": "admin",
                "description": "System administration",
                "theme": {
                    "palette": {
                        "primary": "#525866",
                        "deep": "#2D3039",
                        "secondary": "#7C33E1",
                        "highlight": "#A78BFA",
                        "accent": "#34D399"
                    },
                    "logo": {
                        "default": "/rbp-logo.svg",
                        "maxHeight": "36px"
                    }
                }
            }
        }
    },
    "x-rbp-app-tree": {
        "version": "1.0",
        "nodes": {
            "admin": {
                "level": 1,
                "appId": "admin",
                "name": "Admin UI",
                "description": "Platform & tenant administration",
                "url": "https://admin.sandbox.retailys.com",
                "icon": "Settings01",
                "children": [
                    "admin.tenant",
                    "admin.billing",
                    "admin.users",
                    "admin.agents",
                    "admin.security",
                    "admin.integrations",
                    "admin.platform"
                ]
            },
            "admin.tenant": {
                "level": 2,
                "name": "Tenant",
                "icon": "Building07",
                "resources": [
                    "iam/tenants",
                    "admin/tenant/profile",
                    "admin/tenant/branding",
                    "admin/tenant/instances",
                    "catalogs/{tenantId}/language-locales"
                ]
            },
            "admin.billing": {
                "level": 2,
                "name": "Billing",
                "icon": "CurrencyDollarCircle",
                "resources": [
                    "iam/tenants/{tenantId}/billing",
                    "admin/billing/plans",
                    "admin/billing/seats",
                    "billing/{tenantId}/invoices",
                    "pay/{tenantId}/payment-methods",
                    "admin/billing/usage"
                ]
            },
            "admin.users": {
                "level": 2,
                "name": "Uživatelé",
                "icon": "Users01",
                "resources": [
                    "iam/users",
                    "iam/tenants/{tenantId}/roles",
                    "iam/tenants/{tenantId}/invites",
                    "admin/audit-log"
                ]
            },
            "admin.agents": {
                "level": 2,
                "name": "Agenti",
                "icon": "CpuChip01",
                "resources": [
                    "admin/agents",
                    "admin/agent-runs"
                ]
            },
            "admin.security": {
                "level": 2,
                "name": "Zabezpečení",
                "icon": "Lock01",
                "resources": [
                    "iam/group-mappings",
                    "admin/api-keys"
                ]
            },
            "admin.integrations": {
                "level": 2,
                "name": "Integrace",
                "icon": "LayoutGrid01",
                "resources": [
                    "iam/tenants/{tenantId}/apps",
                    "admin/webhooks"
                ]
            },
            "admin.platform": {
                "level": 2,
                "name": "Platforma",
                "icon": "Settings01",
                "resources": [
                    "admin/settings",
                    "admin/notification-channels",
                    "admin/compliance"
                ]
            }
        }
    },
    "x-rbp-navigation": {
        "admin": {
            "menu": [
                {
                    "category": "Tenant",
                    "services": [
                        "tenant"
                    ]
                },
                {
                    "category": "Billing",
                    "services": [
                        "billing"
                    ]
                },
                {
                    "category": "Uživatelé",
                    "services": [
                        "users"
                    ]
                },
                {
                    "category": "Agenti",
                    "services": [
                        "agents"
                    ]
                },
                {
                    "category": "Zabezpečení",
                    "services": [
                        "security"
                    ]
                },
                {
                    "category": "Integrace",
                    "services": [
                        "integrations"
                    ]
                },
                {
                    "category": "Platforma",
                    "services": [
                        "platform"
                    ]
                }
            ],
            "categories": {
                "Tenant": [
                    "tenant"
                ],
                "Billing": [
                    "billing"
                ],
                "Uživatelé": [
                    "users"
                ],
                "Agenti": [
                    "agents"
                ],
                "Zabezpečení": [
                    "security"
                ],
                "Integrace": [
                    "integrations"
                ],
                "Platforma": [
                    "platform"
                ]
            }
        }
    },
    "x-rbp-canvas": {
        "version": "1.0",
        "canvases": {
            "admin-dashboard": {
                "title": "Přehled administrace",
                "description": "Stav tenantu, billing a aktivita platformy.",
                "icon": "Home01",
                "route": "dashboard",
                "appId": "admin",
                "grid": {
                    "columns": 12,
                    "gap": "md"
                },
                "widgets": [
                    {
                        "id": "stat-users",
                        "type": "stat",
                        "title": "Uživatelé",
                        "layout": {
                            "colSpan": 3
                        },
                        "data": {
                            "kind": "aggregate",
                            "resource": "iam/users",
                            "measures": [
                                {
                                    "id": "count",
                                    "op": "count"
                                }
                            ]
                        },
                        "options": {
                            "icon": "Users01"
                        }
                    },
                    {
                        "id": "stat-invites",
                        "type": "stat",
                        "title": "Pozvánky",
                        "layout": {
                            "colSpan": 3
                        },
                        "data": {
                            "kind": "aggregate",
                            "resource": "iam/tenants/{tenantId}/invites",
                            "measures": [
                                {
                                    "id": "count",
                                    "op": "count"
                                }
                            ]
                        },
                        "options": {
                            "icon": "Mail01"
                        }
                    },
                    {
                        "id": "stat-agents",
                        "type": "stat",
                        "title": "AI agenti",
                        "layout": {
                            "colSpan": 3
                        },
                        "data": {
                            "kind": "aggregate",
                            "resource": "{tenantId}/admin/agents",
                            "measures": [
                                {
                                    "id": "count",
                                    "op": "count"
                                }
                            ]
                        },
                        "options": {
                            "icon": "CpuChip01"
                        }
                    },
                    {
                        "id": "stat-apikeys",
                        "type": "stat",
                        "title": "API klíče",
                        "layout": {
                            "colSpan": 3
                        },
                        "data": {
                            "kind": "aggregate",
                            "resource": "{tenantId}/admin/api-keys",
                            "measures": [
                                {
                                    "id": "count",
                                    "op": "count"
                                }
                            ]
                        },
                        "options": {
                            "icon": "Key01"
                        }
                    },
                    {
                        "id": "table-invoices",
                        "type": "table",
                        "title": "Poslední faktury",
                        "layout": {
                            "colSpan": 7
                        },
                        "data": {
                            "kind": "collection",
                            "resource": "billing/{tenantId}/invoices",
                            "limit": 6
                        },
                        "options": {
                            "columns": [
                                "invoiceNumber",
                                "status",
                                "amount",
                                "currency",
                                "issuedAt"
                            ]
                        }
                    },
                    {
                        "id": "table-audit",
                        "type": "table",
                        "title": "Nedávná aktivita",
                        "layout": {
                            "colSpan": 5
                        },
                        "data": {
                            "kind": "collection",
                            "resource": "{tenantId}/admin/audit-log",
                            "limit": 6
                        },
                        "options": {
                            "columns": [
                                "timestamp",
                                "actor",
                                "action",
                                "severity"
                            ]
                        }
                    }
                ]
            }
        }
    }
}
