Error when adding CCE item for field that cannot be updated
When adding a new CCE item "Solar with battery", I am not able to save the new item. I receive an error message that "CCE Inventory Item must have voltage stabilizer field", but when I try to add that to the item, the radio buttons are unselectable.
Summary: Change the logic to say that instead of making those required fields unselectable for solar, that we pre-fill with the "Not applicable" options so that the user doesn't need to manually fill them but that the requirement for having those fields filled is still met.
When selecting "Solar with battery" as equipment type, automatically select "Not Applicable" for Voltage Stabilizer, Voltage Regulator and Backup Generator in the UI for the user
All three fields mentioned above (Voltage Stabilizer, Voltage Regulator and Backup Generator) should not be editable by the user while equipment type is "Solar with battery"
When a different equipment type is selected, make those fields editable again, but the selections do not have to change
I checked, and everything works correctly.
please summarize our decisions here into Acceptance Criteria in the ticket description so this ticket is ready to work on.
I prefer option #2, as it makes it easier for the user (they don't have to select these things that don't apply to them), and it only requires a change in the UI.
This is likely because we put logic in place to have certain fields be unselectable for Solar devices. Since the solar device is not powered by outlet power, it doesn't have a need for a voltage stabilizer or backup generator. However, we also made these fields required for all devices.
I think the simplest way to resolve this is to remove the logic around Solar-type devices where the voltage stabilizer and backup generator fields are made unselectable.
Alternatively, we could change the logic to say that instead of making those fields unselectable for solar, that we pre-fill the "Not applicable" options so that the user doesn't need to manually fill them but that the requirement for having those fields filled is still met.
The issue appears to be connected only with the "Voltage Stabilizer" field. When the "Solar" type is chosen, also the "Voltage Regulator" and "Backup Generator" fields are blocked but since they aren't mentioned in the error message, I suppose there is no issue with them (especially since when other types of equipment are chosen, they are required).