/* function push that return a message inside the socket connection to the client.
@type : define the type of the event that occured inside the warehouse microservice
@packet : accept the packet as second argument and retriev only the data
function push(type, packet) {
    let msg = { 'type': type != null ? 'results' : 'other',
        'value': type,
        'data': packet.data()
    };
    // emit unique event once the constraints request is done from the couchDB. returning results to client
    if (type === 'found' || type === 'notFound' || type === 'errorConstraints')
        packet.socket.emit('resultsConstraints', msg);
    if (type === 'success' || type === 'errorAddJob' || type === 'curlError')
        packet.socket.emit('addingResponse', msg);
    if (type === 'indexSuccess' || type === 'indexFailed')
        packet.socket.emit('indexationResponse', msg);
}