Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Added clarifying notes on constants, fixed typo.
Source Link

I need to add a priority column to an orders database to sort them, which will vary depending on what has already been done (actions taken). The other catch is: there are two different roles that will have both shared and exclusive actions so the priority changes depending on who is viewing the order list.

Profile 1
Approve order   - Highest priority
Review options  - Second highest
Processing      - Third highest (shared)
Other actions   - Low priority, no sorting impact

Profile 2
Confirm order   - Highest priority
Processing      - Second highest (shared)
Other actions   - Low priority, no sorting impact

I thought about assigning numeric values to them and adding a total but that will not work since I have separate actions. I've also thought about a numeric string (something along the lines of 554421) which will be changed each time an action is taken. The problem is, it might get messy if in the future more actions are available with different priorities. What would be a better apporachapproach?

UPDATE: The actions' priority scores, along with their name, will be fixed in a constants file. Another condition is, some orders might be going through more than one action at the same time which prevents me from just changing priorities from one digit to the next.

Approve order   5
Review options  4
Confirm order   3
Processing      2

So the same order might be reviewed (4) while pending confirmation(3).

I need to add a priority column to an orders database to sort them, which will vary depending on what has already been done (actions taken). The other catch is: there are two different roles that will have both shared and exclusive actions so the priority changes depending on who is viewing the order list.

Profile 1
Approve order   - Highest priority
Review options  - Second highest
Processing      - Third highest (shared)
Other actions   - Low priority, no sorting impact

Profile 2
Confirm order   - Highest priority
Processing      - Second highest (shared)
Other actions   - Low priority, no sorting impact

I thought about assigning numeric values to them and adding a total but that will not work since I have separate actions. I've also thought about a numeric string (something along the lines of 554421) which will be changed each time an action is taken. The problem is, it might get messy if in the future more actions are available with different priorities. What would be a better apporach?

I need to add a priority column to an orders database to sort them, which will vary depending on what has already been done (actions taken). The other catch is: there are two different roles that will have both shared and exclusive actions so the priority changes depending on who is viewing the order list.

Profile 1
Approve order   - Highest priority
Review options  - Second highest
Processing      - Third highest (shared)
Other actions   - Low priority, no sorting impact

Profile 2
Confirm order   - Highest priority
Processing      - Second highest (shared)
Other actions   - Low priority, no sorting impact

I thought about assigning numeric values to them and adding a total but that will not work since I have separate actions. I've also thought about a numeric string (something along the lines of 554421) which will be changed each time an action is taken. The problem is, it might get messy if in the future more actions are available with different priorities. What would be a better approach?

UPDATE: The actions' priority scores, along with their name, will be fixed in a constants file. Another condition is, some orders might be going through more than one action at the same time which prevents me from just changing priorities from one digit to the next.

Approve order   5
Review options  4
Confirm order   3
Processing      2

So the same order might be reviewed (4) while pending confirmation(3).

Source Link

Data structures - prioritizing records based on pending actions

I need to add a priority column to an orders database to sort them, which will vary depending on what has already been done (actions taken). The other catch is: there are two different roles that will have both shared and exclusive actions so the priority changes depending on who is viewing the order list.

Profile 1
Approve order   - Highest priority
Review options  - Second highest
Processing      - Third highest (shared)
Other actions   - Low priority, no sorting impact

Profile 2
Confirm order   - Highest priority
Processing      - Second highest (shared)
Other actions   - Low priority, no sorting impact

I thought about assigning numeric values to them and adding a total but that will not work since I have separate actions. I've also thought about a numeric string (something along the lines of 554421) which will be changed each time an action is taken. The problem is, it might get messy if in the future more actions are available with different priorities. What would be a better apporach?