"""Server/database schema planning helpers for future NexaOffice online mode.

This file is intentionally lightweight and not wired into production sync yet.
It gives the desktop app a stable vocabulary for future backend/CRM work
without changing today's local-first behavior.
"""

from pathlib import Path
from core.constants import BASE_DIR
from core.storage import load_json

SCHEMA_PATH = BASE_DIR / "data" / "server_schema_latest.json"


def load_server_schema():
    return load_json(SCHEMA_PATH, {"version": "unknown", "entities": {}, "api_groups": {}})


def entity_names():
    return sorted(load_server_schema().get("entities", {}).keys())


def api_groups():
    return load_server_schema().get("api_groups", {})
