Function handleNewOrder

  • This function handles the creation of a new order. If the new order is successfully created, it removes the ingredients necessary to complete the order from the warehouse. If one or more ingredients become missing, it sends to all the manager frontends logged a notification. At the end, it sends a message back with the response of the API.

    Parameters

    • promise: Promise<ServiceResponse<Order>>

      returned by the create order API

    • ws: WebSocket
    • managerWs: WebSocket[]

      array of all the manager frontends logged

    • employeeWs: WebSocket[]

      array of all the employee frontends logged

    Returns void