import type { Catalog, CableType, DeviceCategoryDef, DeviceTemplate, PortType } from '../domain/types' /** * Storage abstraction for the global port/cable/category/device-template * catalog — mirrors DiagramRepository's role, but for catalog data instead * of diagrams. Fetching returns everything the current user can see (public * entries plus their own private ones); RLS does that filtering server-side, * so implementations don't need to filter client-side. * * Only covers the "read + manage your own private entries" surface for now. * Submitting a private entry for public review/promotion is a separate, * not-yet-built workflow (organized-ideas.md §3/§9) — these `add*`/`update*` * methods always create or edit is_public = false rows you own. */ export interface CatalogRepository { /** Everything visible to the current user: public entries plus their own private ones. */ load(): Promise addDeviceCategory(name: string): Promise addPortType(portType: Omit): Promise updatePortType(id: string, patch: Partial>): Promise addCableType(cableType: Omit): Promise updateCableType(id: string, patch: Partial>): Promise addDeviceTemplate(template: Omit): Promise updateDeviceTemplate(id: string, patch: Partial>): Promise removeDeviceTemplate(id: string): Promise }