Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Egypt to advertising #518

Merged
merged 2 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/amazon-marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export enum AmazonMarketplaceAdvertisingCountryCode {
BR = 'BR',
CA = 'CA',
DE = 'DE',
EG = 'EG',
ES = 'ES',
FR = 'FR',
IN = 'IN',
Expand All @@ -81,6 +82,7 @@ export enum AmazonMarketplaceAdvertisingCountryCode {
* Time Zone enum.
*/
export enum AmazonMarketplaceAdvertisingTimeZone {
AFRICA_CAIRO = 'Africa/Cairo',
AMERICA_LOS_ANGELES = 'America/Los_Angeles',
AMERICA_SAO_PAULO = 'America/Sao_Paulo',
ASIA_DUBAI = 'Asia/Dubai',
Expand Down
18 changes: 18 additions & 0 deletions src/marketplaces/eg.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {
AmazonMarketplace,
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'
import { sellingPartnerRegions } from '../selling-partner-api-regions'

export const EG = new AmazonMarketplace({
Expand All @@ -13,6 +16,21 @@ export const EG = new AmazonMarketplace({
uri: 'https://www.amazon.eg',
vendorCentralUri: 'https://vendorcentral.amazon.me',
webServiceUri: 'https://mws-eu.amazonservices.com',
advertising: {
countryCode: AmazonMarketplaceAdvertisingCountryCode.EG,
region: marketplaceAdvertisingRegions.EU,
bids: {
sponsoredBrands: {
min: 70,
max: 40000,
},
sponsoredProducts: {
min: 15,
max: 550,
},
},
timeZone: AmazonMarketplaceAdvertisingTimeZone.AFRICA_CAIRO,
},
sellingPartner: {
region: sellingPartnerRegions.EU,
},
Expand Down
2 changes: 1 addition & 1 deletion src/marketplaces/mx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const MX = new AmazonMarketplace({
bids: {
sponsoredBrands: {
min: 10,
max: 50000,
max: 2000000,
},
sponsoredProducts: {
min: 10,
Expand Down
4 changes: 2 additions & 2 deletions src/marketplaces/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const PL = new AmazonMarketplace({
max: 20000,
},
sponsoredProducts: {
min: 200,
max: 200000000,
min: 4,
max: 200000,
},
},
timeZone: AmazonMarketplaceAdvertisingTimeZone.EUROPE_WARSAW,
Expand Down
27 changes: 24 additions & 3 deletions test/__snapshots__/marketplaces.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,27 @@ AmazonMarketplace {

exports[`marketplace EG should match snapshot 1`] = `
AmazonMarketplace {
"advertising": Object {
"bids": Object {
"sponsoredBrands": Object {
"max": 40000,
"min": 70,
},
"sponsoredProducts": Object {
"max": 550,
"min": 15,
},
},
"countryCode": "EG",
"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": "Africa/Cairo",
},
"countryCode": "EG",
"currency": "EGP",
"id": "ARBP9OOSHTCHU",
Expand Down Expand Up @@ -521,7 +542,7 @@ AmazonMarketplace {
"advertising": Object {
"bids": Object {
"sponsoredBrands": Object {
"max": 50000,
"max": 2000000,
"min": 10,
},
"sponsoredProducts": Object {
Expand Down Expand Up @@ -613,8 +634,8 @@ AmazonMarketplace {
"min": 20,
},
"sponsoredProducts": Object {
"max": 200000000,
"min": 200,
"max": 200000,
"min": 4,
},
},
"countryCode": "PL",
Expand Down
4 changes: 2 additions & 2 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '../src/utils'

describe('utils', () => {
const { CA, EG } = amazonMarketplaces
const { CA, CN } = amazonMarketplaces

describe(`${findAmazonMarketplace.name}`, () => {
it('should find by id', () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('utils', () => {
it('should throw when advertising is not available', () => {
expect.assertions(1)

expect(() => assertMarketplaceHasAdvertising(EG)).toThrow(/does not have advertising/)
expect(() => assertMarketplaceHasAdvertising(CN)).toThrow(/does not have advertising/)
})
})
})