When staff approve an order, the order has to be owned by the staff (means anything related to that order has to be done by them.
This means each order must have a nullable field named responsible_staff which is linked to User model. When the approve button is clicked on an order in the staff dashboard, the approve method in the model has to take the current staff and set the responsible_staff field as it.
Also add a new button in edit order page where a staff can own an order. Also the current responsible staff of the order has to be shown in the edit order page.
When staff approve an order, the order has to be owned by the staff (means anything related to that order has to be done by them.
This means each order must have a nullable field named
responsible_staff
which is linked to User model. When the approve button is clicked on an order in the staff dashboard, theapprove
method in the model has to take the current staff and set theresponsible_staff
field as it.Also add a new button in
edit order
page where a staff can own an order. Also the current responsible staff of the order has to be shown in theedit order
page.