catalog

package
v1.786.220 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: Apache-2.0, MIT Imports: 10 Imported by: 0

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

View Source
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

func CreateEntry(c *gin.Context)

CreateEntry adds a catalog entry (platform admin).

func DeleteEntry

func DeleteEntry(c *gin.Context)

DeleteEntry removes a catalog entry by slug (platform admin).

func ListEntries

func ListEntries(c *gin.Context)

ListEntries returns the raw catalog entries (admin view — includes unpublished). Optional ?brand filter.

func Public

func Public(c *gin.Context)

Public returns the brand-scoped catalog projection. Public + cacheable. Brand from ?brand (default hanzo).

func PublicRoute

func PublicRoute(r router.Router)

PublicRoute wires the public, unauthenticated catalog projection. Mount on the commerce public group so it serves GET /v1/commerce/catalog.

func SeedCatalog

func SeedCatalog(c *gin.Context)

SeedCatalog upserts the embedded Hanzo catalog seed (idempotent, non-destructive — never overwrites CMS edits). Platform admin only.

func UpdateEntry

func UpdateEntry(c *gin.Context)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL