@medusajs/order 0.1.3-snapshot-20240718083016 → 0.1.3-snapshot-20240719080828
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -26
- package/dist/index.js.map +1 -1
- package/dist/migrations/Migration20240219102530.d.ts +1 -0
- package/dist/migrations/Migration20240219102530.d.ts.map +1 -0
- package/dist/migrations/Migration20240219102530.js +38 -4
- package/dist/migrations/Migration20240219102530.js.map +1 -1
- package/dist/migrations/Migration20240604100512.d.ts +5 -0
- package/dist/migrations/Migration20240604100512.d.ts.map +1 -0
- package/dist/migrations/Migration20240604100512.js +364 -0
- package/dist/migrations/Migration20240604100512.js.map +1 -0
- package/dist/migrations/Migration20240715102100.d.ts +5 -0
- package/dist/migrations/Migration20240715102100.d.ts.map +1 -0
- package/dist/migrations/Migration20240715102100.js +15 -0
- package/dist/migrations/Migration20240715102100.js.map +1 -0
- package/dist/migrations/Migration20240715174100.d.ts +5 -0
- package/dist/migrations/Migration20240715174100.d.ts.map +1 -0
- package/dist/migrations/Migration20240715174100.js +21 -0
- package/dist/migrations/Migration20240715174100.js.map +1 -0
- package/dist/migrations/Migration20240716081800.d.ts +5 -0
- package/dist/migrations/Migration20240716081800.d.ts.map +1 -0
- package/dist/migrations/Migration20240716081800.js +67 -0
- package/dist/migrations/Migration20240716081800.js.map +1 -0
- package/dist/models/address.d.ts +2 -1
- package/dist/models/address.d.ts.map +1 -0
- package/dist/models/adjustment-line.d.ts +3 -1
- package/dist/models/adjustment-line.d.ts.map +1 -0
- package/dist/models/adjustment-line.js +5 -0
- package/dist/models/adjustment-line.js.map +1 -1
- package/dist/models/claim-item-image.d.ts +19 -0
- package/dist/models/claim-item-image.d.ts.map +1 -0
- package/dist/models/claim-item-image.js +109 -0
- package/dist/models/claim-item-image.js.map +1 -0
- package/dist/models/claim-item.d.ts +29 -0
- package/dist/models/claim-item.d.ts.map +1 -0
- package/dist/models/claim-item.js +156 -0
- package/dist/models/claim-item.js.map +1 -0
- package/dist/models/claim.d.ts +36 -0
- package/dist/models/claim.d.ts.map +1 -0
- package/dist/models/claim.js +195 -0
- package/dist/models/claim.js.map +1 -0
- package/dist/models/exchange-item.d.ts +24 -0
- package/dist/models/exchange-item.d.ts.map +1 -0
- package/dist/models/exchange-item.js +138 -0
- package/dist/models/exchange-item.js.map +1 -0
- package/dist/models/exchange.d.ts +34 -0
- package/dist/models/exchange.d.ts.map +1 -0
- package/dist/models/exchange.js +188 -0
- package/dist/models/exchange.js.map +1 -0
- package/dist/models/index.d.ts +9 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +17 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/line-item-adjustment.d.ts +3 -1
- package/dist/models/line-item-adjustment.d.ts.map +1 -0
- 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 +3 -1
- package/dist/models/line-item-tax-line.d.ts.map +1 -0
- 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 +3 -1
- package/dist/models/line-item.d.ts.map +1 -0
- package/dist/models/line-item.js +18 -4
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/order-change-action.d.ts +15 -4
- package/dist/models/order-change-action.d.ts.map +1 -0
- package/dist/models/order-change-action.js +102 -7
- package/dist/models/order-change-action.js.map +1 -1
- package/dist/models/order-change.d.ts +17 -5
- package/dist/models/order-change.d.ts.map +1 -0
- package/dist/models/order-change.js +109 -4
- package/dist/models/order-change.js.map +1 -1
- package/dist/models/order-item.d.ts +5 -4
- package/dist/models/order-item.d.ts.map +1 -0
- 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 +14 -4
- package/dist/models/order-shipping-method.d.ts.map +1 -0
- package/dist/models/order-shipping-method.js +89 -13
- package/dist/models/order-shipping-method.js.map +1 -1
- package/dist/models/order-summary.d.ts +6 -7
- package/dist/models/order-summary.d.ts.map +1 -0
- package/dist/models/order-summary.js +9 -6
- package/dist/models/order-summary.js.map +1 -1
- package/dist/models/order.d.ts +6 -4
- package/dist/models/order.d.ts.map +1 -0
- package/dist/models/order.js +11 -1
- package/dist/models/order.js.map +1 -1
- package/dist/models/return-item.d.ts +29 -0
- package/dist/models/return-item.d.ts.map +1 -0
- package/dist/models/return-item.js +170 -0
- package/dist/models/return-item.js.map +1 -0
- package/dist/models/return-reason.d.ts +21 -0
- package/dist/models/return-reason.d.ts.map +1 -0
- package/dist/models/return-reason.js +120 -0
- package/dist/models/return-reason.js.map +1 -0
- package/dist/models/return.d.ts +39 -0
- package/dist/models/return.d.ts.map +1 -0
- package/dist/models/return.js +216 -0
- package/dist/models/return.js.map +1 -0
- package/dist/models/shipping-method-adjustment.d.ts +3 -1
- package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
- 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 +3 -1
- package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
- 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 +2 -0
- package/dist/models/shipping-method.d.ts.map +1 -0
- package/dist/models/shipping-method.js +17 -4
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/tax-line.d.ts +2 -0
- package/dist/models/tax-line.d.ts.map +1 -0
- package/dist/models/tax-line.js +7 -0
- package/dist/models/tax-line.js.map +1 -1
- package/dist/models/transaction.d.ts +15 -3
- package/dist/models/transaction.d.ts.map +1 -0
- package/dist/models/transaction.js +109 -4
- package/dist/models/transaction.js.map +1 -1
- package/dist/repositories/claim.d.ts +9 -0
- package/dist/repositories/claim.d.ts.map +1 -0
- package/dist/repositories/claim.js +11 -0
- package/dist/repositories/claim.js.map +1 -0
- package/dist/repositories/exchange.d.ts +9 -0
- package/dist/repositories/exchange.d.ts.map +1 -0
- package/dist/repositories/exchange.js +11 -0
- package/dist/repositories/exchange.js.map +1 -0
- package/dist/repositories/index.d.ts +4 -1
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +7 -16
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/order.d.ts +1 -3
- package/dist/repositories/order.d.ts.map +1 -0
- package/dist/repositories/order.js +2 -85
- package/dist/repositories/order.js.map +1 -1
- package/dist/repositories/return.d.ts +9 -0
- package/dist/repositories/return.d.ts.map +1 -0
- package/dist/repositories/return.js +11 -0
- package/dist/repositories/return.js.map +1 -0
- package/dist/services/actions/cancel-claim.d.ts +3 -0
- package/dist/services/actions/cancel-claim.d.ts.map +1 -0
- package/dist/services/actions/cancel-claim.js +107 -0
- package/dist/services/actions/cancel-claim.js.map +1 -0
- package/dist/services/actions/cancel-exchange.d.ts +3 -0
- package/dist/services/actions/cancel-exchange.d.ts.map +1 -0
- package/dist/services/actions/cancel-exchange.js +92 -0
- package/dist/services/actions/cancel-exchange.js.map +1 -0
- package/dist/services/actions/cancel-fulfillment.d.ts +3 -0
- package/dist/services/actions/cancel-fulfillment.d.ts.map +1 -0
- package/dist/services/actions/cancel-fulfillment.js +32 -0
- package/dist/services/actions/cancel-fulfillment.js.map +1 -0
- package/dist/services/actions/cancel-return.d.ts +3 -0
- package/dist/services/actions/cancel-return.d.ts.map +1 -0
- package/dist/services/actions/cancel-return.js +72 -0
- package/dist/services/actions/cancel-return.js.map +1 -0
- package/dist/services/actions/create-claim.d.ts +3 -0
- package/dist/services/actions/create-claim.d.ts.map +1 -0
- package/dist/services/actions/create-claim.js +228 -0
- package/dist/services/actions/create-claim.js.map +1 -0
- package/dist/services/actions/create-exchange.d.ts +3 -0
- package/dist/services/actions/create-exchange.d.ts.map +1 -0
- package/dist/services/actions/create-exchange.js +193 -0
- package/dist/services/actions/create-exchange.js.map +1 -0
- package/dist/services/actions/create-return.d.ts +3 -0
- package/dist/services/actions/create-return.d.ts.map +1 -0
- package/dist/services/actions/create-return.js +102 -0
- package/dist/services/actions/create-return.js.map +1 -0
- package/dist/services/actions/index.d.ts +11 -0
- package/dist/services/actions/index.d.ts.map +1 -0
- package/dist/services/actions/index.js +27 -0
- package/dist/services/actions/index.js.map +1 -0
- package/dist/services/actions/receive-return.d.ts +3 -0
- package/dist/services/actions/receive-return.d.ts.map +1 -0
- package/dist/services/actions/receive-return.js +72 -0
- package/dist/services/actions/receive-return.js.map +1 -0
- package/dist/services/actions/register-fulfillment.d.ts +3 -0
- package/dist/services/actions/register-fulfillment.d.ts.map +1 -0
- package/dist/services/actions/register-fulfillment.js +30 -0
- package/dist/services/actions/register-fulfillment.js.map +1 -0
- package/dist/services/actions/register-shipment.d.ts +3 -0
- package/dist/services/actions/register-shipment.d.ts.map +1 -0
- package/dist/services/actions/register-shipment.js +38 -0
- package/dist/services/actions/register-shipment.js.map +1 -0
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +1 -3
- package/dist/services/index.js.map +1 -1
- package/dist/services/order-module-service.d.ts +138 -67
- package/dist/services/order-module-service.d.ts.map +1 -0
- package/dist/services/order-module-service.js +992 -240
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/services/order-service.d.ts +5 -4
- package/dist/services/order-service.d.ts.map +1 -0
- package/dist/services/order-service.js +1 -1
- package/dist/services/order-service.js.map +1 -1
- package/dist/types/address.d.ts +1 -0
- package/dist/types/address.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/line-item-adjustment.d.ts +1 -0
- package/dist/types/line-item-adjustment.d.ts.map +1 -0
- package/dist/types/line-item-tax-line.d.ts +1 -0
- package/dist/types/line-item-tax-line.d.ts.map +1 -0
- package/dist/types/line-item.d.ts +1 -0
- package/dist/types/line-item.d.ts.map +1 -0
- package/dist/types/order-change.d.ts +6 -0
- package/dist/types/order-change.d.ts.map +1 -0
- package/dist/types/order-change.js +3 -0
- package/dist/types/order-change.js.map +1 -0
- package/dist/types/order-detail.d.ts +2 -1
- package/dist/types/order-detail.d.ts.map +1 -0
- package/dist/types/order.d.ts +3 -2
- package/dist/types/order.d.ts.map +1 -0
- package/dist/types/shipping-method-adjustment.d.ts +1 -0
- package/dist/types/shipping-method-adjustment.d.ts.map +1 -0
- package/dist/types/shipping-method-tax-line.d.ts +1 -0
- package/dist/types/shipping-method-tax-line.d.ts.map +1 -0
- package/dist/types/shipping-method.d.ts +4 -0
- package/dist/types/shipping-method.d.ts.map +1 -0
- package/dist/types/tax-line.d.ts +1 -0
- package/dist/types/tax-line.d.ts.map +1 -0
- package/dist/types/transaction.d.ts +1 -0
- package/dist/types/transaction.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +40 -21
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/index.js +0 -1
- package/dist/types/utils/index.js.map +1 -1
- package/dist/utils/actions/cancel-item-fulfillment.d.ts +2 -0
- package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +1 -0
- package/dist/utils/actions/cancel-item-fulfillment.js +34 -0
- package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -0
- package/dist/utils/actions/cancel-return.d.ts +1 -0
- package/dist/utils/actions/cancel-return.d.ts.map +1 -0
- package/dist/utils/actions/cancel-return.js +6 -10
- package/dist/utils/actions/cancel-return.js.map +1 -1
- package/dist/utils/actions/fulfill-item.d.ts +1 -0
- package/dist/utils/actions/fulfill-item.d.ts.map +1 -0
- package/dist/utils/actions/fulfill-item.js +6 -10
- package/dist/utils/actions/fulfill-item.js.map +1 -1
- package/dist/utils/actions/index.d.ts +4 -1
- package/dist/utils/actions/index.d.ts.map +1 -0
- package/dist/utils/actions/index.js +3 -1
- package/dist/utils/actions/index.js.map +1 -1
- package/dist/utils/actions/item-add.d.ts +1 -0
- package/dist/utils/actions/item-add.d.ts.map +1 -0
- package/dist/utils/actions/item-add.js +15 -24
- package/dist/utils/actions/item-add.js.map +1 -1
- package/dist/utils/actions/item-remove.d.ts +1 -0
- package/dist/utils/actions/item-remove.d.ts.map +1 -0
- package/dist/utils/actions/item-remove.js +8 -22
- package/dist/utils/actions/item-remove.js.map +1 -1
- package/dist/utils/actions/receive-damaged-return-item.d.ts +1 -0
- package/dist/utils/actions/receive-damaged-return-item.d.ts.map +1 -0
- package/dist/utils/actions/receive-damaged-return-item.js +9 -35
- package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
- package/dist/utils/actions/receive-return-item.d.ts +1 -0
- package/dist/utils/actions/receive-return-item.d.ts.map +1 -0
- package/dist/utils/actions/receive-return-item.js +7 -36
- package/dist/utils/actions/receive-return-item.js.map +1 -1
- package/dist/utils/actions/reinstate-item.d.ts +2 -0
- package/dist/utils/actions/reinstate-item.d.ts.map +1 -0
- package/dist/utils/actions/reinstate-item.js +32 -0
- package/dist/utils/actions/reinstate-item.js.map +1 -0
- package/dist/utils/actions/return-item.d.ts +1 -0
- package/dist/utils/actions/return-item.d.ts.map +1 -0
- package/dist/utils/actions/return-item.js +8 -12
- package/dist/utils/actions/return-item.js.map +1 -1
- package/dist/utils/actions/ship-item.d.ts +1 -0
- package/dist/utils/actions/ship-item.d.ts.map +1 -0
- package/dist/utils/actions/ship-item.js +6 -10
- package/dist/utils/actions/ship-item.js.map +1 -1
- package/dist/utils/actions/shipping-add.d.ts +1 -0
- package/dist/utils/actions/shipping-add.d.ts.map +1 -0
- package/dist/utils/actions/shipping-add.js +16 -16
- package/dist/utils/actions/shipping-add.js.map +1 -1
- package/dist/utils/actions/shipping-remove.d.ts +2 -0
- package/dist/utils/actions/shipping-remove.d.ts.map +1 -0
- package/dist/utils/actions/shipping-remove.js +25 -0
- package/dist/utils/actions/shipping-remove.js.map +1 -0
- package/dist/utils/actions/write-off-item.d.ts +1 -0
- package/dist/utils/actions/write-off-item.d.ts.map +1 -0
- package/dist/utils/actions/write-off-item.js +6 -10
- package/dist/utils/actions/write-off-item.js.map +1 -1
- package/dist/utils/apply-order-changes.d.ts +18 -0
- package/dist/utils/apply-order-changes.d.ts.map +1 -0
- package/dist/utils/apply-order-changes.js +95 -0
- package/dist/utils/apply-order-changes.js.map +1 -0
- package/dist/utils/base-repository-find.d.ts +3 -0
- package/dist/utils/base-repository-find.d.ts.map +1 -0
- package/dist/utils/base-repository-find.js +142 -0
- package/dist/utils/base-repository-find.js.map +1 -0
- package/dist/utils/calculate-order-change.d.ts +11 -5
- package/dist/utils/calculate-order-change.d.ts.map +1 -0
- package/dist/utils/calculate-order-change.js +57 -182
- package/dist/utils/calculate-order-change.js.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/set-action-reference.d.ts +2 -0
- package/dist/utils/set-action-reference.d.ts.map +1 -0
- package/dist/utils/set-action-reference.js +11 -0
- package/dist/utils/set-action-reference.js.map +1 -0
- package/dist/utils/transform-order.d.ts +4 -2
- package/dist/utils/transform-order.d.ts.map +1 -0
- package/dist/utils/transform-order.js +131 -17
- package/dist/utils/transform-order.js.map +1 -1
- package/package.json +8 -14
- package/dist/joiner-config.d.ts +0 -5
- package/dist/joiner-config.js +0 -36
- package/dist/joiner-config.js.map +0 -1
- package/dist/module-definition.d.ts +0 -2
- package/dist/module-definition.js +0 -59
- package/dist/module-definition.js.map +0 -1
- package/dist/scripts/bin/run-seed.d.ts +0 -3
- package/dist/scripts/bin/run-seed.js +0 -49
- package/dist/scripts/bin/run-seed.js.map +0 -1
- package/dist/services/order-change-service.d.ts +0 -15
- package/dist/services/order-change-service.js +0 -96
- package/dist/services/order-change-service.js.map +0 -1
- package/dist/utils/action-key.d.ts +0 -13
- package/dist/utils/action-key.js +0 -18
- package/dist/utils/action-key.js.map +0 -1
- package/dist/utils/actions/cancel.d.ts +0 -1
- package/dist/utils/actions/cancel.js +0 -8
- package/dist/utils/actions/cancel.js.map +0 -1
@@ -14,31 +14,71 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const utils_1 = require("@medusajs/utils");
|
16
16
|
const core_1 = require("@mikro-orm/core");
|
17
|
+
const claim_1 = __importDefault(require("./claim"));
|
18
|
+
const exchange_1 = __importDefault(require("./exchange"));
|
17
19
|
const order_1 = __importDefault(require("./order"));
|
20
|
+
const return_1 = __importDefault(require("./return"));
|
18
21
|
const ReferenceIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
19
22
|
tableName: "order_transaction",
|
20
23
|
columns: "reference_id",
|
24
|
+
where: "deleted_at IS NOT NULL",
|
21
25
|
});
|
22
26
|
const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
23
27
|
tableName: "order_transaction",
|
24
28
|
columns: "order_id",
|
29
|
+
where: "deleted_at IS NOT NULL",
|
30
|
+
});
|
31
|
+
const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
32
|
+
tableName: "order_transaction",
|
33
|
+
columns: "return_id",
|
34
|
+
where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
|
35
|
+
});
|
36
|
+
const ExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
37
|
+
tableName: "order_item",
|
38
|
+
columns: ["exchange_id"],
|
39
|
+
where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
|
40
|
+
});
|
41
|
+
const ClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
42
|
+
tableName: "order_item",
|
43
|
+
columns: ["claim_id"],
|
44
|
+
where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
|
25
45
|
});
|
26
46
|
const CurrencyCodeIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
27
47
|
tableName: "order_transaction",
|
28
48
|
columns: "currency_code",
|
49
|
+
where: "deleted_at IS NOT NULL",
|
50
|
+
});
|
51
|
+
const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
52
|
+
tableName: "order_transaction",
|
53
|
+
columns: "deleted_at",
|
54
|
+
where: "deleted_at IS NOT NULL",
|
55
|
+
});
|
56
|
+
const OrderIdVersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
57
|
+
tableName: "order_transaction",
|
58
|
+
columns: ["order_id", "version"],
|
59
|
+
where: "deleted_at IS NOT NULL",
|
29
60
|
});
|
30
61
|
let Transaction = class Transaction {
|
31
62
|
constructor() {
|
63
|
+
this.return_id = null;
|
64
|
+
this.version = 1;
|
32
65
|
this.reference = null;
|
33
66
|
this.reference_id = null;
|
67
|
+
this.deleted_at = null;
|
34
68
|
}
|
35
69
|
onCreate() {
|
36
70
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordtrx");
|
37
|
-
this.order_id
|
71
|
+
this.order_id ??= this.order?.id;
|
72
|
+
this.return_id ??= this.return?.id;
|
73
|
+
this.claim_id ??= this.claim?.id;
|
74
|
+
this.exchange_id ??= this.exchange?.id;
|
38
75
|
}
|
39
76
|
onInit() {
|
40
77
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordtrx");
|
41
|
-
this.order_id
|
78
|
+
this.order_id ??= this.order?.id;
|
79
|
+
this.return_id ??= this.return?.id;
|
80
|
+
this.claim_id ??= this.claim?.id;
|
81
|
+
this.exchange_id ??= this.exchange?.id;
|
42
82
|
}
|
43
83
|
};
|
44
84
|
__decorate([
|
@@ -60,8 +100,66 @@ __decorate([
|
|
60
100
|
(0, core_1.ManyToOne)(() => order_1.default, {
|
61
101
|
persist: false,
|
62
102
|
}),
|
63
|
-
__metadata("design:type",
|
103
|
+
__metadata("design:type", Object)
|
64
104
|
], Transaction.prototype, "order", void 0);
|
105
|
+
__decorate([
|
106
|
+
(0, core_1.ManyToOne)({
|
107
|
+
entity: () => return_1.default,
|
108
|
+
mapToPk: true,
|
109
|
+
fieldName: "return_id",
|
110
|
+
columnType: "text",
|
111
|
+
nullable: true,
|
112
|
+
}),
|
113
|
+
ReturnIdIndex.MikroORMIndex(),
|
114
|
+
__metadata("design:type", Object)
|
115
|
+
], Transaction.prototype, "return_id", void 0);
|
116
|
+
__decorate([
|
117
|
+
(0, core_1.ManyToOne)(() => return_1.default, {
|
118
|
+
persist: false,
|
119
|
+
}),
|
120
|
+
__metadata("design:type", Object)
|
121
|
+
], Transaction.prototype, "return", void 0);
|
122
|
+
__decorate([
|
123
|
+
(0, core_1.ManyToOne)({
|
124
|
+
entity: () => exchange_1.default,
|
125
|
+
mapToPk: true,
|
126
|
+
fieldName: "exchange_id",
|
127
|
+
columnType: "text",
|
128
|
+
nullable: true,
|
129
|
+
}),
|
130
|
+
ExchangeIdIndex.MikroORMIndex(),
|
131
|
+
__metadata("design:type", Object)
|
132
|
+
], Transaction.prototype, "exchange_id", void 0);
|
133
|
+
__decorate([
|
134
|
+
(0, core_1.ManyToOne)(() => exchange_1.default, {
|
135
|
+
persist: false,
|
136
|
+
}),
|
137
|
+
__metadata("design:type", Object)
|
138
|
+
], Transaction.prototype, "exchange", void 0);
|
139
|
+
__decorate([
|
140
|
+
(0, core_1.ManyToOne)({
|
141
|
+
entity: () => claim_1.default,
|
142
|
+
mapToPk: true,
|
143
|
+
fieldName: "claim_id",
|
144
|
+
columnType: "text",
|
145
|
+
nullable: true,
|
146
|
+
}),
|
147
|
+
ClaimIdIndex.MikroORMIndex(),
|
148
|
+
__metadata("design:type", Object)
|
149
|
+
], Transaction.prototype, "claim_id", void 0);
|
150
|
+
__decorate([
|
151
|
+
(0, core_1.ManyToOne)(() => claim_1.default, {
|
152
|
+
persist: false,
|
153
|
+
}),
|
154
|
+
__metadata("design:type", Object)
|
155
|
+
], Transaction.prototype, "claim", void 0);
|
156
|
+
__decorate([
|
157
|
+
(0, core_1.Property)({
|
158
|
+
columnType: "integer",
|
159
|
+
defaultRaw: "1",
|
160
|
+
}),
|
161
|
+
__metadata("design:type", Number)
|
162
|
+
], Transaction.prototype, "version", void 0);
|
65
163
|
__decorate([
|
66
164
|
(0, utils_1.MikroOrmBigNumberProperty)(),
|
67
165
|
__metadata("design:type", Object)
|
@@ -107,6 +205,11 @@ __decorate([
|
|
107
205
|
}),
|
108
206
|
__metadata("design:type", Date)
|
109
207
|
], Transaction.prototype, "updated_at", void 0);
|
208
|
+
__decorate([
|
209
|
+
(0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
|
210
|
+
DeletedAtIndex.MikroORMIndex(),
|
211
|
+
__metadata("design:type", Object)
|
212
|
+
], Transaction.prototype, "deleted_at", void 0);
|
110
213
|
__decorate([
|
111
214
|
(0, core_1.BeforeCreate)(),
|
112
215
|
__metadata("design:type", Function),
|
@@ -120,7 +223,9 @@ __decorate([
|
|
120
223
|
__metadata("design:returntype", void 0)
|
121
224
|
], Transaction.prototype, "onInit", null);
|
122
225
|
Transaction = __decorate([
|
123
|
-
(0, core_1.Entity)({ tableName: "order_transaction" })
|
226
|
+
(0, core_1.Entity)({ tableName: "order_transaction" }),
|
227
|
+
(0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions),
|
228
|
+
OrderIdVersionIndex.MikroORMIndex()
|
124
229
|
], Transaction);
|
125
230
|
exports.default = Transaction;
|
126
231
|
//# sourceMappingURL=transaction.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/models/transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/models/transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAMwB;AACxB,0CAUwB;AACxB,oDAA2B;AAC3B,0DAAiC;AACjC,oDAA2B;AAC3B,sDAA6B;AAI7B,MAAM,gBAAgB,GAAG,IAAA,sCAA8B,EAAC;IACtD,SAAS,EAAE,mBAAmB;IAC9B,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM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B,CAAC,aAAa,EAAE;;kDACb;AAMrB;IAJC,IAAA,eAAQ,EAAC;QACR,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC;;8CAC6B;AAO/B;IALC,IAAA,eAAQ,EAAC;QACR,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,gBAAgB,CAAC,aAAa,EAAE;;iDACC;AAOlC;IALC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;+CAAA;AAQhB;IANC,IAAA,eAAQ,EAAC;QACR,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;+CAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;+CACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;2CAOd;AAGD;IADC,IAAA,aAAM,GAAE;;;;yCAOR;AAlIkB,WAAW;IAH/B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;IAC1C,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;IACnD,mBAAmB,CAAC,aAAa,EAAE;GACf,WAAW,CAmI/B;kBAnIoB,WAAW"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { DALUtils } from "@medusajs/utils";
|
2
|
+
import { OrderClaim } from "../models";
|
3
|
+
declare const OrderClaimRepository_base: new ({ manager }: {
|
4
|
+
manager: any;
|
5
|
+
}) => DALUtils.MikroOrmBaseRepository<OrderClaim>;
|
6
|
+
export declare class OrderClaimRepository extends OrderClaimRepository_base {
|
7
|
+
}
|
8
|
+
export {};
|
9
|
+
//# sourceMappingURL=claim.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/repositories/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;;;;AAGpC,qBAAa,oBAAqB,SAAQ,yBAEzC;CAAG"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.OrderClaimRepository = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
const _models_1 = require("../models");
|
6
|
+
const base_repository_find_1 = require("../utils/base-repository-find");
|
7
|
+
class OrderClaimRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.OrderClaim) {
|
8
|
+
}
|
9
|
+
exports.OrderClaimRepository = OrderClaimRepository;
|
10
|
+
(0, base_repository_find_1.setFindMethods)(OrderClaimRepository, _models_1.OrderClaim);
|
11
|
+
//# sourceMappingURL=claim.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/repositories/claim.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,qCAAoC;AACpC,wEAA8D;AAE9D,MAAa,oBAAqB,SAAQ,gBAAQ,CAAC,6BAA6B,CAC9E,oBAAU,CACX;CAAG;AAFJ,oDAEI;AAEJ,IAAA,qCAAc,EAAC,oBAAoB,EAAE,oBAAU,CAAC,CAAA"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { DALUtils } from "@medusajs/utils";
|
2
|
+
import { OrderExchange } from "../models";
|
3
|
+
declare const OrderExchangeRepository_base: new ({ manager }: {
|
4
|
+
manager: any;
|
5
|
+
}) => DALUtils.MikroOrmBaseRepository<OrderExchange>;
|
6
|
+
export declare class OrderExchangeRepository extends OrderExchangeRepository_base {
|
7
|
+
}
|
8
|
+
export {};
|
9
|
+
//# sourceMappingURL=exchange.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../src/repositories/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;;;;AAGvC,qBAAa,uBAAwB,SAAQ,4BAE5C;CAAG"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.OrderExchangeRepository = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
const _models_1 = require("../models");
|
6
|
+
const base_repository_find_1 = require("../utils/base-repository-find");
|
7
|
+
class OrderExchangeRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.OrderExchange) {
|
8
|
+
}
|
9
|
+
exports.OrderExchangeRepository = OrderExchangeRepository;
|
10
|
+
(0, base_repository_find_1.setFindMethods)(OrderExchangeRepository, _models_1.OrderExchange);
|
11
|
+
//# sourceMappingURL=exchange.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/repositories/exchange.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,qCAAuC;AACvC,wEAA8D;AAE9D,MAAa,uBAAwB,SAAQ,gBAAQ,CAAC,6BAA6B,CACjF,uBAAa,CACd;CAAG;AAFJ,0DAEI;AAEJ,IAAA,qCAAc,EAAC,uBAAuB,EAAE,uBAAa,CAAC,CAAA"}
|
@@ -1,2 +1,5 @@
|
|
1
1
|
export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils";
|
2
|
-
export
|
2
|
+
export { OrderClaimRepository } from "./claim";
|
3
|
+
export { OrderRepository } from "./order";
|
4
|
+
export { ReturnRepository } from "./return";
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA"}
|
@@ -1,21 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.BaseRepository = void 0;
|
3
|
+
exports.ReturnRepository = exports.OrderRepository = exports.OrderClaimRepository = exports.BaseRepository = void 0;
|
18
4
|
var utils_1 = require("@medusajs/utils");
|
19
5
|
Object.defineProperty(exports, "BaseRepository", { enumerable: true, get: function () { return utils_1.MikroOrmBaseRepository; } });
|
20
|
-
|
6
|
+
var claim_1 = require("./claim");
|
7
|
+
Object.defineProperty(exports, "OrderClaimRepository", { enumerable: true, get: function () { return claim_1.OrderClaimRepository; } });
|
8
|
+
var order_1 = require("./order");
|
9
|
+
Object.defineProperty(exports, "OrderRepository", { enumerable: true, get: function () { return order_1.OrderRepository; } });
|
10
|
+
var return_1 = require("./return");
|
11
|
+
Object.defineProperty(exports, "ReturnRepository", { enumerable: true, get: function () { return return_1.ReturnRepository; } });
|
21
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";;;AAAA,yCAA0E;AAAjE,uGAAA,sBAAsB,OAAkB;AACjD,iCAA8C;AAArC,6GAAA,oBAAoB,OAAA;AAC7B,iCAAyC;AAAhC,wGAAA,eAAe,OAAA;AACxB,mCAA2C;AAAlC,0GAAA,gBAAgB,OAAA"}
|
@@ -1,11 +1,9 @@
|
|
1
|
-
import { Context, DAL } from "@medusajs/types";
|
2
1
|
import { DALUtils } from "@medusajs/utils";
|
3
2
|
import { Order } from "../models";
|
4
3
|
declare const OrderRepository_base: new ({ manager }: {
|
5
4
|
manager: any;
|
6
5
|
}) => DALUtils.MikroOrmBaseRepository<Order>;
|
7
6
|
export declare class OrderRepository extends OrderRepository_base {
|
8
|
-
find(options?: DAL.FindOptions<Order>, context?: Context): Promise<Order[]>;
|
9
|
-
findAndCount(findOptions?: DAL.FindOptions<Order>, context?: Context): Promise<[Order[], number]>;
|
10
7
|
}
|
11
8
|
export {};
|
9
|
+
//# sourceMappingURL=order.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/repositories/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;;;;AAG/B,qBAAa,eAAgB,SAAQ,oBAEpC;CAAG"}
|
@@ -2,93 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.OrderRepository = void 0;
|
4
4
|
const utils_1 = require("@medusajs/utils");
|
5
|
-
const core_1 = require("@mikro-orm/core");
|
6
5
|
const _models_1 = require("../models");
|
7
|
-
const
|
6
|
+
const base_repository_find_1 = require("../utils/base-repository-find");
|
8
7
|
class OrderRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.Order) {
|
9
|
-
async find(options, context) {
|
10
|
-
var _a, _b, _c, _d;
|
11
|
-
const manager = this.getActiveManager(context);
|
12
|
-
const knex = manager.getKnex();
|
13
|
-
const findOptions_ = { ...options };
|
14
|
-
findOptions_.options ?? (findOptions_.options = {});
|
15
|
-
findOptions_.where ?? (findOptions_.where = {});
|
16
|
-
if (!("strategy" in findOptions_.options)) {
|
17
|
-
if (findOptions_.options.limit != null || findOptions_.options.offset) {
|
18
|
-
Object.assign(findOptions_.options, {
|
19
|
-
strategy: core_1.LoadStrategy.SELECT_IN,
|
20
|
-
});
|
21
|
-
}
|
22
|
-
else {
|
23
|
-
Object.assign(findOptions_.options, {
|
24
|
-
strategy: core_1.LoadStrategy.JOINED,
|
25
|
-
});
|
26
|
-
}
|
27
|
-
}
|
28
|
-
const config = (0, transform_order_1.mapRepositoryToOrderModel)(findOptions_);
|
29
|
-
let defaultVersion = knex.raw(`"o0"."version"`);
|
30
|
-
const strategy = config.options.strategy ?? core_1.LoadStrategy.JOINED;
|
31
|
-
if (strategy === core_1.LoadStrategy.SELECT_IN) {
|
32
|
-
const sql = manager
|
33
|
-
.qb(_models_1.Order, "_sub0")
|
34
|
-
.select("version")
|
35
|
-
.where({ id: knex.raw(`"o0"."order_id"`) })
|
36
|
-
.getKnexQuery()
|
37
|
-
.toString();
|
38
|
-
defaultVersion = knex.raw(`(${sql})`);
|
39
|
-
}
|
40
|
-
const version = config.where.version ?? defaultVersion;
|
41
|
-
delete config.where?.version;
|
42
|
-
(_a = config.options).populateWhere ?? (_a.populateWhere = {});
|
43
|
-
(_b = config.options.populateWhere).items ?? (_b.items = {});
|
44
|
-
config.options.populateWhere.items.version = version;
|
45
|
-
(_c = config.options.populateWhere).summary ?? (_c.summary = {});
|
46
|
-
config.options.populateWhere.summary.version = version;
|
47
|
-
(_d = config.options.populateWhere).shipping_methods ?? (_d.shipping_methods = {});
|
48
|
-
config.options.populateWhere.shipping_methods.version = version;
|
49
|
-
if (!config.options.orderBy) {
|
50
|
-
config.options.orderBy = { id: "ASC" };
|
51
|
-
}
|
52
|
-
return await manager.find(_models_1.Order, config.where, config.options);
|
53
|
-
}
|
54
|
-
async findAndCount(findOptions = { where: {} }, context = {}) {
|
55
|
-
var _a, _b, _c, _d;
|
56
|
-
const manager = this.getActiveManager(context);
|
57
|
-
const knex = manager.getKnex();
|
58
|
-
const findOptions_ = { ...findOptions };
|
59
|
-
findOptions_.options ?? (findOptions_.options = {});
|
60
|
-
findOptions_.where ?? (findOptions_.where = {});
|
61
|
-
if (!("strategy" in findOptions_.options)) {
|
62
|
-
Object.assign(findOptions_.options, {
|
63
|
-
strategy: core_1.LoadStrategy.SELECT_IN,
|
64
|
-
});
|
65
|
-
}
|
66
|
-
const config = (0, transform_order_1.mapRepositoryToOrderModel)(findOptions_);
|
67
|
-
let defaultVersion = knex.raw(`"o0"."version"`);
|
68
|
-
const strategy = config.options.strategy ?? core_1.LoadStrategy.JOINED;
|
69
|
-
if (strategy === core_1.LoadStrategy.SELECT_IN) {
|
70
|
-
const sql = manager
|
71
|
-
.qb(_models_1.Order, "_sub0")
|
72
|
-
.select("version")
|
73
|
-
.where({ id: knex.raw(`"o0"."order_id"`) })
|
74
|
-
.getKnexQuery()
|
75
|
-
.toString();
|
76
|
-
defaultVersion = knex.raw(`(${sql})`);
|
77
|
-
}
|
78
|
-
const version = config.where.version ?? defaultVersion;
|
79
|
-
delete config.where.version;
|
80
|
-
(_a = config.options).populateWhere ?? (_a.populateWhere = {});
|
81
|
-
(_b = config.options.populateWhere).items ?? (_b.items = {});
|
82
|
-
config.options.populateWhere.items.version = version;
|
83
|
-
(_c = config.options.populateWhere).summary ?? (_c.summary = {});
|
84
|
-
config.options.populateWhere.summary.version = version;
|
85
|
-
(_d = config.options.populateWhere).shipping_methods ?? (_d.shipping_methods = {});
|
86
|
-
config.options.populateWhere.shipping_methods.version = version;
|
87
|
-
if (!config.options.orderBy) {
|
88
|
-
config.options.orderBy = { id: "ASC" };
|
89
|
-
}
|
90
|
-
return await manager.findAndCount(_models_1.Order, config.where, config.options);
|
91
|
-
}
|
92
8
|
}
|
93
9
|
exports.OrderRepository = OrderRepository;
|
10
|
+
(0, base_repository_find_1.setFindMethods)(OrderRepository, _models_1.Order);
|
94
11
|
//# sourceMappingURL=order.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../src/repositories/order.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../src/repositories/order.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,qCAA+B;AAC/B,wEAA8D;AAE9D,MAAa,eAAgB,SAAQ,gBAAQ,CAAC,6BAA6B,CACzE,eAAK,CACN;CAAG;AAFJ,0CAEI;AAEJ,IAAA,qCAAc,EAAC,eAAe,EAAE,eAAK,CAAC,CAAA"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { DALUtils } from "@medusajs/utils";
|
2
|
+
import { Return } from "../models";
|
3
|
+
declare const ReturnRepository_base: new ({ manager }: {
|
4
|
+
manager: any;
|
5
|
+
}) => DALUtils.MikroOrmBaseRepository<Return>;
|
6
|
+
export declare class ReturnRepository extends ReturnRepository_base {
|
7
|
+
}
|
8
|
+
export {};
|
9
|
+
//# sourceMappingURL=return.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"return.d.ts","sourceRoot":"","sources":["../../src/repositories/return.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;;;;AAGhC,qBAAa,gBAAiB,SAAQ,qBAErC;CAAG"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ReturnRepository = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
const _models_1 = require("../models");
|
6
|
+
const base_repository_find_1 = require("../utils/base-repository-find");
|
7
|
+
class ReturnRepository extends utils_1.DALUtils.mikroOrmBaseRepositoryFactory(_models_1.Return) {
|
8
|
+
}
|
9
|
+
exports.ReturnRepository = ReturnRepository;
|
10
|
+
(0, base_repository_find_1.setFindMethods)(ReturnRepository, _models_1.Return);
|
11
|
+
//# sourceMappingURL=return.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"return.js","sourceRoot":"","sources":["../../src/repositories/return.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,qCAAgC;AAChC,wEAA8D;AAE9D,MAAa,gBAAiB,SAAQ,gBAAQ,CAAC,6BAA6B,CAC1E,gBAAM,CACP;CAAG;AAFJ,4CAEI;AAEJ,IAAA,qCAAc,EAAC,gBAAgB,EAAE,gBAAM,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cancel-claim.d.ts","sourceRoot":"","sources":["../../../src/services/actions/cancel-claim.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EACX,MAAM,iBAAiB,CAAA;AA0BxB,wBAAsB,WAAW,CAC/B,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,UAAU,CAAC,mBAAmB,EACpC,aAAa,CAAC,EAAE,OAAO,gBA6GxB"}
|
@@ -0,0 +1,107 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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;YAC7B,QAAQ,EAAE,UAAU,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