-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(taxes): side effect adds all taxes to first product
- Loading branch information
Gerald Baulig
committed
Oct 8, 2024
1 parent
e8698b4
commit 22550c9
Showing
2 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,7 +156,7 @@ const countries: CountryResponse[] = [{ | |
countryCode: 'DE', | ||
name: 'Deutschland', | ||
geographicalName: 'Germany', | ||
economicAreas: [], | ||
economicAreas: ['EU'], | ||
}, | ||
status: { | ||
id: 'germany', | ||
|
@@ -172,7 +172,7 @@ const taxes: TaxResponse[] = [ | |
countryId: 'germany', | ||
rate: 0.19, | ||
typeId: 'taxType_1', | ||
variant: 'MwSt.' | ||
abbreviation: 'MwSt.', | ||
}, | ||
status: { | ||
id: 'tax_1', | ||
|
@@ -265,6 +265,88 @@ const products: ProductResponse[] = [ | |
message: 'OK', | ||
} | ||
}, | ||
{ | ||
payload: { | ||
id: 'physicalProduct_2', | ||
active: true, | ||
shopId: 'shop_1', | ||
tags: [], | ||
associations: [], | ||
product: { | ||
name: 'Physical Product 2', | ||
description: 'This is a physical product', | ||
manufacturerId: 'manufacturer_1', | ||
taxIds: [ | ||
taxes[0].payload?.id as string, | ||
], | ||
physical: { | ||
variants: [ | ||
{ | ||
id: '1', | ||
name: 'Physical Product 1 Blue', | ||
description: 'This is a physical product in blue', | ||
price: { | ||
currencyId: 'currency_1', | ||
regularPrice: 19.99, | ||
salePrice: 18.99, | ||
sale: false, | ||
}, | ||
images: [], | ||
files: [], | ||
stockKeepingUnit: '123456789', | ||
stockLevel: 300, | ||
package: { | ||
sizeInCm: { | ||
height: 10, | ||
length: 20, | ||
width: 15, | ||
}, | ||
weightInKg: 0.58, | ||
rotatable: true, | ||
}, | ||
properties: [ | ||
{ | ||
id: 'urn:product:property:color:main:name', | ||
value: 'blue', | ||
unitCode: 'text', | ||
}, | ||
{ | ||
id: 'urn:product:property:color:main:value', | ||
value: '#0000FF', | ||
unitCode: '#RGB', | ||
} | ||
], | ||
}, | ||
{ | ||
id: '2', | ||
name: 'Physical Product 1 Red', | ||
description: 'This is a physical product in red', | ||
images: [], | ||
files: [], | ||
properties: [ | ||
{ | ||
id: 'urn:product:property:color:main:name', | ||
value: 'red', | ||
unitCode: 'text', | ||
}, | ||
{ | ||
id: 'urn:product:property:color:main:value', | ||
value: '#FF0000', | ||
unitCode: '#RGB', | ||
} | ||
], | ||
parentVariantId: '1', | ||
} | ||
] | ||
} | ||
}, | ||
}, | ||
status: { | ||
id: 'physicalProduct_2', | ||
code: 200, | ||
message: 'OK', | ||
} | ||
}, | ||
]; | ||
|
||
const contactPoints = [ | ||
|
@@ -314,7 +396,7 @@ const shops = [ | |
id: 'shop_1', | ||
name: 'Shop1', | ||
description: 'a mocked shop for unit tests', | ||
domain: 'www.shop.com', | ||
domains: ['www.shop.com'], | ||
organizationId: organizations[0].payload?.id, | ||
shopNumber: '0000000001', | ||
}, | ||
|
@@ -336,6 +418,11 @@ const validOrders: { [key: string]: OrderList } = { | |
productId: products[0]?.payload?.id, | ||
variantId: products[0]?.payload?.product?.physical?.variants?.[0]?.id, | ||
quantity: 4, | ||
}, | ||
{ | ||
productId: products[1]?.payload?.id, | ||
variantId: products[1]?.payload?.product?.physical?.variants?.[0]?.id, | ||
quantity: 2, | ||
} | ||
], | ||
notificationEmail: '[email protected]', | ||
|
@@ -366,6 +453,11 @@ const validOrders: { [key: string]: OrderList } = { | |
productId: products[0]?.payload?.id, | ||
variantId: products[0]?.payload?.product?.physical?.variants?.[0]?.id, | ||
quantity: 4, | ||
}, | ||
{ | ||
productId: products[1]?.payload?.id, | ||
variantId: products[1]?.payload?.product?.physical?.variants?.[0]?.id, | ||
quantity: 2, | ||
} | ||
], | ||
userId: 'user_1', | ||
|
@@ -401,6 +493,11 @@ const invalidOrders: { [key: string]: OrderList } = { | |
productId: products[0]?.payload?.id, | ||
variantId: products[0]?.payload?.product?.physical?.variants?.[0]?.id, | ||
quantity: 4, | ||
}, | ||
{ | ||
productId: products[1]?.payload?.id, | ||
variantId: products[1]?.payload?.product?.physical?.variants?.[0]?.id, | ||
quantity: 2, | ||
} | ||
], | ||
userId: 'userId_1', | ||
|