From 684fc1237848a81765f1dc7f5d687a6d53cbf0be Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Mon, 25 Oct 2021 14:50:29 +0700 Subject: [PATCH] feat: adds advertising for Sweden (#444) BREAKING CHANGE: adds advertising for Sweden --- src/amazon-marketplace.ts | 2 ++ src/marketplaces/ae.ts | 2 +- src/marketplaces/br.ts | 4 +-- src/marketplaces/mx.ts | 6 ++-- src/marketplaces/se.ts | 18 ++++++++++ src/marketplaces/sg.ts | 2 +- test/__snapshots__/marketplaces.test.ts.snap | 35 ++++++++++++++++---- 7 files changed, 55 insertions(+), 14 deletions(-) diff --git a/src/amazon-marketplace.ts b/src/amazon-marketplace.ts index 82b262c1..96e996ed 100644 --- a/src/amazon-marketplace.ts +++ b/src/amazon-marketplace.ts @@ -69,6 +69,7 @@ export enum AmazonMarketplaceAdvertisingCountryCode { JP = 'JP', MX = 'MX', NL = 'NL', + SE = 'SE', SG = 'SG', UK = 'UK', // Not a real country code, but such is life. See https://github.com/ScaleLeap/amazon-marketplaces/issues/122 US = 'US', @@ -88,6 +89,7 @@ export enum AmazonMarketplaceAdvertisingTimeZone { EUROPE_AMSTERDAM = 'Europe/Amsterdam', EUROPE_LONDON = 'Europe/London', EUROPE_PARIS = 'Europe/Paris', + EUROPE_STOCKHOLM = 'Europe/Stockholm', } export interface AmazonMarketplaceAdvertising { diff --git a/src/marketplaces/ae.ts b/src/marketplaces/ae.ts index ebe9ec41..84850e9e 100644 --- a/src/marketplaces/ae.ts +++ b/src/marketplaces/ae.ts @@ -22,7 +22,7 @@ export const AE = new AmazonMarketplace({ region: marketplaceAdvertisingRegions.EU, bids: { sponsoredBrands: { - min: 24, + min: 40, max: 18400, }, sponsoredProducts: { diff --git a/src/marketplaces/br.ts b/src/marketplaces/br.ts index b7162b27..18e6dbcb 100644 --- a/src/marketplaces/br.ts +++ b/src/marketplaces/br.ts @@ -22,8 +22,8 @@ export const BR = new AmazonMarketplace({ region: marketplaceAdvertisingRegions.NA, bids: { sponsoredBrands: { - min: 7, - max: 370000, + min: 53, + max: 20000, }, sponsoredProducts: { min: 7, diff --git a/src/marketplaces/mx.ts b/src/marketplaces/mx.ts index c3d1488d..b1236199 100644 --- a/src/marketplaces/mx.ts +++ b/src/marketplaces/mx.ts @@ -23,11 +23,11 @@ export const MX = new AmazonMarketplace({ bids: { sponsoredBrands: { min: 10, - max: 4900, + max: 50000, }, sponsoredProducts: { - min: 2, - max: 100000, + min: 10, + max: 2000000, }, }, timeZone: AmazonMarketplaceAdvertisingTimeZone.AMERICA_LOS_ANGELES, diff --git a/src/marketplaces/se.ts b/src/marketplaces/se.ts index eaa894a5..2298630f 100644 --- a/src/marketplaces/se.ts +++ b/src/marketplaces/se.ts @@ -1,9 +1,12 @@ import { AmazonMarketplace, + AmazonMarketplaceAdvertisingCountryCode, AmazonMarketplaceAdvertisingCurrency, + AmazonMarketplaceAdvertisingTimeZone, AmazonMarketplaceCountryCode, } from '../amazon-marketplace' import { amazonVendorCentralUriFactory } from '../amazon-vendor-central-uri-factory' +import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions' import { sellingPartnerRegions } from '../selling-partner-api-regions' export const SE = new AmazonMarketplace({ @@ -15,6 +18,21 @@ export const SE = new AmazonMarketplace({ sellerCentralUri: 'https://sellercentral.amazon.se', vendorCentralUri: amazonVendorCentralUriFactory(AmazonMarketplaceCountryCode.SE), webServiceUri: 'https://mws-eu.amazonservices.com', + advertising: { + countryCode: AmazonMarketplaceAdvertisingCountryCode.SE, + region: marketplaceAdvertisingRegions.EU, + bids: { + sponsoredBrands: { + min: 900, + max: 940000000, + }, + sponsoredProducts: { + min: 18, + max: 930000, + }, + }, + timeZone: AmazonMarketplaceAdvertisingTimeZone.EUROPE_STOCKHOLM, + }, sellingPartner: { region: sellingPartnerRegions.EU, }, diff --git a/src/marketplaces/sg.ts b/src/marketplaces/sg.ts index ff2f4aaf..850bb2a9 100644 --- a/src/marketplaces/sg.ts +++ b/src/marketplaces/sg.ts @@ -22,7 +22,7 @@ export const SG = new AmazonMarketplace({ region: marketplaceAdvertisingRegions.FE, bids: { sponsoredBrands: { - min: 10, + min: 14, max: 10000, }, sponsoredProducts: { diff --git a/test/__snapshots__/marketplaces.test.ts.snap b/test/__snapshots__/marketplaces.test.ts.snap index f01475aa..3899a10c 100644 --- a/test/__snapshots__/marketplaces.test.ts.snap +++ b/test/__snapshots__/marketplaces.test.ts.snap @@ -6,7 +6,7 @@ AmazonMarketplace { "bids": Object { "sponsoredBrands": Object { "max": 18400, - "min": 24, + "min": 40, }, "sponsoredProducts": Object { "max": 18400, @@ -93,8 +93,8 @@ AmazonMarketplace { "advertising": Object { "bids": Object { "sponsoredBrands": Object { - "max": 370000, - "min": 7, + "max": 20000, + "min": 53, }, "sponsoredProducts": Object { "max": 370000, @@ -521,12 +521,12 @@ AmazonMarketplace { "advertising": Object { "bids": Object { "sponsoredBrands": Object { - "max": 4900, + "max": 50000, "min": 10, }, "sponsoredProducts": Object { - "max": 100000, - "min": 2, + "max": 2000000, + "min": 10, }, }, "countryCode": "MX", @@ -641,6 +641,27 @@ AmazonMarketplace { exports[`marketplace SE should match snapshot 1`] = ` AmazonMarketplace { + "advertising": Object { + "bids": Object { + "sponsoredBrands": Object { + "max": 940000000, + "min": 900, + }, + "sponsoredProducts": Object { + "max": 930000, + "min": 18, + }, + }, + "countryCode": "SE", + "region": AmazonMarketplaceAdvertisingRegion { + "accessTokenUri": "https://api.amazon.co.uk/auth/o2/token", + "authorizationUri": "https://eu.account.amazon.com/ap/oa", + "code": "EU", + "endpoint": "https://advertising-api-eu.amazon.com", + "name": "Europe", + }, + "timeZone": "Europe/Stockholm", + }, "countryCode": "SE", "currency": "SEK", "id": "A2NODRKZP88ZB9", @@ -668,7 +689,7 @@ AmazonMarketplace { "bids": Object { "sponsoredBrands": Object { "max": 10000, - "min": 10, + "min": 14, }, "sponsoredProducts": Object { "max": 110000,