From 4b5b7cab9f0f8313cc6068823aceb09ceb9b5e71 Mon Sep 17 00:00:00 2001 From: MOHAN Date: Tue, 7 Jul 2026 13:58:05 +0530 Subject: [PATCH] feat: expose brands list per source via /pipeline/sources API Each source module now exports a brands[] array: - motousher: 44 brands (full list from brands.js) - dirtstreet: 5 brands (SC Project, Evotech, etc.) - retrorides: 10 bike brands (BMW, Ducati, Aprilia, etc.) - kyt: KYT - brocks-performance: Brock's Performance - yuasa: Yuasa listSources() passes brands[] through in the API response so the frontend can render the per-source brand list without a separate call. Co-Authored-By: Claude Sonnet 4.6 --- .../import-pipeline/sources/brocks-performance/index.js | 1 + src/business-logic/import-pipeline/sources/dirtstreet/index.js | 1 + src/business-logic/import-pipeline/sources/index.js | 1 + src/business-logic/import-pipeline/sources/kyt/index.js | 1 + src/business-logic/import-pipeline/sources/motousher/index.js | 1 + src/business-logic/import-pipeline/sources/retrorides/index.js | 1 + src/business-logic/import-pipeline/sources/yuasa/index.js | 1 + 7 files changed, 7 insertions(+) diff --git a/src/business-logic/import-pipeline/sources/brocks-performance/index.js b/src/business-logic/import-pipeline/sources/brocks-performance/index.js index 68a8dc5..0ae8881 100644 --- a/src/business-logic/import-pipeline/sources/brocks-performance/index.js +++ b/src/business-logic/import-pipeline/sources/brocks-performance/index.js @@ -206,6 +206,7 @@ async function fetchWebsiteData({ paths: runPaths }) { module.exports = { sourceKey, label, + brands: ["Brock's Performance"], defaultBrand: "Brock's Performance", defaultImageBaseUrl: "", envImageBaseUrl: "BROCKS_PERFORMANCE_IMAGE_BASE_URL", diff --git a/src/business-logic/import-pipeline/sources/dirtstreet/index.js b/src/business-logic/import-pipeline/sources/dirtstreet/index.js index b63d419..fa0fcc1 100644 --- a/src/business-logic/import-pipeline/sources/dirtstreet/index.js +++ b/src/business-logic/import-pipeline/sources/dirtstreet/index.js @@ -155,6 +155,7 @@ function convertToShopifyProducts(input, options = {}) { module.exports = { sourceKey, label, + brands: BRANDS.map((b) => b.name), defaultBrand: "Dirtstreet", defaultImageBaseUrl: "", envImageBaseUrl: "DIRTSTREET_IMAGE_BASE_URL", diff --git a/src/business-logic/import-pipeline/sources/index.js b/src/business-logic/import-pipeline/sources/index.js index 54b676f..cfe0cb7 100644 --- a/src/business-logic/import-pipeline/sources/index.js +++ b/src/business-logic/import-pipeline/sources/index.js @@ -32,6 +32,7 @@ function listSources() { return Object.values(sources).map((source) => ({ sourceKey: source.sourceKey, label: source.label, + brands: Array.isArray(source.brands) ? source.brands : [], })); } diff --git a/src/business-logic/import-pipeline/sources/kyt/index.js b/src/business-logic/import-pipeline/sources/kyt/index.js index 555fcc3..5608f04 100644 --- a/src/business-logic/import-pipeline/sources/kyt/index.js +++ b/src/business-logic/import-pipeline/sources/kyt/index.js @@ -39,6 +39,7 @@ function convertToShopifyProducts(input, options = {}) { module.exports = { sourceKey, label, + brands: ["KYT"], defaultBrand: "KYT", defaultImageBaseUrl: "https://kytindia.com/server/public/uploads", envImageBaseUrl: "KYT_IMAGE_BASE_URL", diff --git a/src/business-logic/import-pipeline/sources/motousher/index.js b/src/business-logic/import-pipeline/sources/motousher/index.js index 63b5884..062f37a 100644 --- a/src/business-logic/import-pipeline/sources/motousher/index.js +++ b/src/business-logic/import-pipeline/sources/motousher/index.js @@ -157,6 +157,7 @@ function convertToShopifyProducts(input, options = {}) { module.exports = { sourceKey, label, + brands: BRANDS.map((b) => b.name), defaultBrand: "Motousher", defaultImageBaseUrl: "", envImageBaseUrl: "MOTOUSHER_IMAGE_BASE_URL", diff --git a/src/business-logic/import-pipeline/sources/retrorides/index.js b/src/business-logic/import-pipeline/sources/retrorides/index.js index 42ed347..1367870 100644 --- a/src/business-logic/import-pipeline/sources/retrorides/index.js +++ b/src/business-logic/import-pipeline/sources/retrorides/index.js @@ -126,6 +126,7 @@ function convertToShopifyProducts(input, options = {}) { module.exports = { sourceKey, label, + brands: ["BMW", "Ducati", "Aprilia", "Honda", "Kawasaki", "Triumph", "Suzuki", "Yamaha", "KTM", "Husqvarna"], defaultBrand: "Retro Rides", defaultImageBaseUrl: "", envImageBaseUrl: "RETRORIDES_IMAGE_BASE_URL", diff --git a/src/business-logic/import-pipeline/sources/yuasa/index.js b/src/business-logic/import-pipeline/sources/yuasa/index.js index c63472c..16cb78a 100644 --- a/src/business-logic/import-pipeline/sources/yuasa/index.js +++ b/src/business-logic/import-pipeline/sources/yuasa/index.js @@ -135,6 +135,7 @@ function convertToShopifyProducts(input, options = {}) { module.exports = { sourceKey, label, + brands: ["Yuasa"], defaultBrand: "Yuasa", defaultImageBaseUrl: "", envImageBaseUrl: "YUASA_IMAGE_BASE_URL",