Product-Catalog — Product Draft, Publish Gate & Descriptive Data

By Engineering Team•September 25, 2026•5 min read

Responsibility

product-catalog owns a product’s descriptive/merchandising data and is the system of record for whether a product is publishable.

  • Draft lifecycle — the admin wizard’s Product Info, Specifications & Tags, and Review & Publish steps read/write a product’s core document here: name, description, category, tags, and image references.
  • Image references — consumes content-processor’s processed-image events (the same pipeline documented in Architecture: Image Processing Pipeline) and attaches the derived image paths to the product document.
  • Publish-readiness gate — ProductCrudService.Publish checks five per-step sync markers (variant, dimensions, compliance/pricing, package map, opening entry) set by inventory-service’s completion events, and rejects publish if any required marker isn’t complete. This is a local check only — no synchronous call to inventory-service happens at publish time (see ADR-00005).
  • Read source for storefront assembly — shop-service reads product descriptive data from here (gRPC) when assembling curated storefront sections.
  • Search index publisher — ProductSearchEventPublisher publishes a product.catalog.updated event on product create, basic-info/specification update, clone, publish, archive, and delete — the sole product-lifecycle input to search-service’s product_search index (see SR-006 FR-14, ADR-00017).
  • Duplicate-as-new and archive/delete lifecycle actions for a product.
  • Category Master (admin master data) — CategoryService’s Create/Update/Delete surface maintains the tenant’s three-level category hierarchy (root → sub-category → leaf) in the categories collection: adjacency list via parent_id plus a denormalized ancestors array, computed once at insert and never recomputed (ADR-00038). parent_id/node_level are immutable after creation — no re-parenting support. A category cannot be deleted while it still has children. See SR-024 for the full contract.
  • Category read surfaces beyond the admin console — GET /category/product-categories serves the product-setup wizard’s category picker; CategoryQueryService.GetCategoriesByIDs (gRPC) serves shop-service’s storefront category resolution — both independent of the admin console’s own CRUD surface.

Tech Stack

Concern Choice
Language Go
Data store MongoDB — see ADR-00008 for why this differs from inventory-service’s PostgreSQL
gRPC Server — consumed by shop-service for both product read and CategoryQueryService.GetCategoriesByIDs; see ADR-00009 for why gRPC rather than REST
REST Admin wizard’s Product Info / Specifications & Tags / Review & Publish steps; Category Master’s admin console (/product/admin/api/v1/category)
Messaging Firebase Pub/Sub — subscriber to inventory-service’s five step-completion events and to content-processor’s processed-image events; also a publisher of product.catalog.updated, consumed by search-service (see SR-006 FR-14)
Dependency injection Uber Fx
Template @templates/go-mongo-microservice, gRPC layer composed from @templates/go-grpc-microservice

Data Model — MongoDB

Collection Purpose
Product Draft/published product document — descriptive fields, category, image references, and the five inventory-service sync markers used by the publish-readiness check
categories Three-level category hierarchy (root/sub-category/leaf) — parent_id adjacency link, denormalized ancestors array computed once at insert, per-level fields (specTemplate on roots, variantAttributes on sub-categories), active/createdAt/updatedAt/description carried but not all surfaced in the API response (see Technical Debt — TD-00018)

API Endpoints (Product)

Action Endpoint
Full upsert (legacy/simple update) PUT /product/admin/api/v1/product
Search / List (admin) GET /product/admin/api/v1/product/search
Create draft (basic info) POST /product/admin/api/v1/products/basic-info
Update basic info PUT /product/admin/api/v1/products/:productId/basic-info
Update specifications & tags PUT /product/admin/api/v1/products/:productId/specifications
Get by ID (full detail) GET /product/admin/api/v1/products/:productId
Publish-readiness report GET /product/admin/api/v1/products/:productId/publish-readiness
Publish POST /product/admin/api/v1/products/:productId/publish
Duplicate / Clone POST /product/admin/api/v1/products/:productId/clone
Archive PATCH /product/admin/api/v1/products/:productId/archive
Delete DELETE /product/admin/api/v1/products/:productId

No dedicated image-attach REST route exists — image URLs are read-only fields returned inside the Get/basic-info/publish-readiness responses, populated by the content-processor Pub/Sub subscription described above, never written via a Product REST call.

Product gRPC Service

Method Consumed by
ProductService/GetProductSummary —
ProductService/GetBatchProductSummaries —
ProductService/GetProductFullDetail shop-service, for storefront product descriptive data (also fires the recent-view Pub/Sub event server-side)

API Endpoints (Category Master)

Action Endpoint
Create / List POST / GET /product/admin/api/v1/category
Get / Update GET / PUT /product/admin/api/v1/category/:id
Delete (blocked if children exist) DELETE /product/admin/api/v1/category/:id
Product wizard’s category picker GET /product/admin/api/v1/category/product-categories

Implementation Notes

  • The Product REST surface has no single consistent path prefix: the legacy full-upsert (PUT) and admin search (GET) routes sit under singular /product, while every other Product CRUD/lifecycle route (create draft, update, get, publish, clone, archive, delete) sits under plural /products — both groups coexist in the same router.go, not a typo in one call site.
  • Publish’s readiness check is a pure local read of previously-received sync markers, not a live re-verification against inventory-service — see Technical Debt — Product Catalog Admin-to-Mobile Gaps, TD-04 for the staleness risk this carries.
  • Each of the five inventory-service completion events is subscribed to independently — a delayed or lost event for one step never blocks another step’s marker from updating.
  • The product.catalog.updated publish behind ProductSearchEventPublisher is inconsistent across call sites: Create/UpdateBasicInfo/Clone publish via a fire-and-forget goroutine (context.WithoutCancel), while UpdateSpecifications/Publish/Archive/Delete publish synchronously/inline in the same request path — tracked as Technical-Debt-00006, TD-06.
  • The admin wizard’s own module documentation (ui-admin-application/src/features/product/CLAUDE.md) is known to misdescribe both the wizard’s step count and the publish flow’s cross-service behavior — see Technical Debt — Product Catalog Admin-to-Mobile Gaps, TD-02.
  • Category Master’s ancestors array is computed once, at insert, from the parent’s own ancestors plus the parent’s ID — no code path recomputes it later, which is also why re-parenting a category is not supported (ADR-00038). Unlike Warehouse Master/Package Master, Category Master has no DRAFT/PUBLISHED/ARCHIVED lifecycle — active is hardcoded true. See Technical Debt — TD-00018.

Admin UI Walkthrough: 07-ui-admin, Category Master Console. Architecture overview: Architecture: Product Catalog — Admin to Mobile Flow. Category Master: BRD-023, SR-024, ADR-00038, Architecture — Category Master: Three-Level Hierarchy Administration, Technical Debt — TD-00018.