Documentation
¶
Overview ¶
Package catalog is the HTTP surface for the platform product catalog — the CMS source-of-truth for a brand's OWN products (Models, Vector, KMS, …) that docs.<brand>, the console sidebar, and pricing derive from.
Two audiences, two auth models:
- PUBLIC read: GET /catalog returns the brand-scoped projection with no auth (it is public presentation + pricing data). Wired on the commerce public group so it serves the exact path GET /v1/commerce/catalog.
- PLATFORM-ADMIN write: create/update/delete/seed mutate the platform-global catalog (the "system" namespace, NOT a per-tenant org), so they gate on auth.IAMClaims.SuperAdmin() — a Hanzo platform admin, never an org-level admin. Wired on the /v1 bundle under /catalog/entries.
The catalog is platform-global: one store in the "system" namespace, scoped per requesting brand BY CATEGORY at projection time (matching @hanzo/products catalogForBrand). Entries are keyed by their globally-unique slug.
Index ¶
Constants ¶
const CatalogNamespace = "system"
CatalogNamespace is the platform-global namespace the catalog lives in — not a per-tenant org. Brand partitioning is by the entry's Brand field.
Variables ¶
This section is empty.
Functions ¶
func AdminRoute ¶
func AdminRoute(r router.Router, args ...gin.HandlerFunc)
AdminRoute wires the platform-admin catalog CRUD + seed on the /v1 bundle.
func CreateEntry ¶
CreateEntry adds a catalog entry (platform admin).
func DeleteEntry ¶
DeleteEntry removes a catalog entry by slug (platform admin).
func ListEntries ¶
ListEntries returns the raw catalog entries (admin view — includes unpublished). Optional ?brand filter.
func Public ¶
Public returns the brand-scoped catalog projection. Public + cacheable. Brand from ?brand (default hanzo).
func PublicRoute ¶
PublicRoute wires the public, unauthenticated catalog projection. Mount on the commerce public group so it serves GET /v1/commerce/catalog.
func SeedCatalog ¶
SeedCatalog upserts the embedded Hanzo catalog seed (idempotent, non-destructive — never overwrites CMS edits). Platform admin only.
func UpdateEntry ¶
UpdateEntry edits a catalog entry by slug (platform admin). The slug identity is preserved; other fields are replaced from the body.
Types ¶
This section is empty.