@medusajs/order 0.1.3-snapshot-20240718073308 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +8 -6
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/joiner-config.d.ts +5 -0
- package/dist/joiner-config.js +36 -0
- package/dist/joiner-config.js.map +1 -0
- package/dist/migrations/Migration20240219102530.d.ts +0 -1
- package/dist/migrations/Migration20240219102530.js +4 -38
- package/dist/migrations/Migration20240219102530.js.map +1 -1
- package/dist/models/address.d.ts +1 -2
- package/dist/models/adjustment-line.d.ts +1 -3
- package/dist/models/adjustment-line.js +0 -5
- package/dist/models/adjustment-line.js.map +1 -1
- package/dist/models/index.d.ts +0 -9
- package/dist/models/index.js +1 -17
- package/dist/models/index.js.map +1 -1
- package/dist/models/line-item-adjustment.d.ts +1 -3
- package/dist/models/line-item-adjustment.js +3 -3
- package/dist/models/line-item-adjustment.js.map +1 -1
- package/dist/models/line-item-tax-line.d.ts +1 -3
- package/dist/models/line-item-tax-line.js +3 -3
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +1 -3
- package/dist/models/line-item.js +4 -18
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/order-change-action.d.ts +4 -15
- package/dist/models/order-change-action.js +7 -102
- package/dist/models/order-change-action.js.map +1 -1
- package/dist/models/order-change.d.ts +5 -17
- package/dist/models/order-change.js +4 -109
- package/dist/models/order-change.js.map +1 -1
- package/dist/models/order-item.d.ts +4 -5
- package/dist/models/order-item.js +13 -13
- package/dist/models/order-item.js.map +1 -1
- package/dist/models/order-shipping-method.d.ts +4 -14
- package/dist/models/order-shipping-method.js +13 -89
- package/dist/models/order-shipping-method.js.map +1 -1
- package/dist/models/order-summary.d.ts +2 -6
- package/dist/models/order-summary.js +6 -9
- package/dist/models/order-summary.js.map +1 -1
- package/dist/models/order.d.ts +4 -6
- package/dist/models/order.js +1 -11
- package/dist/models/order.js.map +1 -1
- package/dist/models/shipping-method-adjustment.d.ts +1 -3
- package/dist/models/shipping-method-adjustment.js +3 -3
- package/dist/models/shipping-method-adjustment.js.map +1 -1
- package/dist/models/shipping-method-tax-line.d.ts +1 -3
- package/dist/models/shipping-method-tax-line.js +3 -3
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/shipping-method.d.ts +0 -2
- package/dist/models/shipping-method.js +4 -17
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/tax-line.d.ts +0 -2
- package/dist/models/tax-line.js +0 -7
- package/dist/models/tax-line.js.map +1 -1
- package/dist/models/transaction.d.ts +3 -15
- package/dist/models/transaction.js +4 -109
- package/dist/models/transaction.js.map +1 -1
- package/dist/module-definition.d.ts +2 -0
- package/dist/module-definition.js +59 -0
- package/dist/module-definition.js.map +1 -0
- package/dist/repositories/index.d.ts +1 -4
- package/dist/repositories/index.js +16 -7
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/order.d.ts +3 -1
- package/dist/repositories/order.js +85 -2
- package/dist/repositories/order.js.map +1 -1
- package/dist/scripts/bin/run-seed.d.ts +3 -0
- package/dist/scripts/bin/run-seed.js +49 -0
- package/dist/scripts/bin/run-seed.js.map +1 -0
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +3 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/order-change-service.d.ts +15 -0
- package/dist/services/order-change-service.js +96 -0
- package/dist/services/order-change-service.js.map +1 -0
- package/dist/services/order-module-service.d.ts +67 -138
- package/dist/services/order-module-service.js +240 -990
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/services/order-service.d.ts +4 -5
- package/dist/services/order-service.js +1 -1
- package/dist/services/order-service.js.map +1 -1
- package/dist/types/address.d.ts +0 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/line-item-adjustment.d.ts +0 -1
- package/dist/types/line-item-tax-line.d.ts +0 -1
- package/dist/types/line-item.d.ts +0 -1
- package/dist/types/order-detail.d.ts +1 -2
- package/dist/types/order.d.ts +2 -3
- package/dist/types/shipping-method-adjustment.d.ts +0 -1
- package/dist/types/shipping-method-tax-line.d.ts +0 -1
- package/dist/types/shipping-method.d.ts +0 -4
- package/dist/types/tax-line.d.ts +0 -1
- package/dist/types/transaction.d.ts +0 -1
- package/dist/types/utils/index.d.ts +11 -43
- package/dist/types/utils/index.js.map +1 -1
- package/dist/utils/action-key.d.ts +13 -0
- package/dist/utils/action-key.js +18 -0
- package/dist/utils/action-key.js.map +1 -0
- package/dist/utils/actions/cancel-return.d.ts +0 -1
- package/dist/utils/actions/cancel-return.js +6 -7
- package/dist/utils/actions/cancel-return.js.map +1 -1
- package/dist/utils/actions/cancel.d.ts +0 -1
- package/dist/utils/actions/cancel.js +2 -2
- package/dist/utils/actions/cancel.js.map +1 -1
- package/dist/utils/actions/fulfill-item.d.ts +0 -1
- package/dist/utils/actions/fulfill-item.js +6 -7
- package/dist/utils/actions/fulfill-item.js.map +1 -1
- package/dist/utils/actions/index.d.ts +0 -4
- package/dist/utils/actions/index.js +0 -3
- package/dist/utils/actions/index.js.map +1 -1
- package/dist/utils/actions/item-add.d.ts +0 -1
- package/dist/utils/actions/item-add.js +14 -17
- package/dist/utils/actions/item-add.js.map +1 -1
- package/dist/utils/actions/item-remove.d.ts +0 -1
- package/dist/utils/actions/item-remove.js +10 -11
- package/dist/utils/actions/item-remove.js.map +1 -1
- package/dist/utils/actions/receive-damaged-return-item.d.ts +0 -1
- package/dist/utils/actions/receive-damaged-return-item.js +7 -8
- package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
- package/dist/utils/actions/receive-return-item.d.ts +0 -1
- package/dist/utils/actions/receive-return-item.js +7 -8
- package/dist/utils/actions/receive-return-item.js.map +1 -1
- package/dist/utils/actions/return-item.d.ts +0 -1
- package/dist/utils/actions/return-item.js +8 -9
- package/dist/utils/actions/return-item.js.map +1 -1
- package/dist/utils/actions/ship-item.d.ts +0 -1
- package/dist/utils/actions/ship-item.js +6 -7
- package/dist/utils/actions/ship-item.js.map +1 -1
- package/dist/utils/actions/shipping-add.d.ts +0 -1
- package/dist/utils/actions/shipping-add.js +7 -16
- package/dist/utils/actions/shipping-add.js.map +1 -1
- package/dist/utils/actions/write-off-item.d.ts +0 -1
- package/dist/utils/actions/write-off-item.js +6 -7
- package/dist/utils/actions/write-off-item.js.map +1 -1
- package/dist/utils/calculate-order-change.d.ts +2 -11
- package/dist/utils/calculate-order-change.js +70 -68
- package/dist/utils/calculate-order-change.js.map +1 -1
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.js +1 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/transform-order.d.ts +2 -4
- package/dist/utils/transform-order.js +17 -131
- package/dist/utils/transform-order.js.map +1 -1
- package/package.json +14 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/migrations/Migration20240219102530.d.ts.map +0 -1
- package/dist/migrations/Migration20240604100512.d.ts +0 -5
- package/dist/migrations/Migration20240604100512.d.ts.map +0 -1
- package/dist/migrations/Migration20240604100512.js +0 -364
- package/dist/migrations/Migration20240604100512.js.map +0 -1
- package/dist/migrations/Migration20240715102100.d.ts +0 -5
- package/dist/migrations/Migration20240715102100.d.ts.map +0 -1
- package/dist/migrations/Migration20240715102100.js +0 -15
- package/dist/migrations/Migration20240715102100.js.map +0 -1
- package/dist/migrations/Migration20240715174100.d.ts +0 -5
- package/dist/migrations/Migration20240715174100.d.ts.map +0 -1
- package/dist/migrations/Migration20240715174100.js +0 -21
- package/dist/migrations/Migration20240715174100.js.map +0 -1
- package/dist/migrations/Migration20240716081800.d.ts +0 -5
- package/dist/migrations/Migration20240716081800.d.ts.map +0 -1
- package/dist/migrations/Migration20240716081800.js +0 -67
- package/dist/migrations/Migration20240716081800.js.map +0 -1
- package/dist/models/address.d.ts.map +0 -1
- package/dist/models/adjustment-line.d.ts.map +0 -1
- package/dist/models/claim-item-image.d.ts +0 -19
- package/dist/models/claim-item-image.d.ts.map +0 -1
- package/dist/models/claim-item-image.js +0 -109
- package/dist/models/claim-item-image.js.map +0 -1
- package/dist/models/claim-item.d.ts +0 -29
- package/dist/models/claim-item.d.ts.map +0 -1
- package/dist/models/claim-item.js +0 -156
- package/dist/models/claim-item.js.map +0 -1
- package/dist/models/claim.d.ts +0 -36
- package/dist/models/claim.d.ts.map +0 -1
- package/dist/models/claim.js +0 -195
- package/dist/models/claim.js.map +0 -1
- package/dist/models/exchange-item.d.ts +0 -24
- package/dist/models/exchange-item.d.ts.map +0 -1
- package/dist/models/exchange-item.js +0 -138
- package/dist/models/exchange-item.js.map +0 -1
- package/dist/models/exchange.d.ts +0 -34
- package/dist/models/exchange.d.ts.map +0 -1
- package/dist/models/exchange.js +0 -188
- package/dist/models/exchange.js.map +0 -1
- package/dist/models/index.d.ts.map +0 -1
- package/dist/models/line-item-adjustment.d.ts.map +0 -1
- package/dist/models/line-item-tax-line.d.ts.map +0 -1
- package/dist/models/line-item.d.ts.map +0 -1
- package/dist/models/order-change-action.d.ts.map +0 -1
- package/dist/models/order-change.d.ts.map +0 -1
- package/dist/models/order-item.d.ts.map +0 -1
- package/dist/models/order-shipping-method.d.ts.map +0 -1
- package/dist/models/order-summary.d.ts.map +0 -1
- package/dist/models/order.d.ts.map +0 -1
- package/dist/models/return-item.d.ts +0 -29
- package/dist/models/return-item.d.ts.map +0 -1
- package/dist/models/return-item.js +0 -170
- package/dist/models/return-item.js.map +0 -1
- package/dist/models/return-reason.d.ts +0 -21
- package/dist/models/return-reason.d.ts.map +0 -1
- package/dist/models/return-reason.js +0 -120
- package/dist/models/return-reason.js.map +0 -1
- package/dist/models/return.d.ts +0 -39
- package/dist/models/return.d.ts.map +0 -1
- package/dist/models/return.js +0 -216
- package/dist/models/return.js.map +0 -1
- package/dist/models/shipping-method-adjustment.d.ts.map +0 -1
- package/dist/models/shipping-method-tax-line.d.ts.map +0 -1
- package/dist/models/shipping-method.d.ts.map +0 -1
- package/dist/models/tax-line.d.ts.map +0 -1
- package/dist/models/transaction.d.ts.map +0 -1
- package/dist/repositories/claim.d.ts +0 -9
- package/dist/repositories/claim.d.ts.map +0 -1
- package/dist/repositories/claim.js +0 -11
- package/dist/repositories/claim.js.map +0 -1
- package/dist/repositories/exchange.d.ts +0 -9
- package/dist/repositories/exchange.d.ts.map +0 -1
- package/dist/repositories/exchange.js +0 -11
- package/dist/repositories/exchange.js.map +0 -1
- package/dist/repositories/index.d.ts.map +0 -1
- package/dist/repositories/order.d.ts.map +0 -1
- package/dist/repositories/return.d.ts +0 -9
- package/dist/repositories/return.d.ts.map +0 -1
- package/dist/repositories/return.js +0 -11
- package/dist/repositories/return.js.map +0 -1
- package/dist/services/actions/cancel-claim.d.ts +0 -3
- package/dist/services/actions/cancel-claim.d.ts.map +0 -1
- package/dist/services/actions/cancel-claim.js +0 -107
- package/dist/services/actions/cancel-claim.js.map +0 -1
- package/dist/services/actions/cancel-exchange.d.ts +0 -3
- package/dist/services/actions/cancel-exchange.d.ts.map +0 -1
- package/dist/services/actions/cancel-exchange.js +0 -92
- package/dist/services/actions/cancel-exchange.js.map +0 -1
- package/dist/services/actions/cancel-fulfillment.d.ts +0 -3
- package/dist/services/actions/cancel-fulfillment.d.ts.map +0 -1
- package/dist/services/actions/cancel-fulfillment.js +0 -32
- package/dist/services/actions/cancel-fulfillment.js.map +0 -1
- package/dist/services/actions/cancel-return.d.ts +0 -3
- package/dist/services/actions/cancel-return.d.ts.map +0 -1
- package/dist/services/actions/cancel-return.js +0 -72
- package/dist/services/actions/cancel-return.js.map +0 -1
- package/dist/services/actions/create-claim.d.ts +0 -3
- package/dist/services/actions/create-claim.d.ts.map +0 -1
- package/dist/services/actions/create-claim.js +0 -228
- package/dist/services/actions/create-claim.js.map +0 -1
- package/dist/services/actions/create-exchange.d.ts +0 -3
- package/dist/services/actions/create-exchange.d.ts.map +0 -1
- package/dist/services/actions/create-exchange.js +0 -193
- package/dist/services/actions/create-exchange.js.map +0 -1
- package/dist/services/actions/create-return.d.ts +0 -3
- package/dist/services/actions/create-return.d.ts.map +0 -1
- package/dist/services/actions/create-return.js +0 -102
- package/dist/services/actions/create-return.js.map +0 -1
- package/dist/services/actions/index.d.ts +0 -11
- package/dist/services/actions/index.d.ts.map +0 -1
- package/dist/services/actions/index.js +0 -27
- package/dist/services/actions/index.js.map +0 -1
- package/dist/services/actions/receive-return.d.ts +0 -3
- package/dist/services/actions/receive-return.d.ts.map +0 -1
- package/dist/services/actions/receive-return.js +0 -73
- package/dist/services/actions/receive-return.js.map +0 -1
- package/dist/services/actions/register-fulfillment.d.ts +0 -3
- package/dist/services/actions/register-fulfillment.d.ts.map +0 -1
- package/dist/services/actions/register-fulfillment.js +0 -30
- package/dist/services/actions/register-fulfillment.js.map +0 -1
- package/dist/services/actions/register-shipment.d.ts +0 -3
- package/dist/services/actions/register-shipment.d.ts.map +0 -1
- package/dist/services/actions/register-shipment.js +0 -38
- package/dist/services/actions/register-shipment.js.map +0 -1
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services/order-module-service.d.ts.map +0 -1
- package/dist/services/order-service.d.ts.map +0 -1
- package/dist/types/address.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/line-item-adjustment.d.ts.map +0 -1
- package/dist/types/line-item-tax-line.d.ts.map +0 -1
- package/dist/types/line-item.d.ts.map +0 -1
- package/dist/types/order-change.d.ts +0 -6
- package/dist/types/order-change.d.ts.map +0 -1
- package/dist/types/order-change.js +0 -3
- package/dist/types/order-change.js.map +0 -1
- package/dist/types/order-detail.d.ts.map +0 -1
- package/dist/types/order.d.ts.map +0 -1
- package/dist/types/shipping-method-adjustment.d.ts.map +0 -1
- package/dist/types/shipping-method-tax-line.d.ts.map +0 -1
- package/dist/types/shipping-method.d.ts.map +0 -1
- package/dist/types/tax-line.d.ts.map +0 -1
- package/dist/types/transaction.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/utils/actions/cancel-item-fulfillment.d.ts +0 -2
- package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +0 -1
- package/dist/utils/actions/cancel-item-fulfillment.js +0 -39
- package/dist/utils/actions/cancel-item-fulfillment.js.map +0 -1
- package/dist/utils/actions/cancel-return.d.ts.map +0 -1
- package/dist/utils/actions/cancel.d.ts.map +0 -1
- package/dist/utils/actions/fulfill-item.d.ts.map +0 -1
- package/dist/utils/actions/index.d.ts.map +0 -1
- package/dist/utils/actions/item-add.d.ts.map +0 -1
- package/dist/utils/actions/item-remove.d.ts.map +0 -1
- package/dist/utils/actions/receive-damaged-return-item.d.ts.map +0 -1
- package/dist/utils/actions/receive-return-item.d.ts.map +0 -1
- package/dist/utils/actions/reinstate-item.d.ts +0 -2
- package/dist/utils/actions/reinstate-item.d.ts.map +0 -1
- package/dist/utils/actions/reinstate-item.js +0 -37
- package/dist/utils/actions/reinstate-item.js.map +0 -1
- package/dist/utils/actions/return-item.d.ts.map +0 -1
- package/dist/utils/actions/ship-item.d.ts.map +0 -1
- package/dist/utils/actions/shipping-add.d.ts.map +0 -1
- package/dist/utils/actions/shipping-remove.d.ts +0 -2
- package/dist/utils/actions/shipping-remove.d.ts.map +0 -1
- package/dist/utils/actions/shipping-remove.js +0 -41
- package/dist/utils/actions/shipping-remove.js.map +0 -1
- package/dist/utils/actions/write-off-item.d.ts.map +0 -1
- package/dist/utils/apply-order-changes.d.ts +0 -18
- package/dist/utils/apply-order-changes.d.ts.map +0 -1
- package/dist/utils/apply-order-changes.js +0 -95
- package/dist/utils/apply-order-changes.js.map +0 -1
- package/dist/utils/base-repository-find.d.ts +0 -3
- package/dist/utils/base-repository-find.d.ts.map +0 -1
- package/dist/utils/base-repository-find.js +0 -142
- package/dist/utils/base-repository-find.js.map +0 -1
- package/dist/utils/calculate-order-change.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/set-action-reference.d.ts +0 -3
- package/dist/utils/set-action-reference.d.ts.map +0 -1
- package/dist/utils/set-action-reference.js +0 -17
- package/dist/utils/set-action-reference.js.map +0 -1
- package/dist/utils/transform-order.d.ts.map +0 -1
@@ -1,107 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.cancelClaim = void 0;
|
4
|
-
const utils_1 = require("@medusajs/utils");
|
5
|
-
async function createOrderChange(service, data, returnRef, actions, sharedContext) {
|
6
|
-
return await service.createOrderChange_({
|
7
|
-
order_id: returnRef.order_id,
|
8
|
-
claim_id: returnRef.id,
|
9
|
-
reference: "return",
|
10
|
-
reference_id: returnRef.id,
|
11
|
-
description: data.description,
|
12
|
-
internal_note: data.internal_note,
|
13
|
-
created_by: data.created_by,
|
14
|
-
metadata: data.metadata,
|
15
|
-
actions,
|
16
|
-
}, sharedContext);
|
17
|
-
}
|
18
|
-
async function cancelClaim(data, sharedContext) {
|
19
|
-
const claimOrder = await this.retrieveClaim(data.claim_id, {
|
20
|
-
select: [
|
21
|
-
"id",
|
22
|
-
"order_id",
|
23
|
-
"return.id",
|
24
|
-
"return.items.id",
|
25
|
-
"return.items.quantity",
|
26
|
-
"claim_items.item_id",
|
27
|
-
"claim_items.quantity",
|
28
|
-
"additional_items.id",
|
29
|
-
"additional_items.quantity",
|
30
|
-
],
|
31
|
-
relations: ["return.items", "additional_items", "shipping_methods"],
|
32
|
-
}, sharedContext);
|
33
|
-
const actions = [];
|
34
|
-
claimOrder.return.items.forEach((item) => {
|
35
|
-
actions.push({
|
36
|
-
action: utils_1.ChangeActionType.CANCEL_RETURN_ITEM,
|
37
|
-
order_id: claimOrder.order_id,
|
38
|
-
claim_id: claimOrder.id,
|
39
|
-
return_id: claimOrder.return.id,
|
40
|
-
reference: "return",
|
41
|
-
reference_id: claimOrder.return.id,
|
42
|
-
details: {
|
43
|
-
reference_id: item.id,
|
44
|
-
order_id: claimOrder.order_id,
|
45
|
-
claim_id: claimOrder.id,
|
46
|
-
return_id: claimOrder.return.id,
|
47
|
-
quantity: item.quantity,
|
48
|
-
},
|
49
|
-
});
|
50
|
-
});
|
51
|
-
claimOrder.claim_items.forEach((item) => {
|
52
|
-
actions.push({
|
53
|
-
action: utils_1.ChangeActionType.REINSTATE_ITEM,
|
54
|
-
claim_id: claimOrder.id,
|
55
|
-
reference: "claim",
|
56
|
-
reference_id: claimOrder.id,
|
57
|
-
details: {
|
58
|
-
reference_id: item.id,
|
59
|
-
claim_id: claimOrder.id,
|
60
|
-
quantity: item.quantity,
|
61
|
-
},
|
62
|
-
});
|
63
|
-
});
|
64
|
-
claimOrder.additional_items.forEach((item) => {
|
65
|
-
actions.push({
|
66
|
-
action: utils_1.ChangeActionType.ITEM_REMOVE,
|
67
|
-
order_id: claimOrder.order_id,
|
68
|
-
claim_id: claimOrder.id,
|
69
|
-
reference: "claim",
|
70
|
-
reference_id: claimOrder.id,
|
71
|
-
details: {
|
72
|
-
reference_id: item.id,
|
73
|
-
order_id: claimOrder.order_id,
|
74
|
-
claim_id: claimOrder.id,
|
75
|
-
quantity: item.quantity,
|
76
|
-
},
|
77
|
-
});
|
78
|
-
});
|
79
|
-
claimOrder.shipping_methods?.forEach((shipping) => {
|
80
|
-
actions.push({
|
81
|
-
action: utils_1.ChangeActionType.SHIPPING_REMOVE,
|
82
|
-
order_id: claimOrder.order_id,
|
83
|
-
claim_id: claimOrder.id,
|
84
|
-
return_id: claimOrder.return.id,
|
85
|
-
reference: "claim",
|
86
|
-
reference_id: shipping.id,
|
87
|
-
amount: shipping.price,
|
88
|
-
});
|
89
|
-
});
|
90
|
-
const [change] = await createOrderChange(this, data, claimOrder, actions, sharedContext);
|
91
|
-
await (0, utils_1.promiseAll)([
|
92
|
-
this.updateClaims([
|
93
|
-
{
|
94
|
-
data: {
|
95
|
-
canceled_at: new Date(),
|
96
|
-
},
|
97
|
-
selector: {
|
98
|
-
id: claimOrder.id,
|
99
|
-
},
|
100
|
-
},
|
101
|
-
], sharedContext),
|
102
|
-
this.confirmOrderChange(change.id, sharedContext),
|
103
|
-
]);
|
104
|
-
return claimOrder;
|
105
|
-
}
|
106
|
-
exports.cancelClaim = cancelClaim;
|
107
|
-
//# sourceMappingURL=cancel-claim.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel-claim.js","sourceRoot":"","sources":["../../../src/services/actions/cancel-claim.ts"],"names":[],"mappings":";;;AAKA,2CAA8D;AAE9D,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,QAAQ,EAAE,SAAS,CAAC,EAAE;QACtB,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,WAAW,CAE/B,IAAoC,EACpC,aAAuB;IAEvB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CACzC,IAAI,CAAC,QAAQ,EACb;QACE,MAAM,EAAE;YACN,IAAI;YACJ,UAAU;YACV,WAAW;YACX,iBAAiB;YACjB,uBAAuB;YACvB,qBAAqB;YACrB,sBAAsB;YACtB,qBAAqB;YACrB,2BAA2B;SAC5B;QACD,SAAS,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,CAAC;KACpE,EACD,aAAa,CACd,CAAA;IAED,MAAM,OAAO,GAAiC,EAAE,CAAA;IAEhD,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACvC,OAAO,CAAC,IAAI,CAAC;YACX,MAAM,EAAE,wBAAgB,CAAC,kBAAkB;YAC3C,QAAQ,EAAE,UAAU,CAAC,QAAQ;YA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BAAsB,EACvC,aAAa,CAAC,EAAE,OAAO,gBA6FxB"}
|
@@ -1,92 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.cancelExchange = void 0;
|
4
|
-
const utils_1 = require("@medusajs/utils");
|
5
|
-
async function createOrderChange(service, data, returnRef, actions, sharedContext) {
|
6
|
-
return await service.createOrderChange_({
|
7
|
-
order_id: returnRef.order_id,
|
8
|
-
exchange_id: returnRef.id,
|
9
|
-
reference: "return",
|
10
|
-
reference_id: returnRef.id,
|
11
|
-
description: data.description,
|
12
|
-
internal_note: data.internal_note,
|
13
|
-
created_by: data.created_by,
|
14
|
-
metadata: data.metadata,
|
15
|
-
actions,
|
16
|
-
}, sharedContext);
|
17
|
-
}
|
18
|
-
async function cancelExchange(data, sharedContext) {
|
19
|
-
const exchangeOrder = await this.retrieveExchange(data.exchange_id, {
|
20
|
-
select: [
|
21
|
-
"id",
|
22
|
-
"order_id",
|
23
|
-
"return.id",
|
24
|
-
"return.items.item_id",
|
25
|
-
"return.items.quantity",
|
26
|
-
"additional_items.id",
|
27
|
-
"additional_items.quantity",
|
28
|
-
],
|
29
|
-
relations: ["return.items", "additional_items", "shipping_methods"],
|
30
|
-
}, sharedContext);
|
31
|
-
const actions = [];
|
32
|
-
exchangeOrder.return.items.forEach((item) => {
|
33
|
-
actions.push({
|
34
|
-
action: utils_1.ChangeActionType.CANCEL_RETURN_ITEM,
|
35
|
-
order_id: exchangeOrder.order_id,
|
36
|
-
exchange_id: exchangeOrder.id,
|
37
|
-
return_id: exchangeOrder.return.id,
|
38
|
-
reference: "return",
|
39
|
-
reference_id: exchangeOrder.return.id,
|
40
|
-
details: {
|
41
|
-
reference_id: item.item_id,
|
42
|
-
order_id: exchangeOrder.order_id,
|
43
|
-
exchange_id: exchangeOrder.id,
|
44
|
-
return_id: exchangeOrder.return.id,
|
45
|
-
quantity: item.quantity,
|
46
|
-
},
|
47
|
-
});
|
48
|
-
});
|
49
|
-
exchangeOrder.additional_items.forEach((item) => {
|
50
|
-
actions.push({
|
51
|
-
action: utils_1.ChangeActionType.ITEM_REMOVE,
|
52
|
-
order_id: exchangeOrder.order_id,
|
53
|
-
exchange_id: exchangeOrder.id,
|
54
|
-
reference: "exchange",
|
55
|
-
reference_id: exchangeOrder.id,
|
56
|
-
details: {
|
57
|
-
order_id: exchangeOrder.order_id,
|
58
|
-
reference_id: item.item_id,
|
59
|
-
exchange_id: exchangeOrder.id,
|
60
|
-
quantity: item.quantity,
|
61
|
-
},
|
62
|
-
});
|
63
|
-
});
|
64
|
-
exchangeOrder.shipping_methods?.forEach((shipping) => {
|
65
|
-
actions.push({
|
66
|
-
action: utils_1.ChangeActionType.SHIPPING_REMOVE,
|
67
|
-
order_id: exchangeOrder.order_id,
|
68
|
-
exchange_id: exchangeOrder.id,
|
69
|
-
return_id: exchangeOrder.return.id,
|
70
|
-
reference: "exchange",
|
71
|
-
reference_id: shipping.id,
|
72
|
-
amount: shipping.price,
|
73
|
-
});
|
74
|
-
});
|
75
|
-
const [change] = await createOrderChange(this, data, exchangeOrder, actions, sharedContext);
|
76
|
-
await (0, utils_1.promiseAll)([
|
77
|
-
this.updateExchanges([
|
78
|
-
{
|
79
|
-
data: {
|
80
|
-
canceled_at: new Date(),
|
81
|
-
},
|
82
|
-
selector: {
|
83
|
-
id: exchangeOrder.id,
|
84
|
-
},
|
85
|
-
},
|
86
|
-
], sharedContext),
|
87
|
-
this.confirmOrderChange(change.id, sharedContext),
|
88
|
-
]);
|
89
|
-
return exchangeOrder;
|
90
|
-
}
|
91
|
-
exports.cancelExchange = cancelExchange;
|
92
|
-
//# sourceMappingURL=cancel-exchange.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel-exchange.js","sourceRoot":"","sources":["../../../src/services/actions/cancel-exchange.ts"],"names":[],"mappings":";;;AAKA,2CAA8D;AAE9D,KAAK,UAAU,iBAAiB,CAC9B,OAAO,EACP,IAAI,E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AAC,eAAe,CAClB;YACE;gBACE,IAAI,EAAE;oBACJ,WAAW,EAAE,IAAI,IAAI,EAAE;iBACxB;gBACD,QAAQ,EAAE;oBACR,EAAE,EAAE,aAAa,CAAC,EAAE;iBACrB;aACF;SACF,EACD,aAAa,CACd;QACD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC;KAClD,CAAC,CAAA;IAEF,OAAO,aAAa,CAAA;AACtB,CAAC;AAhGD,wCAgGC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel-fulfillment.d.ts","sourceRoot":"","sources":["../../../src/services/actions/cancel-fulfillment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGrD,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,UAAU,CAAC,yBAAyB,EAC1C,aAAa,CAAC,EAAE,OAAO,GACtB,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.cancelFulfillment = void 0;
|
4
|
-
const utils_1 = require("@medusajs/utils");
|
5
|
-
async function cancelFulfillment(data, sharedContext) {
|
6
|
-
const items = data.items.map((item) => {
|
7
|
-
return {
|
8
|
-
action: utils_1.ChangeActionType.CANCEL_ITEM_FULFILLMENT,
|
9
|
-
internal_note: item.internal_note,
|
10
|
-
reference: data.reference,
|
11
|
-
reference_id: data.reference_id,
|
12
|
-
claim_id: data.claim_id,
|
13
|
-
exchange_id: data.exchange_id,
|
14
|
-
details: {
|
15
|
-
reference_id: item.id,
|
16
|
-
quantity: item.quantity,
|
17
|
-
metadata: item.metadata,
|
18
|
-
},
|
19
|
-
};
|
20
|
-
});
|
21
|
-
const change = await this.createOrderChange_({
|
22
|
-
order_id: data.order_id,
|
23
|
-
description: data.description,
|
24
|
-
internal_note: data.internal_note,
|
25
|
-
created_by: data.created_by,
|
26
|
-
metadata: data.metadata,
|
27
|
-
actions: items,
|
28
|
-
}, sharedContext);
|
29
|
-
await this.confirmOrderChange(change[0].id, sharedContext);
|
30
|
-
}
|
31
|
-
exports.cancelFulfillment = cancelFulfillment;
|
32
|
-
//# sourceMappingURL=cancel-fulfillment.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel-fulfillment.js","sourceRoot":"","sources":["../../../src/services/actions/cancel-fulfillment.ts"],"names":[],"mappings":";;;AACA,2CAAkD;AAE3C,KAAK,UAAU,iBAAiB,CAErC,IAA0C,EAC1C,aAAuB;IAEvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACpC,OAAO;YACL,MAAM,EAAE,wBAAgB,CAAC,uBAAuB;YAChD,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE;gBACP,YAAY,EAAE,IAAI,CAAC,EAAE;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB;SACF,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAC1C;QACE,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,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,EAAE,KAAK;KACf,EACD,aAAa,CACd,CAAA;IAED,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,aAAa,CAAC,CAAA;AAC5D,CAAC;AAlCD,8CAkCC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel-return.d.ts","sourceRoot":"","sources":["../../../src/services/actions/cancel-return.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EACX,MAAM,iBAAiB,CAAA;AA0BxB,wBAAsB,YAAY,CAChC,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,UAAU,CAAC,oBAAoB,EACrC,aAAa,CAAC,EAAE,OAAO,gBAwExB"}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.cancelReturn = void 0;
|
4
|
-
const utils_1 = require("@medusajs/utils");
|
5
|
-
async function createOrderChange(service, data, returnRef, actions, sharedContext) {
|
6
|
-
return await service.createOrderChange_({
|
7
|
-
order_id: returnRef.order_id,
|
8
|
-
return_id: returnRef.id,
|
9
|
-
reference: "return",
|
10
|
-
reference_id: returnRef.id,
|
11
|
-
description: data.description,
|
12
|
-
internal_note: data.internal_note,
|
13
|
-
created_by: data.created_by,
|
14
|
-
metadata: data.metadata,
|
15
|
-
actions,
|
16
|
-
}, sharedContext);
|
17
|
-
}
|
18
|
-
async function cancelReturn(data, sharedContext) {
|
19
|
-
const returnOrder = await this.retrieveReturn(data.return_id, {
|
20
|
-
select: [
|
21
|
-
"id",
|
22
|
-
"order_id",
|
23
|
-
"items.item_id",
|
24
|
-
"items.quantity",
|
25
|
-
"items.received_quantity",
|
26
|
-
],
|
27
|
-
relations: ["items", "shipping_methods"],
|
28
|
-
}, sharedContext);
|
29
|
-
const actions = [];
|
30
|
-
returnOrder.items.forEach((item) => {
|
31
|
-
actions.push({
|
32
|
-
action: utils_1.ChangeActionType.CANCEL_RETURN_ITEM,
|
33
|
-
order_id: returnOrder.order_id,
|
34
|
-
return_id: returnOrder.id,
|
35
|
-
reference: "return",
|
36
|
-
reference_id: returnOrder.id,
|
37
|
-
details: {
|
38
|
-
reference_id: item.item_id,
|
39
|
-
order_id: returnOrder.order_id,
|
40
|
-
return_id: returnOrder.id,
|
41
|
-
quantity: item.quantity,
|
42
|
-
},
|
43
|
-
});
|
44
|
-
});
|
45
|
-
returnOrder.shipping_methods?.forEach((shipping) => {
|
46
|
-
actions.push({
|
47
|
-
action: utils_1.ChangeActionType.SHIPPING_REMOVE,
|
48
|
-
order_id: returnOrder.order_id,
|
49
|
-
return_id: returnOrder.id,
|
50
|
-
reference: "return",
|
51
|
-
reference_id: shipping.id,
|
52
|
-
amount: shipping.price,
|
53
|
-
});
|
54
|
-
});
|
55
|
-
const [change] = await createOrderChange(this, data, returnOrder, actions, sharedContext);
|
56
|
-
await (0, utils_1.promiseAll)([
|
57
|
-
this.updateReturns([
|
58
|
-
{
|
59
|
-
data: {
|
60
|
-
canceled_at: new Date(),
|
61
|
-
},
|
62
|
-
selector: {
|
63
|
-
id: returnOrder.id,
|
64
|
-
},
|
65
|
-
},
|
66
|
-
], sharedContext),
|
67
|
-
this.confirmOrderChange(change.id, sharedContext),
|
68
|
-
]);
|
69
|
-
return returnOrder;
|
70
|
-
}
|
71
|
-
exports.cancelReturn = cancelReturn;
|
72
|
-
//# sourceMappingURL=cancel-return.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel-return.js","sourceRoot":"","sources":["../../../src/services/actions/cancel-return.ts"],"names":[],"mappings":";;;AAKA,2CAA8D;AAE9D,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,EAA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AC,EAAE;YACzB,SAAS,EAAE,QAAQ;YACnB,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,WAAW,EACX,OAAO,EACP,aAAa,CACd,CAAA;IAED,MAAM,IAAA,kBAAU,EAAC;QACf,IAAI,CAAC,aAAa,CAChB;YACE;gBACE,IAAI,EAAE;oBACJ,WAAW,EAAE,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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create-claim.d.ts","sourceRoot":"","sources":["../../../src/services/actions/create-claim.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EACX,MAAM,iBAAiB,CAAA;AAwRxB,wBAAsB,WAAW,CAC/B,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,UAAU,CAAC,mBAAmB,EACpC,aAAa,CAAC,EAAE,OAAO,gBA8ExB"}
|
@@ -1,228 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createClaim = void 0;
|
4
|
-
const utils_1 = require("@medusajs/utils");
|
5
|
-
const _models_1 = require("../../models");
|
6
|
-
function createClaimAndReturnEntities(em, data, order) {
|
7
|
-
const claimReference = em.create(_models_1.OrderClaim, {
|
8
|
-
order_id: data.order_id,
|
9
|
-
order_version: order.version,
|
10
|
-
type: data.type,
|
11
|
-
no_notification: data.no_notification,
|
12
|
-
refund_amount: data.refund_amount ?? null,
|
13
|
-
});
|
14
|
-
const returnReference = data.type === utils_1.ClaimType.REPLACE
|
15
|
-
? em.create(_models_1.Return, {
|
16
|
-
order_id: data.order_id,
|
17
|
-
order_version: order.version,
|
18
|
-
status: utils_1.ReturnStatus.REQUESTED,
|
19
|
-
claim_id: claimReference.id,
|
20
|
-
refund_amount: data.refund_amount ?? null,
|
21
|
-
})
|
22
|
-
: undefined;
|
23
|
-
claimReference.return_id = returnReference?.id;
|
24
|
-
return { claimReference, returnReference };
|
25
|
-
}
|
26
|
-
function createReturnItem(em, item, claimReference, returnReference, actions) {
|
27
|
-
actions.push({
|
28
|
-
action: utils_1.ChangeActionType.RETURN_ITEM,
|
29
|
-
reference: "return",
|
30
|
-
reference_id: returnReference.id,
|
31
|
-
details: {
|
32
|
-
reference_id: item.id,
|
33
|
-
return_id: returnReference.id,
|
34
|
-
claim_id: claimReference.id,
|
35
|
-
quantity: item.quantity,
|
36
|
-
metadata: item.metadata,
|
37
|
-
},
|
38
|
-
});
|
39
|
-
return em.create(_models_1.ReturnItem, {
|
40
|
-
item_id: item.id,
|
41
|
-
return_id: returnReference.id,
|
42
|
-
quantity: item.quantity,
|
43
|
-
note: item.note,
|
44
|
-
metadata: item.metadata,
|
45
|
-
});
|
46
|
-
}
|
47
|
-
function createClaimAndReturnItems(em, data, claimReference, returnReference, actions) {
|
48
|
-
const returnItems = [];
|
49
|
-
const claimItems = data.claim_items?.map((item) => {
|
50
|
-
actions.push({
|
51
|
-
action: utils_1.ChangeActionType.WRITE_OFF_ITEM,
|
52
|
-
reference: "claim",
|
53
|
-
reference_id: claimReference.id,
|
54
|
-
details: {
|
55
|
-
reference_id: item.id,
|
56
|
-
claim_id: claimReference.id,
|
57
|
-
quantity: item.quantity,
|
58
|
-
metadata: item.metadata,
|
59
|
-
},
|
60
|
-
});
|
61
|
-
returnItems.push(returnReference
|
62
|
-
? createReturnItem(em, item, claimReference, returnReference, actions)
|
63
|
-
: undefined);
|
64
|
-
return em.create(_models_1.ClaimItem, {
|
65
|
-
item_id: item.id,
|
66
|
-
reason: item.reason,
|
67
|
-
quantity: item.quantity,
|
68
|
-
note: item.note,
|
69
|
-
metadata: item.metadata,
|
70
|
-
});
|
71
|
-
});
|
72
|
-
return [claimItems, returnItems];
|
73
|
-
}
|
74
|
-
async function processAdditionalItems(em, service, data, order, claimReference, actions, sharedContext) {
|
75
|
-
const itemsToAdd = [];
|
76
|
-
const additionalNewItems = [];
|
77
|
-
const additionalItems = [];
|
78
|
-
data.additional_items?.forEach((item) => {
|
79
|
-
const hasItem = item.id
|
80
|
-
? order.items.find((o) => o.item.id === item.id)
|
81
|
-
: false;
|
82
|
-
if (hasItem) {
|
83
|
-
actions.push({
|
84
|
-
action: utils_1.ChangeActionType.ITEM_ADD,
|
85
|
-
claim_id: claimReference.id,
|
86
|
-
internal_note: item.internal_note,
|
87
|
-
reference: "claim",
|
88
|
-
reference_id: claimReference.id,
|
89
|
-
details: {
|
90
|
-
reference_id: item.id,
|
91
|
-
claim_id: claimReference.id,
|
92
|
-
quantity: item.quantity,
|
93
|
-
metadata: item.metadata,
|
94
|
-
},
|
95
|
-
});
|
96
|
-
additionalItems.push(em.create(_models_1.ClaimItem, {
|
97
|
-
item_id: item.id,
|
98
|
-
quantity: item.quantity,
|
99
|
-
note: item.note,
|
100
|
-
metadata: item.metadata,
|
101
|
-
is_additional_item: true,
|
102
|
-
}));
|
103
|
-
}
|
104
|
-
else {
|
105
|
-
itemsToAdd.push(item);
|
106
|
-
additionalNewItems.push(em.create(_models_1.ClaimItem, {
|
107
|
-
quantity: item.quantity,
|
108
|
-
note: item.note,
|
109
|
-
metadata: item.metadata,
|
110
|
-
is_additional_item: true,
|
111
|
-
}));
|
112
|
-
}
|
113
|
-
});
|
114
|
-
const createItems = await service.lineItemService_.create(itemsToAdd, sharedContext);
|
115
|
-
createItems.forEach((item, index) => {
|
116
|
-
const addedItem = itemsToAdd[index];
|
117
|
-
additionalNewItems[index].item_id = item.id;
|
118
|
-
actions.push({
|
119
|
-
action: utils_1.ChangeActionType.ITEM_ADD,
|
120
|
-
claim_id: claimReference.id,
|
121
|
-
internal_note: addedItem.internal_note,
|
122
|
-
reference: "claim",
|
123
|
-
reference_id: claimReference.id,
|
124
|
-
details: {
|
125
|
-
reference_id: item.id,
|
126
|
-
claim_id: claimReference.id,
|
127
|
-
quantity: addedItem.quantity,
|
128
|
-
unit_price: item.unit_price,
|
129
|
-
metadata: addedItem.metadata,
|
130
|
-
},
|
131
|
-
});
|
132
|
-
});
|
133
|
-
return additionalNewItems.concat(additionalItems);
|
134
|
-
}
|
135
|
-
async function processShippingMethods(service, data, claimReference, actions, sharedContext) {
|
136
|
-
for (const shippingMethod of data.shipping_methods ?? []) {
|
137
|
-
let shippingMethodId;
|
138
|
-
if (!(0, utils_1.isString)(shippingMethod)) {
|
139
|
-
const methods = await service.createShippingMethods([
|
140
|
-
{
|
141
|
-
...shippingMethod,
|
142
|
-
order_id: data.order_id,
|
143
|
-
claim_id: claimReference.id,
|
144
|
-
},
|
145
|
-
], sharedContext);
|
146
|
-
shippingMethodId = methods[0].id;
|
147
|
-
}
|
148
|
-
else {
|
149
|
-
shippingMethodId = shippingMethod;
|
150
|
-
}
|
151
|
-
const method = await service.retrieveShippingMethod(shippingMethodId, { relations: ["tax_lines", "adjustments"] }, sharedContext);
|
152
|
-
const calculatedAmount = (0, utils_1.getShippingMethodsTotals)([method], {})[method.id];
|
153
|
-
actions.push({
|
154
|
-
action: utils_1.ChangeActionType.SHIPPING_ADD,
|
155
|
-
reference: "order_shipping_method",
|
156
|
-
reference_id: shippingMethodId,
|
157
|
-
claim_id: claimReference.id,
|
158
|
-
amount: calculatedAmount.total,
|
159
|
-
});
|
160
|
-
}
|
161
|
-
}
|
162
|
-
async function processReturnShipping(service, data, claimReference, returnReference, actions, sharedContext) {
|
163
|
-
if (!returnReference) {
|
164
|
-
return;
|
165
|
-
}
|
166
|
-
if (data.return_shipping) {
|
167
|
-
let returnShippingMethodId;
|
168
|
-
if (!(0, utils_1.isString)(data.return_shipping)) {
|
169
|
-
const methods = await service.createShippingMethods([
|
170
|
-
{
|
171
|
-
...data.return_shipping,
|
172
|
-
order_id: data.order_id,
|
173
|
-
claim_id: claimReference.id,
|
174
|
-
return_id: returnReference.id,
|
175
|
-
},
|
176
|
-
], sharedContext);
|
177
|
-
returnShippingMethodId = methods[0].id;
|
178
|
-
}
|
179
|
-
else {
|
180
|
-
returnShippingMethodId = data.return_shipping;
|
181
|
-
}
|
182
|
-
const method = await service.retrieveShippingMethod(returnShippingMethodId, { relations: ["tax_lines", "adjustments"] }, sharedContext);
|
183
|
-
const calculatedAmount = (0, utils_1.getShippingMethodsTotals)([method], {})[method.id];
|
184
|
-
actions.push({
|
185
|
-
action: utils_1.ChangeActionType.SHIPPING_ADD,
|
186
|
-
reference: "order_shipping_method",
|
187
|
-
reference_id: returnShippingMethodId,
|
188
|
-
return_id: returnReference.id,
|
189
|
-
claim_id: claimReference.id,
|
190
|
-
amount: calculatedAmount.total,
|
191
|
-
});
|
192
|
-
}
|
193
|
-
}
|
194
|
-
async function createClaim(data, sharedContext) {
|
195
|
-
const order = await this.orderService_.retrieve(data.order_id, { relations: ["items"] }, sharedContext);
|
196
|
-
const actions = [];
|
197
|
-
const em = sharedContext.transactionManager;
|
198
|
-
const { claimReference, returnReference } = createClaimAndReturnEntities(em, data, order);
|
199
|
-
const [claimItems, returnItems] = createClaimAndReturnItems(em, data, claimReference, returnReference, actions);
|
200
|
-
claimReference.claim_items = claimItems;
|
201
|
-
if (returnReference) {
|
202
|
-
returnReference.items = returnItems;
|
203
|
-
}
|
204
|
-
claimReference.additional_items = await processAdditionalItems(em, this, data, order, claimReference, actions, sharedContext);
|
205
|
-
await processShippingMethods(this, data, claimReference, actions, sharedContext);
|
206
|
-
await processReturnShipping(this, data, claimReference, returnReference, actions, sharedContext);
|
207
|
-
const change = await this.createOrderChange_({
|
208
|
-
order_id: data.order_id,
|
209
|
-
claim_id: claimReference.id,
|
210
|
-
return_id: returnReference.id,
|
211
|
-
change_type: utils_1.OrderChangeType.CLAIM,
|
212
|
-
reference: "claim",
|
213
|
-
reference_id: claimReference.id,
|
214
|
-
description: data.description,
|
215
|
-
internal_note: data.internal_note,
|
216
|
-
created_by: data.created_by,
|
217
|
-
metadata: data.metadata,
|
218
|
-
actions,
|
219
|
-
}, sharedContext);
|
220
|
-
await (0, utils_1.promiseAll)([
|
221
|
-
this.createReturns([returnReference], sharedContext),
|
222
|
-
this.createOrderClaims([claimReference], sharedContext),
|
223
|
-
this.confirmOrderChange(change[0].id, sharedContext),
|
224
|
-
]);
|
225
|
-
return claimReference;
|
226
|
-
}
|
227
|
-
exports.createClaim = createClaim;
|
228
|
-
//# sourceMappingURL=create-claim.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create-claim.js","sourceRoot":"","sources":["../../../src/services/actions/create-claim.ts"],"names":[],"mappings":";;;AAKA,2CAQwB;AACxB,qCAAmE;AAEnE,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,CAAC,IAAiB;QAC5B,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,aAAa,EAAG,IAAI,CAAC,aAAyB,IAAI,IAAI;KACvD,CAAC,CAAA;IAEF,MAAM,eAAe,GACnB,IAAI,CAAC,IAAI,KAAK,iBAAS,CAAC,OAAO;QAC7B,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,gBAAM,EAAE;YAChB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,aAAa,EAAE,KAAK,CAAC,OAAO;YAC5B,MAAM,EAAE,oBAAY,CAAC,SAAS;YAC9B,QAAQ,EAAE,cAAc,C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ACd,CAAA;IACD,MAAM,sBAAsB,CAC1B,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,OAAO,EACP,aAAa,CACd,CAAA;IACD,MAAM,qBAAqB,CACzB,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,eAAe,EACf,OAAO,EACP,aAAa,CACd,CAAA;IAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAC1C;QACE,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,cAAc,CAAC,EAAE;QAC3B,SAAS,EAAE,eAAe,CAAC,EAAE;QAC7B,WAAW,EAAE,uBAAe,CAAC,KAAK;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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create-exchange.d.ts","sourceRoot":"","sources":["../../../src/services/actions/create-exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EACX,MAAM,iBAAiB,CAAA;AAkPxB,wBAAsB,cAAc,CAClC,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,UAAU,CAAC,sBAAsB,EACvC,aAAa,CAAC,EAAE,OAAO,gBAqExB"}
|