I would like to seek for your help regarding my certain use case on the following.
The following UI below allows the user to toggle the status of an auto-archiving job, and the days before data will be archived.
The business rule is simple. Once I activated the auto-archive toggle button, I must specify the days before the data is archived. Rule is that the days must not be below 3 days and above 30 days (3-30 days only is allowed).
Currently, I can handle the provided business rule with validations. Now, here's a use case of my concern:
On preparation, I have the following state:
- Toggle is ON.
- Days is for example, 5 days (taken from database).
The user changes the days into 2 days, and suddenly turned OFF the flag (not yet submitting the form). Then he clicked the Save button (which proceeds with the submission process).
Currently, the data is not saved because of failure to the # of days required, and the system doesn't prompt anything.
The question is that... if I were to turn off the toggle, should I:
Have already kept the original value to a hidden field and when such case occurs, the system will revert back to the original data, or
Should I set the days field to the default minimum value of days, which is 3 based on the business rule provided.
Thank you and hoping for feedbacks regarding my concern.