Problem
extractAmazonProduct() and extractWalmartProduct() in utils/productExtractor.ts have identical structure but different selectors. This makes:
- Adding new marketplaces require duplicating ~50 lines of code
- Selector updates need changes in multiple places
- Hard to maintain and test
Solution
Use a configuration-driven approach with marketplace configs and generic extraction functions.
See full implementation in the original review document.
Benefits
- Eliminates ~100 lines of duplicate code
- Adding new marketplace = just add config object
- Easier to test and maintain
- Centralized selector management
Priority
High
Problem
extractAmazonProduct()andextractWalmartProduct()inutils/productExtractor.tshave identical structure but different selectors. This makes:Solution
Use a configuration-driven approach with marketplace configs and generic extraction functions.
See full implementation in the original review document.
Benefits
Priority
High