I’m developing this really important squirrel application.
There is a wizard where squirrels are added to the database.
So say there are three screens to this wizard:
1.Squirrel name details
2.Height and weight
3.Nut storage
What I’m wanting to do is save the results of the wizard when all details have been added at step 3.
The users however are wanting this “Save to continue later” button. So on screens 1 and 2 they want to be able to save the data they’ve entered so far and come back and complete it later.
The problem with this is the squirrels height and weight are mandatory field so I would have to make them nullable in the database to be able to save at step 1.
What would be the best way of dealing with this?
I could:
- Make the fields nullable and have something like a pending
completion flag on the squirrel table in the database.
Not such a big fan of this it seems to go against best practises.
- Somehow store the incomplete squirrels somewhere else until they are
fully complete and ready to be saved to the database.
Not sure of where the incomplete squirrels could be stored.
There’s bound to be other options too.
Anyone have any good suggestions?
The isValidated flag in the database seems a good approach. You could enrich the record at each step adding more and more columns and at the last step when the user finishes the wizard set the flag to true to indicate that the user has finished editing this record. The width and height columns might indeed have to be made nullable in the database because until the transaction is fully complete, they can contain null values.