@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
@@ -14,53 +14,24 @@ 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"));
|
19
17
|
const order_1 = __importDefault(require("./order"));
|
20
18
|
const order_change_1 = __importDefault(require("./order-change"));
|
21
|
-
const return_1 = __importDefault(require("./return"));
|
22
19
|
const OrderChangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
23
20
|
tableName: "order_change_action",
|
24
21
|
columns: "order_change_id",
|
25
|
-
where: "deleted_at IS NOT NULL",
|
26
22
|
});
|
27
23
|
const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
28
24
|
tableName: "order_change_action",
|
29
25
|
columns: "order_id",
|
30
|
-
where: "deleted_at IS NOT NULL",
|
31
|
-
});
|
32
|
-
const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
33
|
-
tableName: "order_change_action",
|
34
|
-
columns: "return_id",
|
35
|
-
where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
|
36
|
-
});
|
37
|
-
const OrderClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
38
|
-
tableName: "order_change_action",
|
39
|
-
columns: "claim_id",
|
40
|
-
where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
|
41
|
-
});
|
42
|
-
const OrderExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
43
|
-
tableName: "order_change_action",
|
44
|
-
columns: "exchange_id",
|
45
|
-
where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
|
46
|
-
});
|
47
|
-
const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
48
|
-
tableName: "order_change_action",
|
49
|
-
columns: "deleted_at",
|
50
|
-
where: "deleted_at IS NOT NULL",
|
51
26
|
});
|
52
27
|
const ActionOrderingIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
53
28
|
tableName: "order_change_action",
|
54
29
|
columns: "ordering",
|
55
|
-
where: "deleted_at IS NOT NULL",
|
56
30
|
});
|
57
31
|
let OrderChangeAction = class OrderChangeAction {
|
58
32
|
constructor() {
|
59
33
|
this.order_id = null;
|
60
34
|
this.order = null;
|
61
|
-
this.return_id = null;
|
62
|
-
this.claim_id = null;
|
63
|
-
this.exchange_id = null;
|
64
35
|
this.version = null;
|
65
36
|
this.order_change = null;
|
66
37
|
this.reference = null;
|
@@ -70,27 +41,18 @@ let OrderChangeAction = class OrderChangeAction {
|
|
70
41
|
this.raw_amount = null;
|
71
42
|
this.internal_note = null;
|
72
43
|
this.applied = false;
|
73
|
-
this.deleted_at = null;
|
74
44
|
}
|
75
45
|
onCreate() {
|
76
46
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordchact");
|
77
|
-
this.order_id
|
78
|
-
this.
|
79
|
-
this.
|
80
|
-
this.exchange_id ??=
|
81
|
-
this.exchange?.id ?? this.order_change?.exchange_id ?? null;
|
82
|
-
this.order_change_id ??= this.order_change?.id ?? null;
|
83
|
-
this.version ??= this.order_change?.version ?? null;
|
47
|
+
this.order_id ?? (this.order_id = this.order?.id ?? this.order_change?.order_id ?? null);
|
48
|
+
this.order_change_id ?? (this.order_change_id = this.order_change?.id ?? null);
|
49
|
+
this.version ?? (this.version = this.order_change?.version ?? null);
|
84
50
|
}
|
85
51
|
onInit() {
|
86
52
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordchact");
|
87
|
-
this.order_id
|
88
|
-
this.
|
89
|
-
this.
|
90
|
-
this.exchange_id ??=
|
91
|
-
this.exchange?.id ?? this.order_change?.exchange_id ?? null;
|
92
|
-
this.order_change_id ??= this.order_change?.id ?? null;
|
93
|
-
this.version ??= this.order_change?.version ?? null;
|
53
|
+
this.order_id ?? (this.order_id = this.order?.id ?? this.order_change?.order_id ?? null);
|
54
|
+
this.order_change_id ?? (this.order_change_id = this.order_change?.id ?? null);
|
55
|
+
this.version ?? (this.version = this.order_change?.version ?? null);
|
94
56
|
}
|
95
57
|
};
|
96
58
|
__decorate([
|
@@ -121,57 +83,6 @@ __decorate([
|
|
121
83
|
}),
|
122
84
|
__metadata("design:type", Object)
|
123
85
|
], OrderChangeAction.prototype, "order", void 0);
|
124
|
-
__decorate([
|
125
|
-
(0, core_1.ManyToOne)({
|
126
|
-
entity: () => return_1.default,
|
127
|
-
mapToPk: true,
|
128
|
-
fieldName: "return_id",
|
129
|
-
columnType: "text",
|
130
|
-
nullable: true,
|
131
|
-
}),
|
132
|
-
ReturnIdIndex.MikroORMIndex(),
|
133
|
-
__metadata("design:type", Object)
|
134
|
-
], OrderChangeAction.prototype, "return_id", void 0);
|
135
|
-
__decorate([
|
136
|
-
(0, core_1.ManyToOne)(() => return_1.default, {
|
137
|
-
persist: false,
|
138
|
-
}),
|
139
|
-
__metadata("design:type", return_1.default)
|
140
|
-
], OrderChangeAction.prototype, "return", void 0);
|
141
|
-
__decorate([
|
142
|
-
(0, core_1.ManyToOne)({
|
143
|
-
entity: () => claim_1.default,
|
144
|
-
mapToPk: true,
|
145
|
-
fieldName: "claim_id",
|
146
|
-
columnType: "text",
|
147
|
-
nullable: true,
|
148
|
-
}),
|
149
|
-
OrderClaimIdIndex.MikroORMIndex(),
|
150
|
-
__metadata("design:type", Object)
|
151
|
-
], OrderChangeAction.prototype, "claim_id", void 0);
|
152
|
-
__decorate([
|
153
|
-
(0, core_1.ManyToOne)(() => claim_1.default, {
|
154
|
-
persist: false,
|
155
|
-
}),
|
156
|
-
__metadata("design:type", claim_1.default)
|
157
|
-
], OrderChangeAction.prototype, "claim", void 0);
|
158
|
-
__decorate([
|
159
|
-
(0, core_1.ManyToOne)({
|
160
|
-
entity: () => exchange_1.default,
|
161
|
-
mapToPk: true,
|
162
|
-
fieldName: "exchange_id",
|
163
|
-
columnType: "text",
|
164
|
-
nullable: true,
|
165
|
-
}),
|
166
|
-
OrderExchangeIdIndex.MikroORMIndex(),
|
167
|
-
__metadata("design:type", Object)
|
168
|
-
], OrderChangeAction.prototype, "exchange_id", void 0);
|
169
|
-
__decorate([
|
170
|
-
(0, core_1.ManyToOne)(() => exchange_1.default, {
|
171
|
-
persist: false,
|
172
|
-
}),
|
173
|
-
__metadata("design:type", exchange_1.default)
|
174
|
-
], OrderChangeAction.prototype, "exchange", void 0);
|
175
86
|
__decorate([
|
176
87
|
(0, core_1.Property)({ columnType: "integer", nullable: true }),
|
177
88
|
__metadata("design:type", Object)
|
@@ -256,11 +167,6 @@ __decorate([
|
|
256
167
|
}),
|
257
168
|
__metadata("design:type", Date)
|
258
169
|
], OrderChangeAction.prototype, "updated_at", void 0);
|
259
|
-
__decorate([
|
260
|
-
(0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
|
261
|
-
DeletedAtIndex.MikroORMIndex(),
|
262
|
-
__metadata("design:type", Object)
|
263
|
-
], OrderChangeAction.prototype, "deleted_at", void 0);
|
264
170
|
__decorate([
|
265
171
|
(0, core_1.BeforeCreate)(),
|
266
172
|
__metadata("design:type", Function),
|
@@ -274,8 +180,7 @@ __decorate([
|
|
274
180
|
__metadata("design:returntype", void 0)
|
275
181
|
], OrderChangeAction.prototype, "onInit", null);
|
276
182
|
OrderChangeAction = __decorate([
|
277
|
-
(0, core_1.Entity)({ tableName: "order_change_action" })
|
278
|
-
(0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
|
183
|
+
(0, core_1.Entity)({ tableName: "order_change_action" })
|
279
184
|
], OrderChangeAction);
|
280
185
|
exports.default = OrderChangeAction;
|
281
186
|
//# sourceMappingURL=order-change-action.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order-change-action.js","sourceRoot":"","sources":["../../src/models/order-change-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,
|
1
|
+
{"version":3,"file":"order-change-action.js","sourceRoot":"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AAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;qDAAA;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;qDAAA;AAGhB;IADC,IAAA,mBAAY,GAAE;;;;iDAMd;AAGD;IADC,IAAA,aAAM,GAAE;;;;+CAMR;AAhHkB,iBAAiB;IADrC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;GACxB,iBAAiB,CAiHrC;kBAjHoB,iBAAiB"}
|
@@ -1,25 +1,15 @@
|
|
1
1
|
import { DAL } from "@medusajs/types";
|
2
|
-
import { OrderChangeStatus
|
3
|
-
import { Collection, OptionalProps
|
4
|
-
import OrderClaim from "./claim";
|
5
|
-
import OrderExchange from "./exchange";
|
2
|
+
import { OrderChangeStatus } from "@medusajs/utils";
|
3
|
+
import { Collection, OptionalProps } from "@mikro-orm/core";
|
6
4
|
import Order from "./order";
|
7
5
|
import OrderChangeAction from "./order-change-action";
|
8
|
-
|
9
|
-
type OptionalLineItemProps = DAL.ModelDateColumns;
|
6
|
+
type OptionalLineItemProps = DAL.EntityDateColumns;
|
10
7
|
export default class OrderChange {
|
11
8
|
[OptionalProps]?: OptionalLineItemProps;
|
12
9
|
id: string;
|
13
10
|
order_id: string;
|
14
|
-
order:
|
15
|
-
return_id: string | null;
|
16
|
-
return: Rel<Return>;
|
17
|
-
claim_id: string | null;
|
18
|
-
claim: OrderClaim;
|
19
|
-
exchange_id: string | null;
|
20
|
-
exchange: OrderExchange;
|
11
|
+
order: Order;
|
21
12
|
version: number;
|
22
|
-
change_type: OrderChangeType | null;
|
23
13
|
actions: Collection<OrderChangeAction, object>;
|
24
14
|
description: string | null;
|
25
15
|
status: OrderChangeStatus;
|
@@ -34,12 +24,10 @@ export default class OrderChange {
|
|
34
24
|
metadata: Record<string, unknown> | null;
|
35
25
|
declined_at?: Date;
|
36
26
|
canceled_by: string | null;
|
37
|
-
canceled_at?: Date
|
27
|
+
canceled_at?: Date;
|
38
28
|
created_at: Date;
|
39
29
|
updated_at: Date;
|
40
|
-
deleted_at: Date | null;
|
41
30
|
onCreate(): void;
|
42
31
|
onInit(): void;
|
43
32
|
}
|
44
33
|
export {};
|
45
|
-
//# sourceMappingURL=order-change.d.ts.map
|
@@ -14,57 +14,22 @@ 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"));
|
19
17
|
const order_1 = __importDefault(require("./order"));
|
20
18
|
const order_change_action_1 = __importDefault(require("./order-change-action"));
|
21
|
-
const return_1 = __importDefault(require("./return"));
|
22
19
|
const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
23
20
|
tableName: "order_change",
|
24
21
|
columns: "order_id",
|
25
|
-
where: "deleted_at IS NOT NULL",
|
26
|
-
});
|
27
|
-
const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
28
|
-
tableName: "order_change",
|
29
|
-
columns: "return_id",
|
30
|
-
where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
|
31
|
-
});
|
32
|
-
const OrderClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
33
|
-
tableName: "order_change",
|
34
|
-
columns: "claim_id",
|
35
|
-
where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
|
36
|
-
});
|
37
|
-
const OrderExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
38
|
-
tableName: "order_change",
|
39
|
-
columns: "exchange_id",
|
40
|
-
where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
|
41
22
|
});
|
42
23
|
const OrderChangeStatusIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
43
24
|
tableName: "order_change",
|
44
25
|
columns: "status",
|
45
|
-
where: "deleted_at IS NOT NULL",
|
46
|
-
});
|
47
|
-
const OrderChangeTypeIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
48
|
-
tableName: "order_change",
|
49
|
-
columns: "change_type",
|
50
|
-
where: "deleted_at IS NOT NULL",
|
51
|
-
});
|
52
|
-
const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
53
|
-
tableName: "order_change",
|
54
|
-
columns: "deleted_at",
|
55
|
-
where: "deleted_at IS NOT NULL",
|
56
26
|
});
|
57
27
|
const VersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
58
28
|
tableName: "order_change",
|
59
29
|
columns: ["order_id", "version"],
|
60
|
-
where: "deleted_at IS NOT NULL",
|
61
30
|
});
|
62
31
|
let OrderChange = class OrderChange {
|
63
32
|
constructor() {
|
64
|
-
this.return_id = null;
|
65
|
-
this.claim_id = null;
|
66
|
-
this.exchange_id = null;
|
67
|
-
this.change_type = null;
|
68
33
|
this.actions = new core_1.Collection(this);
|
69
34
|
this.description = null;
|
70
35
|
this.status = utils_1.OrderChangeStatus.PENDING;
|
@@ -77,22 +42,14 @@ let OrderChange = class OrderChange {
|
|
77
42
|
this.declined_reason = null;
|
78
43
|
this.metadata = null;
|
79
44
|
this.canceled_by = null;
|
80
|
-
this.canceled_at = null;
|
81
|
-
this.deleted_at = null;
|
82
45
|
}
|
83
46
|
onCreate() {
|
84
47
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordch");
|
85
|
-
this.order_id
|
86
|
-
this.return_id ??= this.return?.id;
|
87
|
-
this.claim_id ??= this.claim?.id;
|
88
|
-
this.exchange_id ??= this.exchange?.id;
|
48
|
+
this.order_id ?? (this.order_id = this.order?.id);
|
89
49
|
}
|
90
50
|
onInit() {
|
91
51
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordch");
|
92
|
-
this.order_id
|
93
|
-
this.return_id ??= this.return?.id;
|
94
|
-
this.claim_id ??= this.claim?.id;
|
95
|
-
this.exchange_id ??= this.exchange?.id;
|
52
|
+
this.order_id ?? (this.order_id = this.order?.id);
|
96
53
|
}
|
97
54
|
};
|
98
55
|
__decorate([
|
@@ -114,69 +71,13 @@ __decorate([
|
|
114
71
|
(0, core_1.ManyToOne)(() => order_1.default, {
|
115
72
|
persist: false,
|
116
73
|
}),
|
117
|
-
__metadata("design:type",
|
74
|
+
__metadata("design:type", order_1.default)
|
118
75
|
], OrderChange.prototype, "order", void 0);
|
119
|
-
__decorate([
|
120
|
-
(0, core_1.ManyToOne)({
|
121
|
-
entity: () => return_1.default,
|
122
|
-
mapToPk: true,
|
123
|
-
fieldName: "return_id",
|
124
|
-
columnType: "text",
|
125
|
-
nullable: true,
|
126
|
-
}),
|
127
|
-
ReturnIdIndex.MikroORMIndex(),
|
128
|
-
__metadata("design:type", Object)
|
129
|
-
], OrderChange.prototype, "return_id", void 0);
|
130
|
-
__decorate([
|
131
|
-
(0, core_1.ManyToOne)(() => return_1.default, {
|
132
|
-
persist: false,
|
133
|
-
}),
|
134
|
-
__metadata("design:type", Object)
|
135
|
-
], OrderChange.prototype, "return", void 0);
|
136
|
-
__decorate([
|
137
|
-
(0, core_1.ManyToOne)({
|
138
|
-
entity: () => claim_1.default,
|
139
|
-
mapToPk: true,
|
140
|
-
fieldName: "claim_id",
|
141
|
-
columnType: "text",
|
142
|
-
nullable: true,
|
143
|
-
}),
|
144
|
-
OrderClaimIdIndex.MikroORMIndex(),
|
145
|
-
__metadata("design:type", Object)
|
146
|
-
], OrderChange.prototype, "claim_id", void 0);
|
147
|
-
__decorate([
|
148
|
-
(0, core_1.ManyToOne)(() => claim_1.default, {
|
149
|
-
persist: false,
|
150
|
-
}),
|
151
|
-
__metadata("design:type", claim_1.default)
|
152
|
-
], OrderChange.prototype, "claim", void 0);
|
153
|
-
__decorate([
|
154
|
-
(0, core_1.ManyToOne)({
|
155
|
-
entity: () => exchange_1.default,
|
156
|
-
mapToPk: true,
|
157
|
-
fieldName: "exchange_id",
|
158
|
-
columnType: "text",
|
159
|
-
nullable: true,
|
160
|
-
}),
|
161
|
-
OrderExchangeIdIndex.MikroORMIndex(),
|
162
|
-
__metadata("design:type", Object)
|
163
|
-
], OrderChange.prototype, "exchange_id", void 0);
|
164
|
-
__decorate([
|
165
|
-
(0, core_1.ManyToOne)(() => exchange_1.default, {
|
166
|
-
persist: false,
|
167
|
-
}),
|
168
|
-
__metadata("design:type", exchange_1.default)
|
169
|
-
], OrderChange.prototype, "exchange", void 0);
|
170
76
|
__decorate([
|
171
77
|
(0, core_1.Property)({ columnType: "integer" }),
|
172
78
|
VersionIndex.MikroORMIndex(),
|
173
79
|
__metadata("design:type", Number)
|
174
80
|
], OrderChange.prototype, "version", void 0);
|
175
|
-
__decorate([
|
176
|
-
(0, core_1.Enum)({ items: () => utils_1.OrderChangeType, nullable: true }),
|
177
|
-
OrderChangeTypeIndex.MikroORMIndex(),
|
178
|
-
__metadata("design:type", Object)
|
179
|
-
], OrderChange.prototype, "change_type", void 0);
|
180
81
|
__decorate([
|
181
82
|
(0, core_1.OneToMany)(() => order_change_action_1.default, (action) => action.order_change, {
|
182
83
|
cascade: [core_1.Cascade.PERSIST, "sotf-remove"],
|
@@ -253,7 +154,7 @@ __decorate([
|
|
253
154
|
columnType: "timestamptz",
|
254
155
|
nullable: true,
|
255
156
|
}),
|
256
|
-
__metadata("design:type",
|
157
|
+
__metadata("design:type", Date)
|
257
158
|
], OrderChange.prototype, "canceled_at", void 0);
|
258
159
|
__decorate([
|
259
160
|
(0, core_1.Property)({
|
@@ -272,11 +173,6 @@ __decorate([
|
|
272
173
|
}),
|
273
174
|
__metadata("design:type", Date)
|
274
175
|
], OrderChange.prototype, "updated_at", void 0);
|
275
|
-
__decorate([
|
276
|
-
(0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
|
277
|
-
DeletedAtIndex.MikroORMIndex(),
|
278
|
-
__metadata("design:type", Object)
|
279
|
-
], OrderChange.prototype, "deleted_at", void 0);
|
280
176
|
__decorate([
|
281
177
|
(0, core_1.BeforeCreate)(),
|
282
178
|
__metadata("design:type", Function),
|
@@ -291,7 +187,6 @@ __decorate([
|
|
291
187
|
], OrderChange.prototype, "onInit", null);
|
292
188
|
OrderChange = __decorate([
|
293
189
|
(0, core_1.Entity)({ tableName: "order_change" }),
|
294
|
-
(0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions),
|
295
190
|
VersionIndex.MikroORMIndex()
|
296
191
|
], OrderChange);
|
297
192
|
exports.default = OrderChange;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order-change.js","sourceRoot":"","sources":["../../src/models/order-change.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,
|
1
|
+
{"version":3,"file":"order-change.js","sourceRoot":"","sources":["../../src/models/order-change.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAIwB;AACxB,0CAYwB;AACxB,oDAA2B;AAC3B,gFAAqD;AAIrD,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,UAAU;CACpB,CAAC,CAAA;AAEF,MAAM,sBAAsB,GAAG,IAAA,sCAA8B,EAAC;IAC5D,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;CACjC,CAAC,CAAA;AAIa,IAAM,WAAW,GAAjB,MAAM,WAAW;IAAjB;QA4Bb,YAAO,GAAG,IAAI,iBAAU,CAAoB,IAAI,CAAC,CAAA;QAMjD,gBAAW,GAAkB,I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|
|
1
1
|
import { BigNumberRawValue, DAL } from "@medusajs/types";
|
2
2
|
import { BigNumber } from "@medusajs/utils";
|
3
|
-
import { OptionalProps
|
3
|
+
import { OptionalProps } from "@mikro-orm/core";
|
4
4
|
import LineItem from "./line-item";
|
5
5
|
import Order from "./order";
|
6
|
-
type OptionalLineItemProps = DAL.
|
6
|
+
type OptionalLineItemProps = DAL.EntityDateColumns;
|
7
7
|
export default class OrderItem {
|
8
8
|
[OptionalProps]?: OptionalLineItemProps;
|
9
9
|
id: string;
|
10
10
|
order_id: string;
|
11
|
-
order: Rel<Order>;
|
12
11
|
version: number;
|
12
|
+
order: Order;
|
13
13
|
item_id: string;
|
14
|
-
item:
|
14
|
+
item: LineItem;
|
15
15
|
quantity: BigNumber | number;
|
16
16
|
raw_quantity: BigNumberRawValue;
|
17
17
|
fulfilled_quantity: BigNumber | number;
|
@@ -34,4 +34,3 @@ export default class OrderItem {
|
|
34
34
|
onInit(): void;
|
35
35
|
}
|
36
36
|
export {};
|
37
|
-
//# sourceMappingURL=order-item.d.ts.map
|
@@ -49,15 +49,15 @@ let OrderItem = class OrderItem {
|
|
49
49
|
}
|
50
50
|
onCreate() {
|
51
51
|
this.id = (0, utils_1.generateEntityId)(this.id, "orditem");
|
52
|
-
this.order_id
|
53
|
-
this.item_id
|
54
|
-
this.version
|
52
|
+
this.order_id ?? (this.order_id = this.order?.id);
|
53
|
+
this.item_id ?? (this.item_id = this.item?.id);
|
54
|
+
this.version ?? (this.version = this.order?.version);
|
55
55
|
}
|
56
56
|
onInit() {
|
57
57
|
this.id = (0, utils_1.generateEntityId)(this.id, "orditem");
|
58
|
-
this.order_id
|
59
|
-
this.item_id
|
60
|
-
this.version
|
58
|
+
this.order_id ?? (this.order_id = this.order?.id);
|
59
|
+
this.item_id ?? (this.item_id = this.item?.id);
|
60
|
+
this.version ?? (this.version = this.order?.version);
|
61
61
|
}
|
62
62
|
};
|
63
63
|
__decorate([
|
@@ -74,17 +74,17 @@ __decorate([
|
|
74
74
|
OrderIdIndex.MikroORMIndex(),
|
75
75
|
__metadata("design:type", String)
|
76
76
|
], OrderItem.prototype, "order_id", void 0);
|
77
|
-
__decorate([
|
78
|
-
(0, core_1.ManyToOne)(() => order_1.default, {
|
79
|
-
persist: false,
|
80
|
-
}),
|
81
|
-
__metadata("design:type", Object)
|
82
|
-
], OrderItem.prototype, "order", void 0);
|
83
77
|
__decorate([
|
84
78
|
(0, core_1.Property)({ columnType: "integer" }),
|
85
79
|
OrderVersionIndex.MikroORMIndex(),
|
86
80
|
__metadata("design:type", Number)
|
87
81
|
], OrderItem.prototype, "version", void 0);
|
82
|
+
__decorate([
|
83
|
+
(0, core_1.ManyToOne)(() => order_1.default, {
|
84
|
+
persist: false,
|
85
|
+
}),
|
86
|
+
__metadata("design:type", order_1.default)
|
87
|
+
], OrderItem.prototype, "order", void 0);
|
88
88
|
__decorate([
|
89
89
|
(0, core_1.ManyToOne)({
|
90
90
|
entity: () => line_item_1.default,
|
@@ -99,7 +99,7 @@ __decorate([
|
|
99
99
|
(0, core_1.ManyToOne)(() => line_item_1.default, {
|
100
100
|
persist: false,
|
101
101
|
}),
|
102
|
-
__metadata("design:type",
|
102
|
+
__metadata("design:type", line_item_1.default)
|
103
103
|
], OrderItem.prototype, "item", void 0);
|
104
104
|
__decorate([
|
105
105
|
(0, utils_1.MikroOrmBigNumberProperty)(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order-item.js","sourceRoot":"","sources":["../../src/models/order-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,
|
1
|
+
{"version":3,"file":"order-item.js","sourceRoot":"","sources":["../../src/models/order-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAKwB;AACxB,0CAQwB;AACxB,4DAAkC;AAClC,oDAA2B;AAI3B,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,CAAC,UAAU,CAAC;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BACU,IAAI;6CAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;6CACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;yCAMd;AAGD;IADC,IAAA,aAAM,GAAE;;;;uCAMR;AApHkB,SAAS;IAD7B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;GACf,SAAS,CAqH7B;kBArHoB,SAAS"}
|
@@ -1,25 +1,16 @@
|
|
1
1
|
import { DAL } from "@medusajs/types";
|
2
|
-
import { OptionalProps
|
3
|
-
import Claim from "./claim";
|
4
|
-
import Exchange from "./exchange";
|
2
|
+
import { OptionalProps } from "@mikro-orm/core";
|
5
3
|
import Order from "./order";
|
6
|
-
import Return from "./return";
|
7
4
|
import ShippingMethod from "./shipping-method";
|
8
|
-
type OptionalShippingMethodProps = DAL.
|
5
|
+
type OptionalShippingMethodProps = DAL.EntityDateColumns;
|
9
6
|
export default class OrderShippingMethod {
|
10
7
|
[OptionalProps]?: OptionalShippingMethodProps;
|
11
8
|
id: string;
|
12
9
|
order_id: string;
|
13
|
-
order: Rel<Order>;
|
14
|
-
return_id: string | null;
|
15
|
-
return: Rel<Return>;
|
16
|
-
exchange_id: string | null;
|
17
|
-
exchange: Rel<Exchange>;
|
18
|
-
claim_id: string | null;
|
19
|
-
claim: Rel<Claim>;
|
20
10
|
version: number;
|
11
|
+
order: Order;
|
21
12
|
shipping_method_id: string;
|
22
|
-
shipping_method:
|
13
|
+
shipping_method: ShippingMethod;
|
23
14
|
created_at: Date;
|
24
15
|
updated_at: Date;
|
25
16
|
deleted_at: Date | null;
|
@@ -27,4 +18,3 @@ export default class OrderShippingMethod {
|
|
27
18
|
onInit(): void;
|
28
19
|
}
|
29
20
|
export {};
|
30
|
-
//# sourceMappingURL=order-shipping-method.d.ts.map
|