Skip to content

Item Management ## Business Purpose Provide authenticated users with the ability to create, view, update, and delete items, with role-based access control. ## Current Behaviors - Create Item: The AddItem component allows users to add a new item via form; data is posted to API AddItem.tsx:56.

  • Read Items: The Items route fetches and displays a list of items in a data table with sorting and pagination items.tsx:12.
  • Update Item: EditItem opens a pre-filled form to modify an existing item EditItem.tsx:61.
  • Delete Item: DeleteItem prompts for confirmation and removes an item DeleteItem.tsx:33.
  • Actions Menu: ItemActionsMenu provides dropdown actions for each item ItemActionsMenu.tsx:18.
  • Column Definitions: Columns are defined in columns.tsx with custom cell renderers columns.tsx:10.
  • Permissions: Only superusers can create/update/delete; normal users can read test_items.py:55. ## Technical Implementation - Frontend Routes: Items page at _layout/items.tsx:12-56 with data fetching via getItemsQueryOptions.
  • API SDK: readItems, createItem, updateItem, deleteItem sdk.gen.ts:18.
  • Backend Endpoints: Routes in items.py with CRUD using crud.py:63 for item creation.
  • Data Table: DataTable.tsx:37-125 with pagination and sorting; uses shared DataTable component.
  • Testing: Backend tests in test_items.py cover all CRUD operations with permission checks.
  • E2E Tests: items.spec.ts covers creating, editing, deleting items through the UI. ## Definition of Done - Creating an item adds it to the list and shows a success toast items.spec.ts:32.
  • Editing an item updates its values in the table items.spec.ts:50.
  • Deleting an item removes it from the list items.spec.ts:80.
  • Non-superusers see read-only items and cannot access create/edit/delete options test_items.py:55.
  • Pagination works and displays correct number of items per page items.spec.ts:103.