Marketplaces / ZZZ Obsolete ones / Tesco UK / Logic for Inventory cron

Logic for Inventory cron

Sending feed:

  1. Collect all items which have update_quantity = 'pending' OR end_item = 1
  2. Send them to Tesco AND update all of them with update_quantity = 'sent'
  3. Save data in marketplace_feed
  4. In marketplace_feed_object one row for each item
    1. for those with end_item = 1 => set end_item = 1 (in marketplace_feed_object)
    2. for the others set end_item = 0 (in marketplace_feed_object)

For errors during checks for the items (before adding them to the feed) :

a. Save them in ending_error if item_account.end_item = 1 + set end_item = 0

b. Save them in update_quantity_error if item_account.end_item = 0 + set update_quantity = error

Reading the response:

Errors:

  1. If marketplace_feed_object.end_item = 1 AND if update_quantity = 'sent'
    1. Save the error in ia.ending_error
    2. Set ia.end_item = 0
    3. ia.update_quantity = normal
  2. If marketplace_feed_object.end_item = 0 AND if update_quantity = 'sent'
    1. Save the error in ia.update_quantity_error
    2. Set ia.update_quantity = 'error'

Successes:

  1. If marketplace_feed_object.end_item = 1
    1. set ia.update_quantity = 'normal'
    2. set ia.end_item = 0
    3. set iat.deactivate_item = 1
  2. If marketplace_feed_object.end_item = 0 AND if update_quantity = 'sent'
    1. set update_quantity = 'normal'
    2. if qty >0 => listingStatus = 'active'
    3. if qty = 0 set iat.deactivate_item = 1
Is this article helpful?
0 0 0