http://ws.manoexperta.com/

This is the general endpoint where you can connect to websocket messages, it is powered by SocketIO and the channel(s) to which you must subscribe your users can be found in an array under meProfile.channels


We will describe messages from a backend perspective so that you can manage frontend to your convenience. Following is a list of all the messages, and the payload that the backend generates, that should be caught and parsed by the application to take corresponding action.


It is very important that the app filters messages that are applicable to the user, please review eligibility rules to determine this. Also it is very important that when applicable, an alert/toast message precedes the change of screen/view so that end-user is aware of the changes.


PathPayloadDescriptionAction Needed
channel
/$channel
/new
{"location" : {"lat" : $latitude, "lng" : $longitude}, "description" : "$description", "img" : ["img1","img2"], "catId" : $catId, "exclusive" : $exclusive, "blockedXP" :[], "reqType" : $reqType} New Request
When a client posts a new request, located in ($lat$lng) for experts working in category ($catid), the full description ($description), even an image ($img), an array of blocked experts ($blockedXP) and a bool flag ($exclusive) to determine if it's open for all or only partner-related workers. Use ($reqType) to determine how to handle UX "N" normal or "I" Inquiry.
Worker App must filter to determine eligibility and if true, then add as a new option in job opportunities view.

Client App moves to "waiting" until an expert applies or client cancels.
target
/$clientid
/apply
{"expertID" : $workerid, "reqId" : $reqId}Worker Applies/Accepts
Triggered when an expert ($worker.userid) applies to an open project ($reqid) posted by Client ($client.userid)
UI for both refreshes to Work in Progress after fetching Request details
channel
/$channel
/delete
{"reqId" : $reqID}Client Cancel New
When a client cancels a Request $reqID that is still pending acceptance by a worker
The request should "disappear" as an option from any workers app.

The Client UI should go back Home to post a new request or move to active Request if request was assigned to expert.
target
/$clientid
/complete
{"reqId" : $reqID}Worker notifies Completion
When a worker finishes a job ($reqid) successfully and wants to alert the client ($client.userid) that he is disengaging from active job
Worker app is sent back to home under listening mode (activeReq=0)

Client App remains on active request until client himself finishes request.
target
/$workerid
/complete
{"reqId" : $reqID}

Client notifies Completion
When a client considers a job ($reqid) successfully finished and wants to alert the worker ($worker.userid) that he is disengaging from active job
Worker app remains on active request until worker himself finishes.

Client App is sent back to home to define new requests (activeReq=0)
target
/$clientID
/pay-success
{"reqId" : $reqID}Client succesfully Funds Job
Client ($client.userid) Successfully Funds the account for payment related to ($reqid)
Worker does not participate in this flow. This message is triggered when a callback from the payment processor acknowledges payment, so the web view in which the client is acting needs to be redirected to payments Home Screen with message.
target
/$clientID
/pay-fail
{"reqId" : $reqID}
Client's funding attempt failed
Client's ($client.userid) Funding attempt Failed, it was rejected by processor for payment related to ($reqid)
Worker does not participate in this flow. This message is triggered when a callback from the payment processor acknowledges failed transaction, so the web view in which the client is acting needs to be redirected to payments Home Screen with message so Customer can try again.
channel
/$channel
/inquiry
same payload as new request but $inqId replaces $reqIdClient requests quotes
Before hiring, client needs to chat with experts that place bids on this request (now called inquiry $inqid)
Worker sees this is a new Job, but instead of having an apply button a quote button is shown to complete the bid (NEW FLOW)

After Client requests quotes he is sent to the view (that can also be accessed from sidemenu), where all inquiries and bids are seen.
target
/$clientID*
/bid-new

(* needs revision)
{"inqID": $inqid, "bidAmount", $bidAmount}Workers places/updates bid
An expert places a bid for Inquiry ($inqid)
After Worker places bid he is taken to Inquiries (sidemenu) so he can chat with client.

Client is notified of the new Bid but there is no automatic screen refresh.
/target
/$expertID
/hire
{"reqID" : $reqid}Client Hires Worker Directly
A Client hires ($expert.userid) directly for requests ($reqid).
Worker needs to be available for direct hire, so activeReq will be updated and this will update HomeView.

Client will be redirected to Active Work aswell.