I have one project table with projects with the columns start_at (date) end_at(date) pauzed_at (date) etc.
And I want to order the projects, based on date values.
Sorting should be;
- STARTED projects
- PAUZED projects
- IDLE projects
- ENDED projects
project is started when the date is between start_at & end_at.
project is idle when start_at date is not reached.
project is ended when end_at date is reached.
project is paused when paused_at is set etc etc.
How can I sort this table, based on the state of the project?