feat: expose file attachment stats as item properties #54

Merged
forbes merged 1 commits from issue-37-file-stats into main 2026-02-09 01:26:18 +00:00
Owner

Closes #37

Surfaces file attachment statistics in item API responses and the item table UI.

Changes

Backend (3 files):

  • BatchGetFileStats() in audit_queries.go — batch query on item_files table (same pattern as BatchCheckBOM)
  • file_count and files_total_size added to ItemResponse in handlers.go
  • Injected into HandleListItems, HandleGetItem, and HandleGetItemByUUID
  • has_files computed field added to audit completeness scoring (weight 1 for manufactured items)

Frontend (2 files):

  • file_count and files_total_size added to Item interface in types.ts
  • "Files" column added to ItemTable — shows count (or —), hover tooltip shows total size
  • Default visible in vertical layout, hidden in horizontal

No migration needed — stats are computed from existing item_files table.

Closes #37 Surfaces file attachment statistics in item API responses and the item table UI. ### Changes **Backend (3 files):** - `BatchGetFileStats()` in `audit_queries.go` — batch query on `item_files` table (same pattern as `BatchCheckBOM`) - `file_count` and `files_total_size` added to `ItemResponse` in `handlers.go` - Injected into `HandleListItems`, `HandleGetItem`, and `HandleGetItemByUUID` - `has_files` computed field added to audit completeness scoring (weight 1 for manufactured items) **Frontend (2 files):** - `file_count` and `files_total_size` added to `Item` interface in `types.ts` - "Files" column added to `ItemTable` — shows count (or —), hover tooltip shows total size - Default visible in vertical layout, hidden in horizontal No migration needed — stats are computed from existing `item_files` table.
forbes added 1 commit 2026-02-09 01:26:00 +00:00
Add file_count and files_total_size to item API responses, computed
via batch query on item_files table (no migration needed).

- Add BatchGetFileStats() to audit_queries.go (follows BatchCheckBOM pattern)
- Add file stats to ItemResponse, HandleListItems, HandleGetItem, HandleGetItemByUUID
- Add 'Files' column to ItemTable (default visible in vertical mode)
- Add has_files computed field to audit completeness scoring (weight 1 for manufactured)
forbes merged commit 8d88f77ff6 into main 2026-02-09 01:26:18 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo#54