Closed that1guy closed 9 years ago
Side note: we have a really simple ui for all of this.. it's quite brilliant if I say so myself. :)
Updating offers model to look as follows:
{
offerId : 'abc123',
postingId : 'zyx321',
proposals : [{
acceptedAt : '2015-01-31T14:37:00Z',
comment : '',
isOwnerReply : false, // when the owner of the item replies, this should be set to true
price : {
currency : 'USD',
value : '11.00'
},
when : '2015-02-03T10:00:00Z',
where : 'San Francisco Library'
}, {
comment : '$10 is too low',
isOwnerReply : true,
price : {
currency : 'USD',
value : '12.00'
},
when : '2015-02-03T10:00:00Z',
where : 'San Francisco Library'
}, {
comment : '',
isOwnerReply : false,
price : {
currency : 'USD',
value : '10.00'
},
when : '2015-02-03T10:00:00Z',
where : 'San Francisco Library'
}],
username : 'brozeph' // the user who created this offer
}
The ping-pong between the owner of the posting and the user that created the offer will be tracked in the proposals
sub-document collection of the posting. The following fields can be specified for each counter offer:
acceptedAt
- the date/time when the proposal was acceptedisOwnerReply
- denotes a counter proposal from the owner of the postingprice
- the price of the proposalwhere
- the location for pickupwhen
- the time of pickupThe above example shows the following interaction:
brozeph
for the posting with ID zyx321
for $10 to be picked up on 02/03/2015 at 10:00am at the San Francisco Library// POST /v1/postings/zyx321/offers
{
"proposals": [{
"price" : {
"currency" : "USD",
"value" : "10.00"
},
"when" : "2015-02-03T10:00:00Z",
"where" : "San Francisco Library"
}],
"username": "brozeph"
}
zyx321
replies with a counter proposal with an updated price of $12 and a comment about the previous proposal// PUT /v1/postings/zyx321/offers
{
"proposals": [{
"comment" : "$10 is too low",
"isOwnerReply" : true,
"price" : {
"currency" : "USD",
"value" : "12.00"
},
"when" : "2015-02-03T10:00:00Z",
"where" : "San Francisco Library"
}, {
"price" : {
"currency" : "USD",
"value" : "10.00"
},
"when" : "2015-02-03T10:00:00Z",
"where" : "San Francisco Library"
}]
}
brozeph
responds with a counter-counter-proposal with an updated price of $11// PUT /v1/postings/zyx321/offers/abc123
{
"proposals": [{
"price" : {
"currency" : "USD",
"value" : "11.00"
},
"when" : "2015-02-03T10:00:00Z",
"where" : "San Francisco Library"
}, {
"comment" : "$10 is too low",
"isOwnerReply" : true,
"price" : {
"currency" : "USD",
"value" : "12.00"
},
"when" : "2015-02-03T10:00:00Z",
"where" : "San Francisco Library"
}, {
"price" : {
"currency" : "USD",
"value" : "10.00"
},
"when" : "2015-02-03T10:00:00Z",
"where" : "San Francisco Library"
}]
}
zyx321
accepts the counter-counter-prosal from brozeph
// POST /v1/postings/zyx321/offers/abc123/accept
{
"price" : {
"currency" : "USD",
"value" : "11.00"
},
"when" : "2015-02-03T10:00:00Z",
"where" : "San Francisco Library"
}
The acceptance of a proposal is dependent upon the flag field isOwnerReply
. In the event that the isOwnerReply
value is true, then the user who created the offer is the one that can accept.
Ok, this now exists in a branch named rework-offers
:
git pull
git checkout rework-offers
NODE_ENV=local npm start
If you are testing the realtime-svc
in conjunction with these changes, you will also need to checkout the rework-offers
branch that exists in the realtime-svc
as well.
Assigning to @that1guy for validation and feedback
FYI, corrected small error in /lib/model/message.js in realtime-svc. :)
https://github.com/HashtagSell/realtime-svc/commit/25bf1c040ea588d8f04661cfc9bc69777979ae41
FYI. Added socket.io emit for EVENT_UPDATED_OFFER.
https://github.com/HashtagSell/posting-api/commit/649250860a3a126d23be3023416ed5515045d599
https://github.com/HashtagSell/realtime-svc/commit/b2a7e0f3bce88d269063c08bc07d687bbc6c35ff
Awesome! We've met requirements here and implementation is running in staging ENV.
Josh, among all the feedback we've received we've learned that we need to perfect the communication between the buyer and seller as they send their offers and schedule a meeting. We believe this is one of the largest things holding us back from creating ideal user experience and opening app to public. Therefore we ebay 360 code should be put on hold, and this is our focus.
When we launch users should be able to push to personal FB, Twitter, Ebay and search/buy internal hashtagsell items for free with Venmo (I've integrated Venmo payments into htsApp and commented out braintree, so all payments are free). So we just need to perfect buyer/seller communication then open to public.
Here's the new user experience we're building:
See the requests below as I try to walk us through the workflow.
Buyer proposes the price and pickup location. UI POSTs this deal request to posting api.
Socket.io emits this object to the posts room. UI will sort by timestamp and notify seller of proposed deal.
Seller accepts the buyers proposed price, location, and pickup proposal. UI POSTs this object to API.
Socket.io emits object in posting room with original proposal from buyer AND acceptance from seller. The UI will sort by timestamp and notify buyer their deal was accepted.
Buyer proposes one or more meeting times that works for them. UI posts this object to API.
Socket.io emits meeting request in the postings room. This emit object should have the original proposal from buyer AND deal acceptance from seller AND proposal for meeting time from buyer. The UI will sort by timestamp.
Sellers accepts one of the proposed times. UI POSTs this object to API.
Socket.io emits object in postings room with original proposal from buyer AND acceptance from seller AND proposal for meeting time AND acceptance from seller for meeting time. The UI will sort by timestamp.
If the UI performs a GET request to get all offers associated with a post it should get this response. /v1/postings/{postingId}/offers/{?start,count,filters,sort}