When saving an order and the orderType field is null, the API should be able to set the appropriate one based on the criteria below:
- Look at Order.concept, and infer the OrderType based on that concept
- Under the hood this should be done by seeing which OrderType the concepts conceptClass is mapped to, if no order type matches the class of the concept, then fail. You will need to add the methods below to OrderService because you will need to use them:
This ticket assumes that the required service methods have been implemented already
If the caller tries to save an order with OrderType specified, we trust this, and do not need to validate it. This ticket only involves inferring an OrderType when none is specified.