# CAT-2633: Investigate required changes to scraper 'leadTime' parameter
## Summary
We want to be able to collect manufacturer/factory lead times for products and save them to part information. The first proposed solution for this was to save the leadTime parameter from the scraper. However, the value is used to mean 'lead time to Sourceability' which can mean something else other than 'lead time from the Manufacturer to Sourceability' since we are talking about distributors.
I recommend that we add a new parameter from the scraper, manufacturerLeadTime or factoryLeadTime, which is specific for this purpose. Only three scrapers have this information at the moment, Digikey, Future Electronics, and TrustedParts. Then we can continue to use the leadTime parameter as lead time to Sourceability and not interfere with our working processes.
This results in the following changes to the 'Add Lead Time to Datalynq' epic:
1) CAT-2510: Store lead time from Digikey scraper - This can change to a task which will capture this new field, manufacturerLeadTime, from the scraper and store it as the task originally intended. This will capture the new value for all scrapers which add it to their response. All of this work is on the PIM side.
2) CAT-2527: Update Future Electronics scraper to store lead time - This can pretty much stay the same. The task is to capture the factory lead time field and return it in the new field. All of the work is on the scraper side.
3) CAT-2526 - Update ICBase scraper to store lead time - I did not see lead time anywhere on this site. Unless I was wrong, this can go to Will Not Fix.
4) CAT-2509 - Store lead time returned from TTI API calls - We can keep this as long as the value we are getting from them is manufacturer/factory lead time. All of this work is on the PIM side.
5) CAT-2528 - Allied does not have manufacturer/factory lead time on their website at all. They just have stock offers and lead time offers from partner warehouses. This can go to Will Not Fix.
6) We need a new task to adjust the Digikey scraper to grab the Manufacturer Standard Lead Time field and return it in the new parameter. This is scraper side work.
7) We need a new task to adjust the TrustedParts spider to grab the Factory Lead Time and return it in the new parameter. This is scraper side work.
## How are we using leadTime?
Currently, we use the leadTime parameter from the scraper as meaning 'lead time to Sourceability'. From the scraped sources this can mean one of three things:
1) The time it will take them to ship an item which is in stock.
2) The time it will take them to ship an item which needs to be transferred from another warehouse or partner.
3) The time it will take them to ship an item which needs to be sourced from the manufacturer.
## How do we want to use leadTime?
We want to store Manufacturer Lead Time, which is only one of the three cases we use the leadTime parameter for now. Based on how the scrapers put data into that parameter, it is not possible to know which of the three cases it is. Also, if the scraped site has both lead time from the distributor and lead time from the manufacturer, we will use the lead time from the distributor because that is what we need for selling the product. This means we cannot capture the manufacturer lead time in this case.
## What can we do to capture manufacturer lead time?
I recommend that we add a new parameter from the scraper, manufacturerLeadTime or factoryLeadTime, which is specific for this purpose. Only three scrapers have this information at the moment, Digikey, Future Electronics, and TrustedParts. Then we can continue to use the leadTime parameter as lead time to Sourceability and not interfere with our working processes.
## How does each scraper handle leadTime?
### Allied
leadTime is 0 for stock offers and non-zero for lead_time offers. The lead_time offers that they have are not lead times from the manufacturer, but from another warehouse/partner, it seems. Usually it is listed as a quantity that 'Can ship in 10 days'.
For example: https://www.alliedelec.com/product/bourns/smaj24a/70410807/
### Digikey
leadTime is 0 for stock offers and non-zero for lead_time offers. They list a Manufacturer Standard Lead Time on all (or at least most) products.

### Ecco
leadTime is 3-4 days for stock offers and non-zero for non-stock offers. It appears that the lead time that they list is from the manufacturer, but that is not explicitly said.
### Findchips
We do not extract leadTime. I don't see it available on the website.
### Future Electronics
leadTime is only extracted for leadTime offers. They have an explicit 'Factory Lead Time' field which could be extracted.

### ICBase
We do not extract leadTime. I don't see it available on the website in any form.
### WPG
leadTime is given for all offers in days; none are zero. It doesn't look like lead_time offers can be returned from this scraper. I don't see Manufacturer Standard Lead Time available on the website, just delivery days.
### Trusted Parts
We do not extract lead time for this spider yet. They have an explicit 'Factory Lead Time' field which could be extracted.
