a2n-seattle / a2n-seattle/rms-app
Add item/sub-item CRUD: create, delete, edit attributes, with default sub-item friendly-name scheme
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 1
- Avg merge
- 27m
- Merged PRs (30d)
- 4
Description
# Why?
**As a** user managing inventory
**I want** to add and delete items and sub-items, and edit their attributes, directly from the web frontend
**So that** inventory management doesn't require going around the frontend (e.g. direct DynamoDB edits) for basic CRUD.
# What?
There is currently no frontend mechanism to add or delete items/sub-items, nor to edit an item's or sub-item's attributes. Add:
**Items (`MainSchema`):**
- A pencil/edit icon next to the item's attribute display (resource detail page) opening an edit form for its attributes (`displayName`, `description`, `location`, `tags`, etc. — see `ts-code/src/db/Schemas.ts`), backed by an `UpdateItem`-style API if one doesn't already exist (check `ts-code/src/api/` — `AddItem`/`UpdateTags` exist; a general item-attribute update may not).
- A create-item flow (new resource) and a delete-item flow, wired to existing `AddItem`/`DeleteItem` APIs.
**Sub-items (`ItemsSchema`):**
- A pencil icon on the right side of each sub-item row in the resource detail page's sub-item table, opening an edit form. Include a **friendly name** field for the sub-item (`ItemsSchema.friendlyName` already exists in the schema).
- **Default friendly-name scheme**: if a sub-item has no friendly name set, its default display should be the parent item's name with an appended, auto-incrementing number (e.g. "Chair 1", "Chair 2", ...) rather than showing nothing/the raw id. Clarify during triage whether this default should be computed at sub-item-creation time (stored) or purely at render time (derived, e.g. from the sub-item's position/index within the parent item's `items[]` list) — the latter avoids needing a backend change but can shift numbering if sub-items are deleted out of order, which may or may not be acceptable.
- Add/delete flows for sub-items within a parent item.
# Testing
Unit tests for any new/changed API (`ts-code/__tests__/unit/api/`). Jest/RTL for the edit forms. Playwright e2e covering: create an item, add sub-items (confirming default friendly-name numbering), edit an item's attributes, edit a sub-item's friendly name, delete a sub-item, delete an item.
# Additional context
This is a meaningful chunk of new backend + frontend work (likely warrants its own implementation plan/triage pass to scope the exact API surface needed) rather than a small tweak — flagging that up front so triage can size it accordingly.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.