1.0 {timestamp} [ARCHITECT -> DEV] Refactor Item Edit Screen This work order instructs the developer agent to refactor the Item Edit screen to include all available API fields and implement a user-friendly, grouped layout. agent-developer type::refactoring,feature::item-edit,status::pending The primary goal is to refactor the `ItemEditScreen` to include all available fields from the Homebox API for creating and updating items, and to present them in a user-friendly manner. Modify `domain/src/main/java/com/homebox/lens/domain/model/Item.kt`.
- Add the following fields to the `Item` data class: - `archived: Boolean` - `assetId: String?` - `fields: List` - `insured: Boolean` - `lifetimeWarranty: Boolean` - `manufacturer: String?` - `modelNumber: String?` - `notes: String?` - `parentId: String?` - `purchaseFrom: String?` - `purchaseTime: String?` - `serialNumber: String?` - `soldNotes: String?` - `soldPrice: Double?` - `soldTime: String?` - `soldTo: String?` - `syncChildItemsLocations: Boolean` - `warrantyDetails: String?` - `warrantyExpires: String?` - Rename the existing `value: BigDecimal?` field to `purchasePrice: Double?`.
Update database entity, DTOs, and mappers.
- Modify `data/src/main/java/com/homebox/lens/data/db/entity/ItemEntity.kt` to reflect the new `Item` model. - Ensure `ItemCreateDto`, `ItemUpdateDto`, and `ItemOutDto` contain all necessary fields according to the API spec. - Update the mapping functions in `data/src/main/java/com/homebox/lens/data/db/entity/Mapper.kt` to handle all new fields correctly across all layers.
Modify `app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditViewModel.kt`.
- Update `loadItem` and `saveItem` to handle the state for all new fields. - Add public functions to update the state for each new field (e.g., `updateManufacturer(String)`, `toggleInsured(Boolean)`).
Refactor `app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditScreen.kt`.
- Implement a user-friendly layout using tabs or expandable cards for the following groups: General, Purchase, Warranty, Identification, Status & Notes. - Use appropriate controls for each field type (e.g., `Switch` for booleans, Date Picker for dates). - Connect all UI controls to the ViewModel. - Implement basic input validation.
The application compiles successfully. The Item Edit screen displays all new fields, grouped logically. Creating a new item with all fields populated works correctly. Editing an existing item and modifying the new fields works correctly. Data is persisted correctly and is visible in the Item Details screen after saving. ]]>