3.3 KiB
Work Order: Update Item Creation and Edit to Full API Compliance
METADATA
- FEATURE_NAME: Item Creation and Edit Screen Enhancement
- REQUESTED_BY: user
- TIMESTAMP: 2025-09-25T07:15:00Z
OVERVIEW
This work order outlines the steps required to update the Item creation and editing functionality in the Homebox Lens mobile application to fully comply with the Homebox API specification. This includes enhancing the UI to capture all required fields and updating the ViewModel to correctly map these fields to the domain models.
REQUIREMENTS GAPS
Current implementation in app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditScreen.kt and app/src/main/java/com/homebox/lens/ui/screen/itemedit/ItemEditViewModel.kt only handles a subset of the fields defined in tech_spec/api_summary.md.
Missing UI fields for Item:
assetIdnotesserialNumbervaluepurchasePricepurchaseDatewarrantyUntilparentId
Missing ViewModel mappings:
- All the above fields are hardcoded to
nullinItemCreateandItemUpdateobjects.
STEPS
STEP 1: Enhance UI Layer (ItemEditScreen.kt)
Description
Update the ItemEditScreen composable to include input fields for all missing item properties.
Action
- Add
TextFieldor appropriate input components forassetId,notes,serialNumber,value,purchasePrice. - Add
DatePickercomponents forpurchaseDateandwarrantyUntil. - Add
TextFieldforparentId. - Implement a multi-select component for
labelIdsto allow selecting multiple labels from a list. - Ensure
locationIdselection is properly implemented (verify existing functionality).
STEP 2: Update ViewModel Layer (ItemEditViewModel.kt)
Description
Update ItemEditViewModel to handle the new UI fields and correctly map them to domain models.
Action
- Update
ItemEditUiStatesealed interface or data class to include all new fields from STEP 1. - Add corresponding handler functions like
onAssetIdChanged,onNotesChanged, etc., to update the UI state. - Modify
createItemandupdateItemfunctions to properly map all fields fromuiStatetoItemCreateandItemUpdatedomain models instead of hardcoding them tonull.
STEP 3: Integrate QR Scanner with Item Creation
Description
Modify the QR scanner feature to automatically populate the assetId field when navigating to the item creation screen.
Action
- Update
ScanScreento navigate toItemEditScreenwith the scanned barcode as pre-filledassetId. - Add navigation logic in
ScanViewModelto handle the transition. - Ensure
ItemEditScreencan receive and use this pre-filled value.
STEP 4: Update Project Manifest
Description
Update tech_spec/PROJECT_MANIFEST.xml to reflect the changes in item creation/editing functionality.
Action
- Add a new
<FEATURE>entry for "Item Creation and Edit Enhancement" or update the existing one if it already covers item creation. - Include all relevant components, classes, and properties in the manifest.
STEP 5: Create Engineer Task
Description
Create a task for the engineer to implement the outlined changes.
Action
- Save this work order to a file in the
tasksdirectory. - Switch to Engineer and provide this work order as a task.