Partner Inventory Crawler

Goal

  • Keep our product availability in sync with partner’s site so items sold on partner side are immediately set to sold out on our shop.

  • Minimize overselling, manual checks, and customer disappointment.

As a Saclàb salesperson
I want partner-sold items to be automatically set to sold out on our shop
So that customers never purchase items that are already unavailable

Scenario: Admin sees crawl enable option on airtable
Given the admin is on Airtable in the Partners table
When the admin views a partner record
Then the partner record shows a field "Crawl Enabled"
And the admin can toggle it on or off

And the admin can specify where the crawl should be happening (e.g https://houlux.com/nouveautes/)

Scenario: Admin enables crawl for a partner
Given the admin is on Airtable in the Partners table
And the partner record has the field "Crawl Enabled" set to false
When the admin sets "Crawl Enabled" to true
Then the crawler includes this partner in its next run
And all bags linked to this partner are checked for availability

Scenario: Admin disables crawl for a partner
Given the admin is on Airtable in the Partners table
And the partner record has the field "Crawl Enabled" set to true
When the admin sets "Crawl Enabled" to false
Then the crawler excludes this partner in its next run
And no bags linked to this partner are checked for availability

Scenario: Partner item sold out flips ours to sold out
Given an active partner-mapped item
And the partner availability is in_stock
When the crawler detects partner availability as sold_out twice in a row (3 minutes between crawls)
Then our item availability is updated to sold_out

Scenario: Partner page removed
Given an active partner-mapped item
When the crawler receives HTTP 404 or 410 for the partner URL
Then our item availability is updated to sold_out immediately

Scenario: Temporary glitch does not flip
Given an active partner-mapped item
When the crawler detects partner availability as sold_out once
And the next check returns in_stock
Then our item remains in_stock
And an alert is recorded for flapping

Scenario: Reserved treated as sold out
Given partner status is reserved
And the partner’s status mapping treats reserved as sold_out
When the crawler runs
Then our item becomes sold_out

Comments

Leave a Reply