Savvi Studio

Products Cutover Checklist (Track 2 Slice 1)

Date: 2026-03-16 Status: done

Objective

Cut over the Products domain to canonical API + hooks + UI flow with test/type gates passing.

Scope

  • API: packages/api-domain-products
  • Hooks: consolidated into packages/ui-domain-entities-components/products/useProducts.ts
  • UI: packages/ui-domain-entities-components/products
  • Router integration: packages/api-router

Current Verified State

  • Router wiring exists (products mounted in root router).
  • API list procedure now uses a canonical domain token + service path:
    • listProductsProcedure resolves productServiceToken and returns paged data from ProductService.listProducts().
  • API mutation procedures are now present for products:
    • products.put and products.del are wired to ProductService.putProduct() and ProductService.deleteProduct().
  • Products domain service/provider wiring exists and is registered in server app providers.
  • Hook mutation layer now calls canonical tRPC mutations for create/edit/delete paths:
    • trpc.products.put and trpc.products.del.
  • Story coverage exists:
    • stories/Products.stories.tsx
  • Products-targeted integration test file exists and passes:
    • integration-tests/products.router.test.ts

Gate Checklist

Legend: [x] complete, [ ] pending, [~] in-progress

Gate 1: API Contracts

  • Replace listProductsProcedure stub with canonical implementation.
  • Define/confirm product list schema and serialization contract.
  • Add contract/integration tests for products list behavior.

Gate 2: Router + Request Context

  • Products router mounted in root API router.
  • Verify request-context execution path against real products procedure implementation.

Gate 3: Hooks Canonicalization

  • Replace placeholder product mutations with canonical tRPC mutation/query options.
  • Remove local mock persistence behavior from useProducts.
  • Ensure hook types align with canonical model types only.

Gate 4: UI Canonicalization

  • UI component structure present and wired through useProducts.
  • Validate dialogs/actions against real mutation lifecycle and error handling.
  • Confirm no legacy alias imports remain in products UI/hook packages.

Gate 5: Tests + Quality Gates

  • Add products-targeted integration test(s) under integration-tests/.
  • Run package typecheck gate:
    • pnpm tsc --noEmit --project configs/tsconfig.src-packages.json
  • Run workspace typecheck gate:
    • pnpm typecheck
  • Run targeted products integration tests.

Planned Execution Sequence

  1. Implement canonical list procedure for products API.
  2. Wire useProducts to canonical product tRPC endpoints.
  3. Add products integration test coverage (list + one mutation path if available).
  4. Run type/test gates and update cutover matrix status.

Exit Criteria

Products slice is complete when all gates above are checked and matrix status is done.

Result: exit criteria met.