Merge branch 'hotfix/claim-return-shipping' into develop
This commit is contained in:
commit
23b9066159
63 files changed
+405
-112
No files matched your search
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.1.22](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.19...@medusajs/medusa@1.1.22) (2021-04-28)
|
||||
|
||||
**Note:** Version bump only for package @medusajs/medusa
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.21](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.20...@medusajs/medusa@1.1.21) (2021-04-20)
|
||||
|
||||
**Note:** Version bump only for package @medusajs/medusa
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@medusajs/medusa",
|
||||
"version": "1.1.21",
|
||||
"version": "1.1.22",
|
||||
"description": "E-commerce for JAMstack",
|
||||
"main": "dist/index.js",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
"@babel/preset-typescript": "^7.12.7",
|
||||
"@babel/register": "^7.7.4",
|
||||
"@babel/runtime": "^7.7.6",
|
||||
"babel-preset-medusa-package": "^1.1.2",
|
||||
"babel-preset-medusa-package": "^1.1.3",
|
||||
"cross-env": "^5.2.1",
|
||||
"eslint": "^6.8.0",
|
||||
"jest": "^25.5.2",
|
||||
@@ -67,8 +67,8 @@
|
||||
"joi": "^17.3.0",
|
||||
"joi-objectid": "^3.0.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"medusa-core-utils": "^1.1.8",
|
||||
"medusa-test-utils": "^1.1.11",
|
||||
"medusa-core-utils": "^1.1.9",
|
||||
"medusa-test-utils": "^1.1.12",
|
||||
"morgan": "^1.9.1",
|
||||
"multer": "^1.4.2",
|
||||
"passport": "^0.4.0",
|
||||
|
||||
@@ -100,31 +100,20 @@ describe("ClaimService", () => {
|
||||
expect(withTransactionMock).toHaveBeenCalledWith("return")
|
||||
|
||||
expect(returnService.create).toHaveBeenCalledTimes(1)
|
||||
expect(returnService.create).toHaveBeenCalledWith(
|
||||
{
|
||||
claim_order_id: "claim_134",
|
||||
shipping_method: {
|
||||
option_id: "opt_13",
|
||||
price: 0,
|
||||
},
|
||||
items: [
|
||||
{
|
||||
item_id: "itm_1",
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
expect(returnService.create).toHaveBeenCalledWith({
|
||||
order_id: "1234",
|
||||
claim_order_id: "claim_134",
|
||||
shipping_method: {
|
||||
option_id: "opt_13",
|
||||
price: 0,
|
||||
},
|
||||
{
|
||||
id: "1234",
|
||||
region_id: "order_region",
|
||||
items: [
|
||||
{
|
||||
id: "itm_1",
|
||||
unit_price: 8000,
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
items: [
|
||||
{
|
||||
item_id: "itm_1",
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
expect(withTransactionMock).toHaveBeenCalledWith("lineItem")
|
||||
expect(lineItemService.generate).toHaveBeenCalledTimes(1)
|
||||
|
||||
@@ -252,18 +252,16 @@ class ClaimService extends BaseService {
|
||||
}
|
||||
|
||||
if (return_shipping) {
|
||||
await this.returnService_.withTransaction(manager).create(
|
||||
{
|
||||
claim_order_id: result.id,
|
||||
items: claim_items.map(ci => ({
|
||||
item_id: ci.item_id,
|
||||
quantity: ci.quantity,
|
||||
metadata: ci.metadata,
|
||||
})),
|
||||
shipping_method: return_shipping,
|
||||
},
|
||||
order
|
||||
)
|
||||
await this.returnService_.withTransaction(manager).create({
|
||||
order_id: order.id,
|
||||
claim_order_id: result.id,
|
||||
items: claim_items.map(ci => ({
|
||||
item_id: ci.item_id,
|
||||
quantity: ci.quantity,
|
||||
metadata: ci.metadata,
|
||||
})),
|
||||
shipping_method: return_shipping,
|
||||
})
|
||||
}
|
||||
|
||||
await this.eventBus_
|
||||
|
||||
Reference in new issue
Block a user