"""Abstract sidebar-menu override persistence API. Global / shared store: no ``user_id`` scoping. Reads are open to any caller; the router gates writes behind admin. ``updated_by`` is audit-only. The whole override set is treated as one document: the editor computes the full desired layout and replaces every row atomically via :meth:`replace_all`, so the stored set never drifts out of sync with what the admin sees. """ from __future__ import annotations from abc import ABC, abstractmethod from typing import Any class MenuOverrideStore(ABC): @abstractmethod async def list_overrides(self) -> list[dict[str, Any]]: """Return every stored override row (order unspecified).""" raise NotImplementedError @abstractmethod async def replace_all(self, rows: list[dict[str, Any]], *, updated_by: str | None = None) -> list[dict[str, Any]]: """Atomically replace the entire override set with ``rows``. Each row is ``{node_id, parent_id, sort_order, label, disabled}``. Returns the persisted rows. """ raise NotImplementedError