UIOR-234 added a new setting (persisted in mod-configuration) that specified whether or not approval is required when opening an order. While this is going to be enforced in the UI, it also needs to be enforced in the API.
Also we need to set approvalDate and approvedBy fields either when the order is approved or opened (see below for details.)
When opening an order, check this setting and whether or not the order is approved. If needed return an appropriate error message/code.
if the setting is false and the order is opened, we need to set the approval date to the current date and approvedBy is set to the user's UUID
Upon order approval, approvalDate needs to be set to the current date and approvedBy is set to the user's UUID.
- The approved validation described above is implemented
- Unit tests are updated
- API tests are updated