Technical Debt — Category Master Gaps
| Metadata | Details |
|---|---|
| System | product-catalog — Category Master |
| Document ID | TD-2026-PCT-001 |
| Author | Engineering Team |
| Status | Open |
Gaps referenced from SR-024, ADR-00038, and Architecture-00019.
TD-01 — No Re-Parenting Support (Deliberate Limitation, Not Yet Addressed)
Status: Open
Severity: Medium
Affected component: service/category/, transport/api/category/ (PUT /product/admin/api/v1/category/:id)
Evidence: PUT .../category/:id never accepts parent_id or node_level; ADR-00038 named this limitation explicitly when choosing the write-once-ancestors design, on the grounds that no BRD requirement called for it.
Impact: A tenant that mis-places a category when first building its tree (wrong parent, wrong level) has no way to correct it short of deleting (blocked if it has children — see SR-024 FR-10) and recreating the whole subtree.
Remediation direction: If a real tenant need emerges, re-parenting requires a cascading ancestors recomputation for every descendant, not just the moved node — a non-trivial addition to service/category/, to be scoped as its own follow-up ADR rather than retrofitted ad hoc.
Related requirement: SR-024 FR-08
TD-02 — No Lifecycle/Status Model
Status: Open
Severity: Low
Affected component: domain/category.go (active field), service/category/
Evidence: Every category’s active field is hardcoded true with no toggle, unlike Warehouse Master/Package Master’s shared DRAFT/PUBLISHED/ARCHIVED lifecycle (ADR-00037).
Impact: A tenant cannot prepare a new category tree branch out of public view before it’s ready — a category is either fully live or not yet created.
Remediation direction: Out of scope unless a future BRD specifically asks for a staged-publish workflow for categories; tracked here only so the inconsistency with the other two master-data features is visible, not as an action item in itself.
Related requirement: SR-024 FR-11
TD-03 — categoryService.ts Naming-Convention Violation
Status: Open
Severity: Low
Affected component: ui-admin-application/src/features/category/categoryService.ts
Evidence: Every other feature’s service file follows <Feature>Service.ts PascalCase per the Feature Triad convention (ui-admin-application/CLAUDE.md); this file is named in lowercase.
Impact: Cosmetic only — no functional defect, but it’s an inconsistency a future contributor copying this feature as a template would silently propagate.
Remediation direction: Rename to CategoryService.ts and update its one import site.
Related requirement: SR-024 — Composition & Reuse
TD-04 — No DEV_MOCK_* Fallback in CategoryRepository.ts
Status: Open
Severity: Low
Affected component: ui-admin-application/src/features/category/CategoryRepository.ts
Evidence: Unlike other admin features that support a DEV_MOCK_*-gated local fixture fallback for frontend-only development, CategoryRepository.ts has none.
Impact: A frontend-only contributor working on this feature without the backend running has no mock-data path to develop against.
Remediation direction: Add the same DEV_MOCK_* env-gated fallback pattern used elsewhere, if frontend-only iteration on this feature becomes a recurring need.
Related requirement: SR-024 — Client-Side DEV_MOCK Fallback — Absent Here
TD-05 — No Search, Filter, Pagination, or Sort on the Category Console
Status: Open
Severity: Medium
Affected component: CategoryPage.tsx, CategoryController.ts
Evidence: All three LevelSection panels render their full set of nodes with no search box, no filter, no pagination, and no sort control — unlike Warehouse Master’s/Package Master’s list pages.
Impact: A tenant with a large category tree (many roots, many sub-categories under one root) has no way to narrow any panel’s contents — every node must be visually scanned.
Remediation direction: Add a text-search box per panel at minimum; defer pagination/sort until a tenant’s tree size actually warrants it.
Related requirement: SR-024 FR-01
TD-06 — Dead Audit Fields in CategoryResponse
Status: Open
Severity: Low
Affected component: transport/api/category/ (CategoryResponse mapper)
Evidence: categories documents in MongoDB carry description, createdAt, and updatedAt, but no mapper path ever includes them in a response returned to any caller.
Impact: None functionally — the fields are simply invisible to every consumer today. Flagged because a future UI feature (e.g. a “last updated” column) would otherwise require a silent, easy-to-miss mapper fix before the data could be surfaced.
Remediation direction: Add the three fields to CategoryResponse when a consumer first needs them; no action required until then.
Related requirement: SR-024 — Dead Audit Fields in API Response
TD-07 — product-catalog.md’s Data Model Table Missing the categories Collection
Status: Open
Severity: Low
Affected component: 06-microservices/product-catalog.md
Evidence: The service’s own ## Data Model — MongoDB table did not list categories prior to this doc set’s update.
Impact: A reader of product-catalog.md alone would not know the collection exists, despite it being a core, heavily-read collection for both the admin console and the product-setup wizard.
Remediation direction: Resolved in the same change that introduced this Technical Debt doc — see product-catalog’s updated Data Model table.
Related requirement: SR-024 FR-09
TD-08 — Feature’s Own CLAUDE.md Incorrectly Claims Edit Pre-Fill Is Impossible
Status: Open
Severity: Low
Affected component: ui-admin-application/src/features/category/CLAUDE.md (“GET Response Shape” section)
Evidence: That file states “Edit forms cannot pre-fill specTemplate, variantAttributes, or displayOrder… until a GET-by-ID endpoint is available in the backend.” This is stale: CategoryRepository.ts’s fetchCategoryById already calls GET /product/admin/api/v1/category/:id, CategoryController.ts’s openEditDrawer already calls it and stores the result as editingCategory, and all three per-level controllers (CategoryRootLeafController.ts, CategorySubcatsLeafController.ts, CategoryLeafNodesController.ts) already initialize their form state directly from editingCategory.specTemplate/.displayOrder/.variantAttributes. Edit-mode pre-fill of all three fields works correctly today.
Impact: None functionally — this is a documentation defect, not a product one. A future contributor reading the feature’s own CLAUDE.md before touching this code would be misled into thinking a GET-by-ID endpoint still needs to be built, or into re-implementing pre-fill logic that already exists.
Remediation direction: Update the feature’s CLAUDE.md “GET Response Shape” section to state that GET /category/:id already exists and is already consumed by openEditDrawer for full pre-fill; remove the “What to Do Next” item asking for a GET-by-ID endpoint, since it’s already built.
Related requirement: SR-024 FR-12