More2Life / m2l-server

More2Life App Server
https://m2l-server.herokuapp.com
2 stars 0 forks source link

Square step2 #31

Closed kingbrendann closed 7 years ago

kingbrendann commented 7 years ago

Ok. This should be good to go. Polling for items every hour. I need to properly page those results but I'm going to make that a new issue and do it later.

Once we get the items response back from Square, we loop through the results and asynchronously check and update the listing.

Logic:

if (matchingItemExistsInMongo) {
    if (lastUpdateDate of item in Mongo < lastUpdatedDate of item from Square) {
        update the document in Mongo
} else {
    create new Listing and save it to Mongo
}

Next step is to only request items from Square that have been updated since last poll. I'll make that a separate issue as well.

kingbrendann commented 7 years ago

Oh and I need to update the RAML

kingbrendann commented 7 years ago

Complete

Polling only items updated since last poll: https://github.com/More2Life/m2l-server/issues/33

kingbrendann commented 7 years ago

Complete

Paginate items list response: https://github.com/More2Life/m2l-server/issues/32