From e552c9102dd9801dcfc35652f2aaa0b1eea18ebb Mon Sep 17 00:00:00 2001 From: Chris Mendoza <300530+chrismendoza@users.noreply.github.com> Date: Sun, 22 Nov 2020 10:57:05 -0600 Subject: [PATCH] feat(store): add corsair sfx PSUs (#881) --- src/config.ts | 1 + src/store/model/amazon.ts | 16 ++++++++++++++++ src/store/model/bandh.ts | 14 ++++++++++++++ src/store/model/bestbuy.ts | 16 ++++++++++++++++ src/store/model/corsair.ts | 38 ++++++++++++++++++++++++++++++++++++++ src/store/model/index.ts | 2 ++ src/store/model/store.ts | 4 ++++ 7 files changed, 91 insertions(+) create mode 100644 src/store/model/corsair.ts diff --git a/src/config.ts b/src/config.ts index d3f683e430..b9c1a223e3 100644 --- a/src/config.ts +++ b/src/config.ts @@ -316,6 +316,7 @@ const store = { ryzen5800: envOrNumber(process.env.MAX_PRICE_SERIES_RYZEN5800), ryzen5900: envOrNumber(process.env.MAX_PRICE_SERIES_RYZEN5900), ryzen5950: envOrNumber(process.env.MAX_PRICE_SERIES_RYZEN5950), + sf: envOrNumber(process.env.MAX_PRICE_SERIES_CORSAIR_SF), sonyps5c: -1, sonyps5de: -1, 'test:series': -1, diff --git a/src/store/model/amazon.ts b/src/store/model/amazon.ts index c15d18eb85..c76a9a24fe 100644 --- a/src/store/model/amazon.ts +++ b/src/store/model/amazon.ts @@ -491,6 +491,22 @@ export const Amazon: Store = { model: 'xbox series s', series: 'xboxss', url: 'https://www.amazon.com/dp/B08G9J44ZN' + }, + { + brand: 'corsair', + cartUrl: + 'https://www.amazon.com/gp/aws/cart/add.html?ASIN.1=B07M63H81H&Quantity.1=1', + model: '750 platinum', + series: 'sf', + url: 'https://www.amazon.com/dp/B07M63H81H' + }, + { + brand: 'corsair', + cartUrl: + 'https://www.amazon.com/gp/aws/cart/add.html?ASIN.1=B07F84FJ1G&Quantity.1=1', + model: '600 platinum', + series: 'sf', + url: 'https://www.amazon.com/dp/B07F84FJ1G' } ], name: 'amazon' diff --git a/src/store/model/bandh.ts b/src/store/model/bandh.ts index de10534c06..eb1c6cc56c 100644 --- a/src/store/model/bandh.ts +++ b/src/store/model/bandh.ts @@ -187,6 +187,20 @@ export const BAndH: Store = { series: 'ryzen5600', url: 'https://www.bhphotovideo.com/c/product/1598377-REG/amd_100_100000065box_ryzen_5_5600x_3_7.html' + }, + { + brand: 'amd', + model: '5600x', + series: 'ryzen5600', + url: + 'https://www.bhphotovideo.com/c/product/1598377-REG/amd_100_100000065box_ryzen_5_5600x_3_7.html' + }, + { + brand: 'corsair', + model: '750 platinum', + series: 'sf', + url: + 'https://www.bhphotovideo.com/c/product/1560680-REG/corsair_cp_9020186_na_corsair_sf750_power_supply.html' } ], name: 'bandh' diff --git a/src/store/model/bestbuy.ts b/src/store/model/bestbuy.ts index f6bfabbdf8..ce7ac85e4a 100644 --- a/src/store/model/bestbuy.ts +++ b/src/store/model/bestbuy.ts @@ -405,6 +405,22 @@ export const BestBuy: Store = { series: 'rx6800xt', url: 'https://www.bestbuy.com/site/xfx-amd-radeon-rx-6800xt-16gb-gddr6-pci-express-4-0-gaming-graphics-card-black/6441226.p?skuId=6441226' + }, + { + brand: 'corsair', + cartUrl: 'https://api.bestbuy.com/click/-/6351845/cart', + model: '750 platinum', + series: 'sf', + url: + 'https://www.bestbuy.com/site/corsair-sf-series-750w-atx12v-2-4-eps12v-2-92-sfx12v-80-plus-platinum-modular-power-supply-black/6351845.p?skuId=6351845' + }, + { + brand: 'corsair', + cartUrl: 'https://api.bestbuy.com/click/-/6351844/cart', + model: '600 platinum', + series: 'sf', + url: + 'https://www.bestbuy.com/site/corsair-sf-series-600w-atx12v-2-4-eps12v-2-92-sfx12v-80-plus-platinum-modular-power-supply-black/6351844.p?skuId=6351844' } ], name: 'bestbuy' diff --git a/src/store/model/corsair.ts b/src/store/model/corsair.ts new file mode 100644 index 0000000000..ce5c1f7dc8 --- /dev/null +++ b/src/store/model/corsair.ts @@ -0,0 +1,38 @@ +import {Store} from './store'; + +export const Corsair: Store = { + labels: { + inStock: { + container: '.add_to_cart_form', + text: ['add to cart'] + }, + maxPrice: { + container: '.product-price', + euroFormat: false + } + }, + links: [ + { + brand: 'test:brand', + model: 'test:model', + series: 'test:series', + url: + 'https://www.corsair.com/us/en/Categories/Products/Power-Supply-Units/Power-Supply-Units-Advanced/SF-Series/p/CP-9020181-NA' + }, + { + brand: 'corsair', + model: '750 platinum', + series: 'sf', + url: + 'https://www.corsair.com/us/en/Categories/Products/Power-Supply-Units/Power-Supply-Units-Advanced/SF-Series/p/CP-9020186-NA' + }, + { + brand: 'corsair', + model: '600 platinum', + series: 'sf', + url: + 'https://www.corsair.com/us/en/Categories/Products/Power-Supply-Units/Power-Supply-Units-Advanced/SF-Series/p/CP-9020182-NA' + } + ], + name: 'corsair' +}; diff --git a/src/store/model/index.ts b/src/store/model/index.ts index 3c970aca3a..8c302e4204 100644 --- a/src/store/model/index.ts +++ b/src/store/model/index.ts @@ -26,6 +26,7 @@ import {Ccl} from './ccl'; import {Computeruniverse} from './computeruniverse'; import {Coolblue} from './coolblue'; import {Coolmod} from './coolmod'; +import {Corsair} from './corsair'; import {Currys} from './currys'; import {Cyberport} from './cyberport'; import {Ebuyer} from './ebuyer'; @@ -92,6 +93,7 @@ export const storeList = new Map([ [Computeruniverse.name, Computeruniverse], [Coolblue.name, Coolblue], [Coolmod.name, Coolmod], + [Corsair.name, Corsair], [Currys.name, Currys], [Cyberport.name, Cyberport], [Ebuyer.name, Ebuyer], diff --git a/src/store/model/store.ts b/src/store/model/store.ts index 20fd16ca47..bf629e5ee1 100644 --- a/src/store/model/store.ts +++ b/src/store/model/store.ts @@ -15,6 +15,7 @@ export type Brand = | 'amd' | 'asrock' | 'asus' + | 'corsair' | 'evga' | 'gainward' | 'gigabyte' @@ -45,6 +46,7 @@ export type Series = | 'ryzen5950' | 'sonyps5c' | 'sonyps5de' + | 'sf' | 'xboxsx' | 'xboxss'; @@ -54,6 +56,8 @@ export type Model = | '5800x' | '5900x' | '5950x' + | '600 platinum' + | '750 platinum' | 'amd reference' | 'amp extreme holo' | 'amp holo'