@medusajs/order 0.1.3-snapshot-20240701122250 → 0.1.3-snapshot-20240704061641
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/joiner-config.d.ts +0 -2
- package/dist/joiner-config.js +1 -2
- package/dist/joiner-config.js.map +1 -1
- package/dist/models/return.d.ts +2 -3
- package/dist/models/return.js.map +1 -1
- package/dist/services/actions/cancel-claim.d.ts +2 -0
- package/dist/services/actions/cancel-claim.js +108 -0
- package/dist/services/actions/cancel-claim.js.map +1 -0
- package/dist/services/actions/cancel-exchange.d.ts +2 -0
- package/dist/services/actions/cancel-exchange.js +93 -0
- package/dist/services/actions/cancel-exchange.js.map +1 -0
- package/dist/services/actions/cancel-return.d.ts +2 -0
- package/dist/services/actions/cancel-return.js +73 -0
- package/dist/services/actions/cancel-return.js.map +1 -0
- package/dist/services/actions/create-claim.js +2 -2
- package/dist/services/actions/create-claim.js.map +1 -1
- package/dist/services/actions/create-exchange.js +2 -2
- package/dist/services/actions/create-exchange.js.map +1 -1
- package/dist/services/actions/create-return.js +8 -2
- package/dist/services/actions/create-return.js.map +1 -1
- package/dist/services/actions/index.d.ts +3 -0
- package/dist/services/actions/index.js +3 -0
- package/dist/services/actions/index.js.map +1 -1
- package/dist/services/order-change-service.d.ts +2 -2
- package/dist/services/order-change-service.js.map +1 -1
- package/dist/services/order-module-service.d.ts +12 -7
- package/dist/services/order-module-service.js +119 -27
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/services/order-service.d.ts +2 -2
- package/dist/services/order-service.js.map +1 -1
- package/dist/types/shipping-method.d.ts +3 -0
- package/dist/types/utils/index.d.ts +3 -3
- package/dist/utils/action-key.d.ts +4 -2
- package/dist/utils/action-key.js +3 -1
- package/dist/utils/action-key.js.map +1 -1
- package/dist/utils/actions/cancel-return.js +1 -1
- package/dist/utils/actions/cancel-return.js.map +1 -1
- package/dist/utils/actions/index.d.ts +1 -0
- package/dist/utils/actions/index.js +1 -0
- package/dist/utils/actions/index.js.map +1 -1
- package/dist/utils/actions/reinstate-item.d.ts +1 -0
- package/dist/utils/actions/reinstate-item.js +37 -0
- package/dist/utils/actions/reinstate-item.js.map +1 -0
- package/dist/utils/actions/return-item.js +2 -2
- package/dist/utils/actions/return-item.js.map +1 -1
- package/dist/utils/actions/shipping-add.js +16 -9
- package/dist/utils/actions/shipping-add.js.map +1 -1
- package/dist/utils/actions/shipping-remove.d.ts +1 -0
- package/dist/utils/actions/shipping-remove.js +42 -0
- package/dist/utils/actions/shipping-remove.js.map +1 -0
- package/dist/utils/apply-order-changes.d.ts +1 -1
- package/dist/utils/apply-order-changes.js +3 -3
- package/dist/utils/apply-order-changes.js.map +1 -1
- package/dist/utils/base-repository-find.js +12 -2
- package/dist/utils/base-repository-find.js.map +1 -1
- package/dist/utils/calculate-order-change.js +7 -7
- package/dist/utils/calculate-order-change.js.map +1 -1
- package/dist/utils/transform-order.js +35 -6
- package/dist/utils/transform-order.js.map +1 -1
- package/package.json +5 -5
package/dist/joiner-config.d.ts
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
import { MapToConfig } from "@medusajs/utils";
|
2
1
|
export declare const joinerConfig: Omit<import("@medusajs/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys"> & Required<Pick<import("@medusajs/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys">>;
|
3
|
-
export declare const entityNameToLinkableKeysMap: MapToConfig;
|
package/dist/joiner-config.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.joinerConfig = void 0;
|
4
4
|
const utils_1 = require("@medusajs/utils");
|
5
5
|
// TODO: review configuration
|
6
6
|
exports.joinerConfig = (0, utils_1.defineJoinerConfig)(utils_1.Modules.ORDER);
|
7
|
-
exports.entityNameToLinkableKeysMap = (0, utils_1.buildEntitiesNameToLinkableKeysMap)(exports.joinerConfig.linkableKeys);
|
8
7
|
//# sourceMappingURL=joiner-config.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"joiner-config.js","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"joiner-config.js","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAE7D,6BAA6B;AAChB,QAAA,YAAY,GAAG,IAAA,0BAAkB,EAAC,eAAO,CAAC,KAAK,CAAC,CAAA"}
|
package/dist/models/return.d.ts
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
import { BigNumberRawValue, DAL } from "@medusajs/types";
|
2
2
|
import { BigNumber, ReturnStatus } from "@medusajs/utils";
|
3
3
|
import { Collection, OptionalProps, Rel } from "@mikro-orm/core";
|
4
|
-
import { Transaction } from ".";
|
4
|
+
import { ReturnItem, Transaction } from ".";
|
5
5
|
import Claim from "./claim";
|
6
6
|
import Exchange from "./exchange";
|
7
7
|
import Order from "./order";
|
8
|
-
import OrderItem from "./order-item";
|
9
8
|
import OrderShippingMethod from "./order-shipping-method";
|
10
9
|
type OptionalReturnProps = DAL.EntityDateColumns;
|
11
10
|
export default class Return {
|
@@ -23,7 +22,7 @@ export default class Return {
|
|
23
22
|
no_notification: boolean | null;
|
24
23
|
refund_amount: BigNumber | number;
|
25
24
|
raw_refund_amount: BigNumberRawValue;
|
26
|
-
items: Collection<
|
25
|
+
items: Collection<ReturnItem, object>;
|
27
26
|
shipping_methods: Collection<OrderShippingMethod, object>;
|
28
27
|
transactions: Collection<Transaction, object>;
|
29
28
|
metadata: Record<string, unknown> | null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"return.js","sourceRoot":"","sources":["../../src/models/return.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAMwB;AACxB,0CAcwB;AACxB,qCAAiD;AACjD,oDAA2B;AAC3B,0DAAiC;AACjC,oDAA2B;
|
1
|
+
{"version":3,"file":"return.js","sourceRoot":"","sources":["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.cancelClaim = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
const utils_2 = require("../../utils");
|
6
|
+
async function createOrderChange(service, data, returnRef, actions, sharedContext) {
|
7
|
+
return await service.createOrderChange_({
|
8
|
+
order_id: returnRef.order_id,
|
9
|
+
claim_id: returnRef.id,
|
10
|
+
reference: "return",
|
11
|
+
reference_id: returnRef.id,
|
12
|
+
description: data.description,
|
13
|
+
internal_note: data.internal_note,
|
14
|
+
created_by: data.created_by,
|
15
|
+
metadata: data.metadata,
|
16
|
+
actions,
|
17
|
+
}, sharedContext);
|
18
|
+
}
|
19
|
+
async function cancelClaim(data, sharedContext) {
|
20
|
+
const claimOrder = await this.retrieveClaim(data.claim_id, {
|
21
|
+
select: [
|
22
|
+
"id",
|
23
|
+
"order_id",
|
24
|
+
"return.id",
|
25
|
+
"return.items.id",
|
26
|
+
"return.items.quantity",
|
27
|
+
"claim_items.item_id",
|
28
|
+
"claim_items.quantity",
|
29
|
+
"additional_items.id",
|
30
|
+
"additional_items.quantity",
|
31
|
+
],
|
32
|
+
relations: ["return.items", "additional_items", "shipping_methods"],
|
33
|
+
}, sharedContext);
|
34
|
+
const actions = [];
|
35
|
+
claimOrder.return.items.forEach((item) => {
|
36
|
+
actions.push({
|
37
|
+
action: utils_2.ChangeActionType.CANCEL_RETURN_ITEM,
|
38
|
+
order_id: claimOrder.order_id,
|
39
|
+
claim_id: claimOrder.id,
|
40
|
+
return_id: claimOrder.return.id,
|
41
|
+
reference: "return",
|
42
|
+
reference_id: claimOrder.return.id,
|
43
|
+
details: {
|
44
|
+
reference_id: item.id,
|
45
|
+
order_id: claimOrder.order_id,
|
46
|
+
claim_id: claimOrder.id,
|
47
|
+
return_id: claimOrder.return.id,
|
48
|
+
quantity: item.quantity,
|
49
|
+
},
|
50
|
+
});
|
51
|
+
});
|
52
|
+
claimOrder.claim_items.forEach((item) => {
|
53
|
+
actions.push({
|
54
|
+
action: utils_2.ChangeActionType.REINSTATE_ITEM,
|
55
|
+
claim_id: claimOrder.id,
|
56
|
+
reference: "claim",
|
57
|
+
reference_id: claimOrder.id,
|
58
|
+
details: {
|
59
|
+
reference_id: item.id,
|
60
|
+
claim_id: claimOrder.id,
|
61
|
+
quantity: item.quantity,
|
62
|
+
},
|
63
|
+
});
|
64
|
+
});
|
65
|
+
claimOrder.additional_items.forEach((item) => {
|
66
|
+
actions.push({
|
67
|
+
action: utils_2.ChangeActionType.ITEM_REMOVE,
|
68
|
+
order_id: claimOrder.order_id,
|
69
|
+
claim_id: claimOrder.id,
|
70
|
+
reference: "claim",
|
71
|
+
reference_id: claimOrder.id,
|
72
|
+
details: {
|
73
|
+
reference_id: item.id,
|
74
|
+
order_id: claimOrder.order_id,
|
75
|
+
claim_id: claimOrder.id,
|
76
|
+
quantity: item.quantity,
|
77
|
+
},
|
78
|
+
});
|
79
|
+
});
|
80
|
+
claimOrder.shipping_methods?.forEach((shipping) => {
|
81
|
+
actions.push({
|
82
|
+
action: utils_2.ChangeActionType.SHIPPING_REMOVE,
|
83
|
+
order_id: claimOrder.order_id,
|
84
|
+
claim_id: claimOrder.id,
|
85
|
+
return_id: claimOrder.return.id,
|
86
|
+
reference: "claim",
|
87
|
+
reference_id: shipping.id,
|
88
|
+
amount: shipping.price,
|
89
|
+
});
|
90
|
+
});
|
91
|
+
const [change] = await createOrderChange(this, data, claimOrder, actions, sharedContext);
|
92
|
+
await (0, utils_1.promiseAll)([
|
93
|
+
this.updateClaims([
|
94
|
+
{
|
95
|
+
data: {
|
96
|
+
canceled_at: new Date(),
|
97
|
+
},
|
98
|
+
selector: {
|
99
|
+
id: claimOrder.id,
|
100
|
+
},
|
101
|
+
},
|
102
|
+
], sharedContext),
|
103
|
+
this.confirmOrderChange(change.id, sharedContext),
|
104
|
+
]);
|
105
|
+
return claimOrder;
|
106
|
+
}
|
107
|
+
exports.cancelClaim = cancelClaim;
|
108
|
+
//# sourceMappingURL=cancel-claim.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"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ACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChD,OAAO,CAAC,IAAI,CAAC;YACX,MAAM,EAAE,wBAAgB,CAAC,eAAe;YACxC,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,QAAQ,EAAE,UAAU,CAAC,EAAE;YACvB,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE;YAC/B,SAAS,EAAE,OAAO;YAClB,YAAY,EAAE,QAAQ,CAAC,EAAE;YACzB,MAAM,EAAE,QAAQ,CAAC,KAAK;SACvB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,iBAAiB,CACtC,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,OAAO,EACP,aAAa,CACd,CAAA;IAED,MAAM,IAAA,kBAAU,EAAC;QACf,IAAI,CAAC,YAAY,CACf;YACE;gBACE,IAAI,EAAE;oBACJ,WAAW,EAAE,IAAI,IAAI,EAAE;iBACxB;gBACD,QAAQ,EAAE;oBACR,EAAE,EAAE,UAAU,CAAC,EAAE;iBAClB;aACF;SACF,EACD,aAAa,CACd;QACD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC;KAClD,CAAC,CAAA;IAEF,OAAO,UAAU,CAAA;AACnB,CAAC;AAhHD,kCAgHC"}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.cancelExchange = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
const utils_2 = require("../../utils");
|
6
|
+
async function createOrderChange(service, data, returnRef, actions, sharedContext) {
|
7
|
+
return await service.createOrderChange_({
|
8
|
+
order_id: returnRef.order_id,
|
9
|
+
exchange_id: returnRef.id,
|
10
|
+
reference: "return",
|
11
|
+
reference_id: returnRef.id,
|
12
|
+
description: data.description,
|
13
|
+
internal_note: data.internal_note,
|
14
|
+
created_by: data.created_by,
|
15
|
+
metadata: data.metadata,
|
16
|
+
actions,
|
17
|
+
}, sharedContext);
|
18
|
+
}
|
19
|
+
async function cancelExchange(data, sharedContext) {
|
20
|
+
const exchangeOrder = await this.retrieveExchange(data.exchange_id, {
|
21
|
+
select: [
|
22
|
+
"id",
|
23
|
+
"order_id",
|
24
|
+
"return.id",
|
25
|
+
"return.items.item_id",
|
26
|
+
"return.items.quantity",
|
27
|
+
"additional_items.id",
|
28
|
+
"additional_items.quantity",
|
29
|
+
],
|
30
|
+
relations: ["return.items", "additional_items", "shipping_methods"],
|
31
|
+
}, sharedContext);
|
32
|
+
const actions = [];
|
33
|
+
exchangeOrder.return.items.forEach((item) => {
|
34
|
+
actions.push({
|
35
|
+
action: utils_2.ChangeActionType.CANCEL_RETURN_ITEM,
|
36
|
+
order_id: exchangeOrder.order_id,
|
37
|
+
exchange_id: exchangeOrder.id,
|
38
|
+
return_id: exchangeOrder.return.id,
|
39
|
+
reference: "return",
|
40
|
+
reference_id: exchangeOrder.return.id,
|
41
|
+
details: {
|
42
|
+
reference_id: item.item_id,
|
43
|
+
order_id: exchangeOrder.order_id,
|
44
|
+
exchange_id: exchangeOrder.id,
|
45
|
+
return_id: exchangeOrder.return.id,
|
46
|
+
quantity: item.quantity,
|
47
|
+
},
|
48
|
+
});
|
49
|
+
});
|
50
|
+
exchangeOrder.additional_items.forEach((item) => {
|
51
|
+
actions.push({
|
52
|
+
action: utils_2.ChangeActionType.ITEM_REMOVE,
|
53
|
+
order_id: exchangeOrder.order_id,
|
54
|
+
exchange_id: exchangeOrder.id,
|
55
|
+
reference: "exchange",
|
56
|
+
reference_id: exchangeOrder.id,
|
57
|
+
details: {
|
58
|
+
order_id: exchangeOrder.order_id,
|
59
|
+
reference_id: item.item_id,
|
60
|
+
exchange_id: exchangeOrder.id,
|
61
|
+
quantity: item.quantity,
|
62
|
+
},
|
63
|
+
});
|
64
|
+
});
|
65
|
+
exchangeOrder.shipping_methods?.forEach((shipping) => {
|
66
|
+
actions.push({
|
67
|
+
action: utils_2.ChangeActionType.SHIPPING_REMOVE,
|
68
|
+
order_id: exchangeOrder.order_id,
|
69
|
+
exchange_id: exchangeOrder.id,
|
70
|
+
return_id: exchangeOrder.return.id,
|
71
|
+
reference: "exchange",
|
72
|
+
reference_id: shipping.id,
|
73
|
+
amount: shipping.price,
|
74
|
+
});
|
75
|
+
});
|
76
|
+
const [change] = await createOrderChange(this, data, exchangeOrder, actions, sharedContext);
|
77
|
+
await (0, utils_1.promiseAll)([
|
78
|
+
this.updateExchanges([
|
79
|
+
{
|
80
|
+
data: {
|
81
|
+
canceled_at: new Date(),
|
82
|
+
},
|
83
|
+
selector: {
|
84
|
+
id: exchangeOrder.id,
|
85
|
+
},
|
86
|
+
},
|
87
|
+
], sharedContext),
|
88
|
+
this.confirmOrderChange(change.id, sharedContext),
|
89
|
+
]);
|
90
|
+
return exchangeOrder;
|
91
|
+
}
|
92
|
+
exports.cancelExchange = cancelExchange;
|
93
|
+
//# sourceMappingURL=cancel-exchange.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cancel-exchange.js","sourceRoot":"","sources":["../../../src/services/actions/cancel-exchange.ts"],"names":[],"mappings":";;;AAKA,2CAA4C;AAC5C,uCAA8C;AAE9C,KAAK,UAAU,iBAAiB,CAC9B,OAAO,EACP,IAAI,EACJ,SAAS,EACT,OAAO,EACP,aAAa;IAEb,OAAO,MAAM,OAAO,CAAC,kBAAkB,CACrC;QACE,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,WAAW,EAAE,SAAS,CAAC,EAAE;QACzB,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,SAAS,CAAC,EAAE;QAC1B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU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 +1,73 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.cancelReturn = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
const utils_2 = require("../../utils");
|
6
|
+
async function createOrderChange(service, data, returnRef, actions, sharedContext) {
|
7
|
+
return await service.createOrderChange_({
|
8
|
+
order_id: returnRef.order_id,
|
9
|
+
return_id: returnRef.id,
|
10
|
+
reference: "return",
|
11
|
+
reference_id: returnRef.id,
|
12
|
+
description: data.description,
|
13
|
+
internal_note: data.internal_note,
|
14
|
+
created_by: data.created_by,
|
15
|
+
metadata: data.metadata,
|
16
|
+
actions,
|
17
|
+
}, sharedContext);
|
18
|
+
}
|
19
|
+
async function cancelReturn(data, sharedContext) {
|
20
|
+
const returnOrder = await this.retrieveReturn(data.return_id, {
|
21
|
+
select: [
|
22
|
+
"id",
|
23
|
+
"order_id",
|
24
|
+
"items.item_id",
|
25
|
+
"items.quantity",
|
26
|
+
"items.received_quantity",
|
27
|
+
],
|
28
|
+
relations: ["items", "shipping_methods"],
|
29
|
+
}, sharedContext);
|
30
|
+
const actions = [];
|
31
|
+
returnOrder.items.forEach((item) => {
|
32
|
+
actions.push({
|
33
|
+
action: utils_2.ChangeActionType.CANCEL_RETURN_ITEM,
|
34
|
+
order_id: returnOrder.order_id,
|
35
|
+
return_id: returnOrder.id,
|
36
|
+
reference: "return",
|
37
|
+
reference_id: returnOrder.id,
|
38
|
+
details: {
|
39
|
+
reference_id: item.item_id,
|
40
|
+
order_id: returnOrder.order_id,
|
41
|
+
return_id: returnOrder.id,
|
42
|
+
quantity: item.quantity,
|
43
|
+
},
|
44
|
+
});
|
45
|
+
});
|
46
|
+
returnOrder.shipping_methods?.forEach((shipping) => {
|
47
|
+
actions.push({
|
48
|
+
action: utils_2.ChangeActionType.SHIPPING_REMOVE,
|
49
|
+
order_id: returnOrder.order_id,
|
50
|
+
return_id: returnOrder.id,
|
51
|
+
reference: "return",
|
52
|
+
reference_id: shipping.id,
|
53
|
+
amount: shipping.price,
|
54
|
+
});
|
55
|
+
});
|
56
|
+
const [change] = await createOrderChange(this, data, returnOrder, actions, sharedContext);
|
57
|
+
await (0, utils_1.promiseAll)([
|
58
|
+
this.updateReturns([
|
59
|
+
{
|
60
|
+
data: {
|
61
|
+
canceled_at: new Date(),
|
62
|
+
},
|
63
|
+
selector: {
|
64
|
+
id: returnOrder.id,
|
65
|
+
},
|
66
|
+
},
|
67
|
+
], sharedContext),
|
68
|
+
this.confirmOrderChange(change.id, sharedContext),
|
69
|
+
]);
|
70
|
+
return returnOrder;
|
71
|
+
}
|
72
|
+
exports.cancelReturn = cancelReturn;
|
73
|
+
//# sourceMappingURL=cancel-return.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cancel-return.js","sourceRoot":"","sources":["../../../src/services/actions/cancel-return.ts"],"names":[],"mappings":";;;AAKA,2CAA4C;AAC5C,uCAA8C;AAE9C,KAAK,UAAU,iBAAiB,CAC9B,OAAO,EACP,IAAI,EACJ,SAAS,EACT,OAAO,EACP,aAAa;IAEb,OAAO,MAAM,OAAO,CAAC,kBAAkB,CACrC;QACE,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,SAAS,EAAE,SAAS,CAAC,EAAE;QACvB,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,SAAS,CAAC,EAAE;QAC1B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,OAAO;KACR,EACD,aAAa,CACd,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,YAAY,CAEhC,IAAqC,EACrC,aAAuB;IAEvB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAC3C,IAAI,CAAC,SAAS,EACd;QACE,MAAM,EAAE;YACN,IAAI;YACJ,UAA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,IAAI,IAAI,EAAE;iBACxB;gBACD,QAAQ,EAAE;oBACR,EAAE,EAAE,WAAW,CAAC,EAAE;iBACnB;aACF;SACF,EACD,aAAa,CACd;QACD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC;KAClD,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC;AA3ED,oCA2EC"}
|
@@ -139,9 +139,9 @@ async function processShippingMethods(service, data, claimReference, actions, sh
|
|
139
139
|
if (!(0, utils_1.isString)(shippingMethod)) {
|
140
140
|
const methods = await service.createShippingMethods([
|
141
141
|
{
|
142
|
+
...shippingMethod,
|
142
143
|
order_id: data.order_id,
|
143
144
|
claim_id: claimReference.id,
|
144
|
-
...shippingMethod,
|
145
145
|
},
|
146
146
|
], sharedContext);
|
147
147
|
shippingMethodId = methods[0].id;
|
@@ -169,10 +169,10 @@ async function processReturnShipping(service, data, claimReference, returnRefere
|
|
169
169
|
if (!(0, utils_1.isString)(data.return_shipping)) {
|
170
170
|
const methods = await service.createShippingMethods([
|
171
171
|
{
|
172
|
+
...data.return_shipping,
|
172
173
|
order_id: data.order_id,
|
173
174
|
claim_id: claimReference.id,
|
174
175
|
return_id: returnReference.id,
|
175
|
-
...data.return_shipping,
|
176
176
|
},
|
177
177
|
], sharedContext);
|
178
178
|
returnShippingMethodId = methods[0].id;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-claim.js","sourceRoot":"","sources":["../../../src/services/actions/create-claim.ts"],"names":[],"mappings":";;;AAKA,2CAMwB;AACxB,qCAAmE;AACnE,mCAAwC;AACxC,uCAA8C;AAE9C,SAAS,4BAA4B,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK;IACnD,MAAM,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC,oBAAU,EAAE;QAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,aAAa,EAAE,KAAK,CAAC,OAAO;QAC5B,IAAI,EAAE,IAAI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AAK;QAClC,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,cAAc,CAAC,EAAE;QAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,OAAO;KACR,EACD,aAAa,CACd,CAAA;IAED,MAAM,IAAA,kBAAU,EAAC;QACf,IAAI,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC;QACpD,IAAI,CAAC,iBAAiB,CAAC,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC;QACvD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,aAAa,CAAC;KACrD,CAAC,CAAA;IAEF,OAAO,cAAc,CAAA;AACvB,CAAC;AAjFD,kCAiFC"}
|
@@ -113,9 +113,9 @@ async function processShippingMethods(service, data, exchangeReference, actions,
|
|
113
113
|
if (!(0, utils_1.isString)(shippingMethod)) {
|
114
114
|
const methods = await service.createShippingMethods([
|
115
115
|
{
|
116
|
+
...shippingMethod,
|
116
117
|
order_id: data.order_id,
|
117
118
|
exchange_id: exchangeReference.id,
|
118
|
-
...shippingMethod,
|
119
119
|
},
|
120
120
|
], sharedContext);
|
121
121
|
shippingMethodId = methods[0].id;
|
@@ -139,10 +139,10 @@ async function processReturnShipping(service, data, exchangeReference, returnRef
|
|
139
139
|
if (!(0, utils_1.isString)(data.return_shipping)) {
|
140
140
|
const methods = await service.createShippingMethods([
|
141
141
|
{
|
142
|
+
...data.return_shipping,
|
142
143
|
order_id: data.order_id,
|
143
144
|
exchange_id: exchangeReference.id,
|
144
145
|
return_id: returnReference.id,
|
145
|
-
...data.return_shipping,
|
146
146
|
},
|
147
147
|
], sharedContext);
|
148
148
|
returnShippingMethodId = methods[0].id;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-exchange.js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+41,15 @@ function createReturnItems(em, data, returnRef, actions) {
|
|
41
41
|
}
|
42
42
|
async function processShippingMethod(service, data, returnRef, actions, sharedContext) {
|
43
43
|
let shippingMethodId;
|
44
|
+
if (!(0, utils_1.isDefined)(data.shipping_method)) {
|
45
|
+
return;
|
46
|
+
}
|
44
47
|
if (!(0, utils_1.isString)(data.shipping_method)) {
|
45
48
|
const methods = await service.createShippingMethods([
|
46
49
|
{
|
50
|
+
...data.shipping_method,
|
47
51
|
order_id: data.order_id,
|
48
52
|
return_id: returnRef.id,
|
49
|
-
...data.shipping_method,
|
50
53
|
},
|
51
54
|
], sharedContext);
|
52
55
|
shippingMethodId = methods[0].id;
|
@@ -61,8 +64,11 @@ async function processShippingMethod(service, data, returnRef, actions, sharedCo
|
|
61
64
|
action: utils_2.ChangeActionType.SHIPPING_ADD,
|
62
65
|
reference: "order_shipping_method",
|
63
66
|
reference_id: shippingMethodId,
|
64
|
-
return_id: returnRef.id,
|
65
67
|
amount: calculatedAmount.total,
|
68
|
+
details: {
|
69
|
+
order_id: returnRef.order_id,
|
70
|
+
return_id: returnRef.id,
|
71
|
+
},
|
66
72
|
});
|
67
73
|
}
|
68
74
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-return.js","sourceRoot":"","sources":["../../../src/services/actions/create-return.ts"],"names":[],"mappings":";;;AAKA,
|
1
|
+
{"version":3,"file":"create-return.js","sourceRoot":"","sources":["../../../src/services/actions/create-return.ts"],"names":[],"mappings":";;;AAKA,2CAMwB;AACxB,qCAA4C;AAC5C,mCAAwC;AACxC,uCAA8C;AAE9C,SAAS,qBAAqB,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK;IAC5C,OAAO,EAAE,CAAC,MAAM,CAAC,gBAAM,EAAE;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,aAAa,EAAE,KAAK,CAAC,OAAO;QAC5B,MAAM,EAAE,oBAAY,CAAC,SAAS;QAC9B,eAAe,EAAE,IAAI,CA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ototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./cancel-claim"), exports);
|
18
|
+
__exportStar(require("./cancel-exchange"), exports);
|
17
19
|
__exportStar(require("./cancel-fulfillment"), exports);
|
20
|
+
__exportStar(require("./cancel-return"), exports);
|
18
21
|
__exportStar(require("./create-claim"), exports);
|
19
22
|
__exportStar(require("./create-exchange"), exports);
|
20
23
|
__exportStar(require("./create-return"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,iDAA8B;AAC9B,oDAAiC;AACjC,kDAA+B;AAC/B,mDAAgC;AAChC,yDAAsC;AACtC,sDAAmC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,oDAAiC;AACjC,uDAAoC;AACpC,kDAA+B;AAC/B,iDAA8B;AAC9B,oDAAiC;AACjC,kDAA+B;AAC/B,mDAAgC;AAChC,yDAAsC;AACtC,sDAAmC"}
|
@@ -3,8 +3,8 @@ import { OrderChange } from "../models";
|
|
3
3
|
type InjectedDependencies = {
|
4
4
|
orderChangeRepository: DAL.RepositoryService;
|
5
5
|
};
|
6
|
-
declare const OrderChangeService_base: new
|
7
|
-
export default class OrderChangeService extends OrderChangeService_base
|
6
|
+
declare const OrderChangeService_base: new (container: InjectedDependencies) => import("@medusajs/types").IMedusaInternalService<OrderChange, InjectedDependencies>;
|
7
|
+
export default class OrderChangeService extends OrderChangeService_base {
|
8
8
|
protected readonly orderChangeRepository_: RepositoryService<OrderChange>;
|
9
9
|
constructor(container: InjectedDependencies);
|
10
10
|
listCurrentOrderChange<TEntityMethod = OrderTypes.OrderDTO>(orderId: string | string[], config?: FindConfig<TEntityMethod>, sharedContext?: Context): Promise<OrderChange[]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order-change-service.js","sourceRoot":"","sources":["../../src/services/order-change-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,2CAOwB;AACxB,qCAAqC;AACrC,mCAA0C;AAM1C,MAAqB,kBAAmB,SAAQ,uBAAe,CAAC,qBAAqB,
|
1
|
+
{"version":3,"file":"order-change-service.js","sourceRoot":"","sources":["../../src/services/order-change-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,2CAOwB;AACxB,qCAAqC;AACrC,mCAA0C;AAM1C,MAAqB,kBAAmB,SAAQ,uBAAe,CAAC,qBAAqB,CAGnF,qBAAW,CAAC;IAGZ,YAAY,SAA+B;QACzC,aAAa;QACb,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;QACnB,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC,qBAAqB,CAAA;IAC/D,CAAC;IAGK,AAAN,KAAK,CAAC,sBAAsB,CAC1B,OAA0B,EAC1B,SAAoC,EAAE,EACrB,gBAAyB,EAAE;QAE5C,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,IAAI,CACjC,EAAE,QAAQ,EAAE,OAAO,EAAE,EACrB,MAAM,IAAI;YACR,MAAM,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC;YACzC,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,MAAM;aAChB;SACF,CACF,CAAA;QACD,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YACvB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,WAAW,GAAa,EAAE,CAAA;QAEhC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,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