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.
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.
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.