[P1] Add minimal public catalog fields and publish workflow #2

Closed
opened 2026-07-16 22:44:38 +00:00 by yuris · 1 comment
Owner

Goal

Make selected inventory items publishable to the separate static garage-store site without creating unnecessary admin data-entry burden.

Decision

Do not add separate category or brand fields in this issue. The existing admin-facing inventory.type (Part, Consumable, Accessory) remains the only classification for now; the public endpoint may expose it as type if useful, without introducing a second category concept. Brand is omitted until there is a demonstrated need.

Change

Add only the minimum new public fields:

  • slug — unique, stable URL identifier
  • description — nullable until content is written
  • images — list/array of public image references, default empty list
  • isPublished — default false

Reuse existing fields where appropriate:

  • itemName as the public name
  • sellPrice only if the business wants to publish prices
  • existing type only as an optional public grouping, not a new category field

Do not expose or add buy price, average cost, suppliers, stock movements, customers, private IDs, or other optional product attributes in this first pass.

Acceptance criteria

  • Authenticated staff can publish and unpublish selected items.
  • Slugs are unique and validated.
  • Staff can attach zero or more images without managing a separate image record for each one.
  • Existing dashboard stock, purchase, order, and report workflows continue to work.
  • A public-safe query/type is defined for the catalog endpoint.
  • Tests cover unpublished-by-default, slug validation/uniqueness, image-list handling, and safe-field selection.

This issue deliberately avoids adding brand and category fields until actual catalog usage proves they are needed.

PRD: https://git.nokopia.com/yuris/garage/src/branch/main/docs/store-prd.md

## Goal Make selected inventory items publishable to the separate static `garage-store` site without creating unnecessary admin data-entry burden. ## Decision Do not add separate `category` or `brand` fields in this issue. The existing admin-facing `inventory.type` (`Part`, `Consumable`, `Accessory`) remains the only classification for now; the public endpoint may expose it as `type` if useful, without introducing a second category concept. Brand is omitted until there is a demonstrated need. ## Change Add only the minimum new public fields: - `slug` — unique, stable URL identifier - `description` — nullable until content is written - `images` — list/array of public image references, default empty list - `isPublished` — default false Reuse existing fields where appropriate: - `itemName` as the public name - `sellPrice` only if the business wants to publish prices - existing `type` only as an optional public grouping, not a new category field Do not expose or add buy price, average cost, suppliers, stock movements, customers, private IDs, or other optional product attributes in this first pass. ## Acceptance criteria - Authenticated staff can publish and unpublish selected items. - Slugs are unique and validated. - Staff can attach zero or more images without managing a separate image record for each one. - Existing dashboard stock, purchase, order, and report workflows continue to work. - A public-safe query/type is defined for the catalog endpoint. - Tests cover unpublished-by-default, slug validation/uniqueness, image-list handling, and safe-field selection. This issue deliberately avoids adding brand and category fields until actual catalog usage proves they are needed. PRD: https://git.nokopia.com/yuris/garage/src/branch/main/docs/store-prd.md
yuris changed title from [P1] Add public catalog fields and publish workflow to [P1] Add minimal public catalog fields and publish workflow 2026-07-16 22:58:28 +00:00
Author
Owner

Implemented in the local working tree. Added slug, nullable description, images (text[], default empty), and isPublished (default false), with a unique slug index and a DB check preventing publication without a slug. Authenticated inventory create/update APIs now accept the catalog fields. Added the public-safe catalog schema and contract tests for defaults, slug validation, image lists, and private-field stripping.

Verification: pnpm test — 28 passed; pnpm build — passed; migration 0009_greedy_hulk.sql applied successfully through devenv up.

Leaving open until the working-tree changes are committed/pushed.

Implemented in the local working tree. Added `slug`, nullable `description`, `images` (`text[]`, default empty), and `isPublished` (default false), with a unique slug index and a DB check preventing publication without a slug. Authenticated inventory create/update APIs now accept the catalog fields. Added the public-safe catalog schema and contract tests for defaults, slug validation, image lists, and private-field stripping. Verification: `pnpm test` — 28 passed; `pnpm build` — passed; migration `0009_greedy_hulk.sql` applied successfully through `devenv up`. Leaving open until the working-tree changes are committed/pushed.
yuris closed this issue 2026-07-16 23:14:20 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/garage#2
No description provided.