• Service functionality to update a specific existing order to a new state.

    Parameters

    Returns Promise<ServiceResponse<Order>>

    a Promise with the ServiceResponse containing the updated order data and the message returned by the repository. If the update is not correct due to domain restrictions the message is CHANGE_STATE_NOT_VALID and the data undefined. It checks with the repository if the order exists, if not returns the repository response. Otherwise it updates the order through the repository and returns the repository response.