I am presenting my users with a table that displays some columns of the database.
I have editable status field that I want the users to be able to update. The status field can be "Active", "New", "In-Progress", "Completed" ..etc
For each of these statuses, we have a selected on datetime field in the database, for example "status_active_selected_on", "status_new_selected_on" and so on.
When the user selects a status, I want to update the status in the database and set/update the status selected on field accordingly. For example, If they selected "In-Progress", I wanna update the "status" field to "In-Progress", as well as set the current date as the value of "status_in_progress_selected_on" and so on. Updating the status is not the issue, updating the "status_selected_on" is.
The list of the statuses is longer than what I provided in this example, about 13 statuses, so 13 "status_{status}_selected_on". And since we can't write raw SQL queries to write to the database, what is the easiest way to do this?
Thanks!