@medusajs/order 0.1.3-snapshot-20240718083016 → 0.1.3-snapshot-20240719133408
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 +993 -241
- 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 +58 -183
- 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,22 +14,57 @@ 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"));
|
18
20
|
const order_change_action_1 = __importDefault(require("./order-change-action"));
|
21
|
+
const return_1 = __importDefault(require("./return"));
|
19
22
|
const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
20
23
|
tableName: "order_change",
|
21
24
|
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",
|
22
41
|
});
|
23
42
|
const OrderChangeStatusIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
24
43
|
tableName: "order_change",
|
25
44
|
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",
|
26
56
|
});
|
27
57
|
const VersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
28
58
|
tableName: "order_change",
|
29
59
|
columns: ["order_id", "version"],
|
60
|
+
where: "deleted_at IS NOT NULL",
|
30
61
|
});
|
31
62
|
let OrderChange = class OrderChange {
|
32
63
|
constructor() {
|
64
|
+
this.return_id = null;
|
65
|
+
this.claim_id = null;
|
66
|
+
this.exchange_id = null;
|
67
|
+
this.change_type = null;
|
33
68
|
this.actions = new core_1.Collection(this);
|
34
69
|
this.description = null;
|
35
70
|
this.status = utils_1.OrderChangeStatus.PENDING;
|
@@ -42,14 +77,22 @@ let OrderChange = class OrderChange {
|
|
42
77
|
this.declined_reason = null;
|
43
78
|
this.metadata = null;
|
44
79
|
this.canceled_by = null;
|
80
|
+
this.canceled_at = null;
|
81
|
+
this.deleted_at = null;
|
45
82
|
}
|
46
83
|
onCreate() {
|
47
84
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordch");
|
48
|
-
this.order_id
|
85
|
+
this.order_id ??= this.order?.id;
|
86
|
+
this.return_id ??= this.return?.id;
|
87
|
+
this.claim_id ??= this.claim?.id;
|
88
|
+
this.exchange_id ??= this.exchange?.id;
|
49
89
|
}
|
50
90
|
onInit() {
|
51
91
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordch");
|
52
|
-
this.order_id
|
92
|
+
this.order_id ??= this.order?.id;
|
93
|
+
this.return_id ??= this.return?.id;
|
94
|
+
this.claim_id ??= this.claim?.id;
|
95
|
+
this.exchange_id ??= this.exchange?.id;
|
53
96
|
}
|
54
97
|
};
|
55
98
|
__decorate([
|
@@ -71,13 +114,69 @@ __decorate([
|
|
71
114
|
(0, core_1.ManyToOne)(() => order_1.default, {
|
72
115
|
persist: false,
|
73
116
|
}),
|
74
|
-
__metadata("design:type",
|
117
|
+
__metadata("design:type", Object)
|
75
118
|
], 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);
|
76
170
|
__decorate([
|
77
171
|
(0, core_1.Property)({ columnType: "integer" }),
|
78
172
|
VersionIndex.MikroORMIndex(),
|
79
173
|
__metadata("design:type", Number)
|
80
174
|
], 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);
|
81
180
|
__decorate([
|
82
181
|
(0, core_1.OneToMany)(() => order_change_action_1.default, (action) => action.order_change, {
|
83
182
|
cascade: [core_1.Cascade.PERSIST, "sotf-remove"],
|
@@ -154,7 +253,7 @@ __decorate([
|
|
154
253
|
columnType: "timestamptz",
|
155
254
|
nullable: true,
|
156
255
|
}),
|
157
|
-
__metadata("design:type",
|
256
|
+
__metadata("design:type", Object)
|
158
257
|
], OrderChange.prototype, "canceled_at", void 0);
|
159
258
|
__decorate([
|
160
259
|
(0, core_1.Property)({
|
@@ -173,6 +272,11 @@ __decorate([
|
|
173
272
|
}),
|
174
273
|
__metadata("design:type", Date)
|
175
274
|
], 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);
|
176
280
|
__decorate([
|
177
281
|
(0, core_1.BeforeCreate)(),
|
178
282
|
__metadata("design:type", Function),
|
@@ -187,6 +291,7 @@ __decorate([
|
|
187
291
|
], OrderChange.prototype, "onInit", null);
|
188
292
|
OrderChange = __decorate([
|
189
293
|
(0, core_1.Entity)({ tableName: "order_change" }),
|
294
|
+
(0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions),
|
190
295
|
VersionIndex.MikroORMIndex()
|
191
296
|
], OrderChange);
|
192
297
|
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,2CAMwB;AACxB,0CAcwB;AAExB,oDAAgC;AAChC,0DAAsC;AACtC,oDAA2B;AAC3B,gFAAqD;AACrD,sDAA6B;AAI7B,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC;IACnD,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,kDAAkD;CAC1D,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG,IAAA,sCAA8B,EAAC;IACvD,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,iDAAiD;CACzD,CAAC,CAAA;AAEF,MAAM,oBAAoB,GAAG,IAAA,sCAA8B,EAAC;IAC1D,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,oDAAoD;CAC5D,CAAC,CAAA;AAEF,MAAM,sBAAsB,GAAG,IAAA,sCAA8B,EAAC;IAC5D,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,oBAAoB,GAAG,IAAA,sCAA8B,EAAC;IAC1D,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,aAAa;IACtB,KA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ACR,UAAU,EAAE,aAAa;QACzB,QAAQ,EAAE,IAAI;KACf,CAAC;8BACY,IAAI;gDAAA;AAGlB;IADC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAChB;AAMjC;IAJC,IAAA,eAAQ,EAAC;QACR,UAAU,EAAE,aAAa;QACzB,QAAQ,EAAE,IAAI;KACf,CAAC;;gDAC8B;AAOhC;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;AA5KkB,WAAW;IAH/B,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;IACrC,IAAA,aAAM,EAAC,gBAAQ,CAAC,kCAAkC,CAAC;IACnD,YAAY,CAAC,aAAa,EAAE;GACR,WAAW,CA6K/B;kBA7KoB,WAAW"}
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import { BigNumberRawValue, DAL } from "@medusajs/types";
|
2
2
|
import { BigNumber } from "@medusajs/utils";
|
3
|
-
import { OptionalProps } from "@mikro-orm/core";
|
3
|
+
import { OptionalProps, Rel } 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.ModelDateColumns;
|
7
7
|
export default class OrderItem {
|
8
8
|
[OptionalProps]?: OptionalLineItemProps;
|
9
9
|
id: string;
|
10
10
|
order_id: string;
|
11
|
+
order: Rel<Order>;
|
11
12
|
version: number;
|
12
|
-
order: Order;
|
13
13
|
item_id: string;
|
14
|
-
item: LineItem
|
14
|
+
item: Rel<LineItem>;
|
15
15
|
quantity: BigNumber | number;
|
16
16
|
raw_quantity: BigNumberRawValue;
|
17
17
|
fulfilled_quantity: BigNumber | number;
|
@@ -34,3 +34,4 @@ export default class OrderItem {
|
|
34
34
|
onInit(): void;
|
35
35
|
}
|
36
36
|
export {};
|
37
|
+
//# sourceMappingURL=order-item.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order-item.d.ts","sourceRoot":"","sources":["../../src/models/order-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EACL,SAAS,EAIV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAKL,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,KAAK,qBAAqB,GAAG,GAAG,CAAC,gBAAgB,CAAA;AA2BjD,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,CAAC,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAA;IAGvC,EAAE,EAAE,MAAM,CAAA;IASV,QAAQ,EAAE,MAAM,CAAA;IAKhB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAIjB,OAAO,EAAE,MAAM,CAAA;IASf,OAAO,EAAE,MAAM,CAAA;IAKf,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IAGnB,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAA;IAG5B,YAAY,EAAE,iBAAiB,CAAA;IAG/B,kBAAkB,EAAE,SAAS,GAAG,MAAM,CAAI;IAG1C,sBAAsB,EAAE,iBAAiB,CAAA;IAGzC,gBAAgB,EAAE,SAAS,GAAG,MAAM,CAAI;IAGxC,oBAAoB,EAAE,iBAAiB,CAAA;IAGvC,yBAAyB,EAAE,SAAS,GAAG,MAAM,CAAI;IAGjD,6BAA6B,EAAE,iBAAiB,CAAA;IAGhD,wBAAwB,EAAE,SAAS,GAAG,MAAM,CAAI;IAGhD,4BAA4B,EAAE,iBAAiB,CAAA;IAG/C,yBAAyB,EAAE,SAAS,GAAG,MAAM,CAAI;IAGjD,6BAA6B,EAAE,iBAAiB,CAAA;IAGhD,oBAAoB,EAAE,SAAS,GAAG,MAAM,CAAI;IAG5C,wBAAwB,EAAE,iBAAiB,CAAA;IAG3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAO;IAO/C,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAQR,MAAM;CAMP"}
|
@@ -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;
|
53
|
+
this.item_id ??= this.item?.id;
|
54
|
+
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;
|
59
|
+
this.item_id ??= this.item?.id;
|
60
|
+
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.Property)({ columnType: "integer" }),
|
79
|
-
OrderVersionIndex.MikroORMIndex(),
|
80
|
-
__metadata("design:type", Number)
|
81
|
-
], OrderItem.prototype, "version", void 0);
|
82
77
|
__decorate([
|
83
78
|
(0, core_1.ManyToOne)(() => order_1.default, {
|
84
79
|
persist: false,
|
85
80
|
}),
|
86
|
-
__metadata("design:type",
|
81
|
+
__metadata("design:type", Object)
|
87
82
|
], OrderItem.prototype, "order", void 0);
|
83
|
+
__decorate([
|
84
|
+
(0, core_1.Property)({ columnType: "integer" }),
|
85
|
+
OrderVersionIndex.MikroORMIndex(),
|
86
|
+
__metadata("design:type", Number)
|
87
|
+
], OrderItem.prototype, "version", 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", Object)
|
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,0CASwB;AAC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,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,16 +1,25 @@
|
|
1
1
|
import { DAL } from "@medusajs/types";
|
2
|
-
import { OptionalProps } from "@mikro-orm/core";
|
2
|
+
import { OptionalProps, Rel } from "@mikro-orm/core";
|
3
|
+
import Claim from "./claim";
|
4
|
+
import Exchange from "./exchange";
|
3
5
|
import Order from "./order";
|
6
|
+
import Return from "./return";
|
4
7
|
import ShippingMethod from "./shipping-method";
|
5
|
-
type OptionalShippingMethodProps = DAL.
|
8
|
+
type OptionalShippingMethodProps = DAL.ModelDateColumns;
|
6
9
|
export default class OrderShippingMethod {
|
7
10
|
[OptionalProps]?: OptionalShippingMethodProps;
|
8
11
|
id: string;
|
9
12
|
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>;
|
10
20
|
version: number;
|
11
|
-
order: Order;
|
12
21
|
shipping_method_id: string;
|
13
|
-
shipping_method: ShippingMethod
|
22
|
+
shipping_method: Rel<ShippingMethod>;
|
14
23
|
created_at: Date;
|
15
24
|
updated_at: Date;
|
16
25
|
deleted_at: Date | null;
|
@@ -18,3 +27,4 @@ export default class OrderShippingMethod {
|
|
18
27
|
onInit(): void;
|
19
28
|
}
|
20
29
|
export {};
|
30
|
+
//# sourceMappingURL=order-shipping-method.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order-shipping-method.d.ts","sourceRoot":"","sources":["../../src/models/order-shipping-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAKrC,OAAO,EAKL,aAAa,EAGb,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAE9C,KAAK,2BAA2B,GAAG,GAAG,CAAC,gBAAgB,CAAA;AA6CvD,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC,CAAC,aAAa,CAAC,CAAC,EAAE,2BAA2B,CAAA;IAG7C,EAAE,EAAE,MAAM,CAAA;IASV,QAAQ,EAAE,MAAM,CAAA;IAKhB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAUjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;IAK/B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAUnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAK1B,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IAUvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAKvB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAIjB,OAAO,EAAE,MAAM,CAAA;IASf,kBAAkB,EAAE,MAAM,CAAA;IAK1B,eAAe,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IAOpC,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAWR,MAAM;CASP"}
|
@@ -14,13 +14,31 @@ 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 shipping_method_1 = __importDefault(require("./shipping-method"));
|
19
22
|
const OrderIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
20
23
|
tableName: "order_shipping",
|
21
24
|
columns: ["order_id"],
|
22
25
|
where: "deleted_at IS NOT NULL",
|
23
26
|
});
|
27
|
+
const ReturnIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
28
|
+
tableName: "order_shipping",
|
29
|
+
columns: "return_id",
|
30
|
+
where: "return_id IS NOT NULL AND deleted_at IS NOT NULL",
|
31
|
+
});
|
32
|
+
const ExchangeIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
33
|
+
tableName: "order_shipping",
|
34
|
+
columns: ["exchange_id"],
|
35
|
+
where: "exchange_id IS NOT NULL AND deleted_at IS NOT NULL",
|
36
|
+
});
|
37
|
+
const ClaimIdIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
38
|
+
tableName: "order_shipping",
|
39
|
+
columns: ["claim_id"],
|
40
|
+
where: "claim_id IS NOT NULL AND deleted_at IS NOT NULL",
|
41
|
+
});
|
24
42
|
const OrderVersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
25
43
|
tableName: "order_shipping",
|
26
44
|
columns: ["version"],
|
@@ -38,19 +56,26 @@ const DeletedAtIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
|
38
56
|
});
|
39
57
|
let OrderShippingMethod = class OrderShippingMethod {
|
40
58
|
constructor() {
|
59
|
+
this.return_id = null;
|
41
60
|
this.deleted_at = null;
|
42
61
|
}
|
43
62
|
onCreate() {
|
44
63
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordspmv");
|
45
|
-
this.order_id
|
46
|
-
this.
|
47
|
-
this.
|
64
|
+
this.order_id ??= this.order?.id;
|
65
|
+
this.return_id ??= this.return?.id;
|
66
|
+
this.claim_id ??= this.claim?.id;
|
67
|
+
this.exchange_id ??= this.exchange?.id;
|
68
|
+
this.shipping_method_id ??= this.shipping_method?.id;
|
69
|
+
this.version ??= this.order?.version;
|
48
70
|
}
|
49
71
|
onInit() {
|
50
72
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordspmv");
|
51
|
-
this.order_id
|
52
|
-
this.
|
53
|
-
this.
|
73
|
+
this.order_id ??= this.order?.id;
|
74
|
+
this.return_id ??= this.return?.id;
|
75
|
+
this.claim_id ??= this.claim?.id;
|
76
|
+
this.exchange_id ??= this.exchange?.id;
|
77
|
+
this.shipping_method_id ??= this.shipping_method?.id;
|
78
|
+
this.version ??= this.order?.version;
|
54
79
|
}
|
55
80
|
};
|
56
81
|
__decorate([
|
@@ -67,17 +92,68 @@ __decorate([
|
|
67
92
|
OrderIdIndex.MikroORMIndex(),
|
68
93
|
__metadata("design:type", String)
|
69
94
|
], OrderShippingMethod.prototype, "order_id", void 0);
|
70
|
-
__decorate([
|
71
|
-
(0, core_1.Property)({ columnType: "integer" }),
|
72
|
-
OrderVersionIndex.MikroORMIndex(),
|
73
|
-
__metadata("design:type", Number)
|
74
|
-
], OrderShippingMethod.prototype, "version", void 0);
|
75
95
|
__decorate([
|
76
96
|
(0, core_1.ManyToOne)(() => order_1.default, {
|
77
97
|
persist: false,
|
78
98
|
}),
|
79
|
-
__metadata("design:type",
|
99
|
+
__metadata("design:type", Object)
|
80
100
|
], OrderShippingMethod.prototype, "order", void 0);
|
101
|
+
__decorate([
|
102
|
+
(0, core_1.ManyToOne)({
|
103
|
+
entity: () => return_1.default,
|
104
|
+
mapToPk: true,
|
105
|
+
fieldName: "return_id",
|
106
|
+
columnType: "text",
|
107
|
+
nullable: true,
|
108
|
+
}),
|
109
|
+
ReturnIdIndex.MikroORMIndex(),
|
110
|
+
__metadata("design:type", Object)
|
111
|
+
], OrderShippingMethod.prototype, "return_id", void 0);
|
112
|
+
__decorate([
|
113
|
+
(0, core_1.ManyToOne)(() => return_1.default, {
|
114
|
+
persist: false,
|
115
|
+
}),
|
116
|
+
__metadata("design:type", Object)
|
117
|
+
], OrderShippingMethod.prototype, "return", void 0);
|
118
|
+
__decorate([
|
119
|
+
(0, core_1.ManyToOne)({
|
120
|
+
entity: () => exchange_1.default,
|
121
|
+
mapToPk: true,
|
122
|
+
fieldName: "exchange_id",
|
123
|
+
columnType: "text",
|
124
|
+
nullable: true,
|
125
|
+
}),
|
126
|
+
ExchangeIdIndex.MikroORMIndex(),
|
127
|
+
__metadata("design:type", Object)
|
128
|
+
], OrderShippingMethod.prototype, "exchange_id", void 0);
|
129
|
+
__decorate([
|
130
|
+
(0, core_1.ManyToOne)(() => exchange_1.default, {
|
131
|
+
persist: false,
|
132
|
+
}),
|
133
|
+
__metadata("design:type", Object)
|
134
|
+
], OrderShippingMethod.prototype, "exchange", void 0);
|
135
|
+
__decorate([
|
136
|
+
(0, core_1.ManyToOne)({
|
137
|
+
entity: () => claim_1.default,
|
138
|
+
mapToPk: true,
|
139
|
+
fieldName: "claim_id",
|
140
|
+
columnType: "text",
|
141
|
+
nullable: true,
|
142
|
+
}),
|
143
|
+
ClaimIdIndex.MikroORMIndex(),
|
144
|
+
__metadata("design:type", Object)
|
145
|
+
], OrderShippingMethod.prototype, "claim_id", void 0);
|
146
|
+
__decorate([
|
147
|
+
(0, core_1.ManyToOne)(() => claim_1.default, {
|
148
|
+
persist: false,
|
149
|
+
}),
|
150
|
+
__metadata("design:type", Object)
|
151
|
+
], OrderShippingMethod.prototype, "claim", void 0);
|
152
|
+
__decorate([
|
153
|
+
(0, core_1.Property)({ columnType: "integer" }),
|
154
|
+
OrderVersionIndex.MikroORMIndex(),
|
155
|
+
__metadata("design:type", Number)
|
156
|
+
], OrderShippingMethod.prototype, "version", void 0);
|
81
157
|
__decorate([
|
82
158
|
(0, core_1.ManyToOne)({
|
83
159
|
entity: () => shipping_method_1.default,
|
@@ -92,7 +168,7 @@ __decorate([
|
|
92
168
|
(0, core_1.ManyToOne)(() => shipping_method_1.default, {
|
93
169
|
persist: false,
|
94
170
|
}),
|
95
|
-
__metadata("design:type",
|
171
|
+
__metadata("design:type", Object)
|
96
172
|
], OrderShippingMethod.prototype, "shipping_method", void 0);
|
97
173
|
__decorate([
|
98
174
|
(0, core_1.Property)({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order-shipping-method.js","sourceRoot":"","sources":["../../src/models/order-shipping-method.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAGwB;AACxB,
|
1
|
+
{"version":3,"file":"order-shipping-method.js","sourceRoot":"","sources":["../../src/models/order-shipping-method.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2CAGwB;AACxB,0CASwB;AACxB,oDAA2B;AAC3B,0DAAiC;AACjC,oDAA2B;AAC3B,sDAA6B;AAC7B,wEAA8C;AAI9C,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC;IACnD,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,kDAAkD;CAC1D,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,IAAA,sCAA8B,EAAC;IACrD,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,KAAK,EAAE,oDAAoD;CAC5D,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,IAAA,sCAA8B,EAAC;IAClD,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,KAAK,EAAE,iDAAiD;CACzD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IAAI,EAAE;QAC1B,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC;8BACU,IAAI;uDAAA;AAIhB;IAFC,IAAA,eAAQ,EAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,cAAc,CAAC,aAAa,EAAE;;uDACD;AAG9B;IADC,IAAA,mBAAY,GAAE;;;;mDASd;AAGD;IADC,IAAA,aAAM,GAAE;;;;iDASR;AA1HkB,mBAAmB;IADvC,IAAA,aAAM,EAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;GACnB,mBAAmB,CA2HvC;kBA3HoB,mBAAmB"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { BigNumber } from "@medusajs/utils";
|
2
|
-
import {
|
2
|
+
import { Rel } from "@mikro-orm/core";
|
3
|
+
import Order from "./order";
|
3
4
|
type OrderSummaryTotals = {
|
4
5
|
total: BigNumber;
|
5
6
|
subtotal: BigNumber;
|
@@ -13,17 +14,14 @@ type OrderSummaryTotals = {
|
|
13
14
|
net_total: BigNumber;
|
14
15
|
net_subtotal: BigNumber;
|
15
16
|
net_total_tax: BigNumber;
|
16
|
-
future_total: BigNumber;
|
17
|
-
future_subtotal: BigNumber;
|
18
|
-
future_total_tax: BigNumber;
|
19
|
-
future_projected_total: BigNumber;
|
20
17
|
balance: BigNumber;
|
21
|
-
|
18
|
+
paid_total: BigNumber;
|
19
|
+
refunded_total: BigNumber;
|
22
20
|
};
|
23
21
|
export default class OrderSummary {
|
24
22
|
id: string;
|
25
23
|
order_id: string;
|
26
|
-
order: Order
|
24
|
+
order: Rel<Order>;
|
27
25
|
version: number;
|
28
26
|
totals: OrderSummaryTotals | null;
|
29
27
|
created_at: Date;
|
@@ -33,3 +31,4 @@ export default class OrderSummary {
|
|
33
31
|
onInit(): void;
|
34
32
|
}
|
35
33
|
export {};
|
34
|
+
//# sourceMappingURL=order-summary.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order-summary.d.ts","sourceRoot":"","sources":["../../src/models/order-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAOL,GAAG,EACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,EAAE,SAAS,CAAA;IAEpB,aAAa,EAAE,SAAS,CAAA;IACxB,eAAe,EAAE,SAAS,CAAA;IAC1B,cAAc,EAAE,SAAS,CAAA;IACzB,oBAAoB,EAAE,SAAS,CAAA;IAC/B,eAAe,EAAE,SAAS,CAAA;IAC1B,eAAe,EAAE,SAAS,CAAA;IAE1B,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,EAAE,SAAS,CAAA;IACvB,aAAa,EAAE,SAAS,CAAA;IAExB,OAAO,EAAE,SAAS,CAAA;IAElB,UAAU,EAAE,SAAS,CAAA;IACrB,cAAc,EAAE,SAAS,CAAA;CAC1B,CAAA;AAgBD,MAAM,CAAC,OAAO,OAAO,YAAY;IAE/B,EAAE,EAAE,MAAM,CAAA;IASV,QAAQ,EAAE,MAAM,CAAA;IAKhB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IAMjB,OAAO,EAAE,MAAM,CAAI;IAGnB,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAA2B;IAO5D,UAAU,EAAE,IAAI,CAAA;IAQhB,UAAU,EAAE,IAAI,CAAA;IAIhB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ;IAMR,MAAM;CAIP"}
|
@@ -8,10 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
10
|
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
15
|
const utils_1 = require("@medusajs/utils");
|
13
16
|
const core_1 = require("@mikro-orm/core");
|
14
|
-
const
|
17
|
+
const order_1 = __importDefault(require("./order"));
|
15
18
|
const OrderIdVersionIndex = (0, utils_1.createPsqlIndexStatementHelper)({
|
16
19
|
tableName: "order_summary",
|
17
20
|
columns: ["order_id", "version"],
|
@@ -30,11 +33,11 @@ let OrderSummary = class OrderSummary {
|
|
30
33
|
}
|
31
34
|
onCreate() {
|
32
35
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordsum");
|
33
|
-
this.order_id
|
36
|
+
this.order_id ??= this.order?.id;
|
34
37
|
}
|
35
38
|
onInit() {
|
36
39
|
this.id = (0, utils_1.generateEntityId)(this.id, "ordsum");
|
37
|
-
this.order_id
|
40
|
+
this.order_id ??= this.order?.id;
|
38
41
|
}
|
39
42
|
};
|
40
43
|
__decorate([
|
@@ -43,7 +46,7 @@ __decorate([
|
|
43
46
|
], OrderSummary.prototype, "id", void 0);
|
44
47
|
__decorate([
|
45
48
|
(0, core_1.ManyToOne)({
|
46
|
-
entity: () =>
|
49
|
+
entity: () => order_1.default,
|
47
50
|
columnType: "text",
|
48
51
|
fieldName: "order_id",
|
49
52
|
mapToPk: true,
|
@@ -52,10 +55,10 @@ __decorate([
|
|
52
55
|
__metadata("design:type", String)
|
53
56
|
], OrderSummary.prototype, "order_id", void 0);
|
54
57
|
__decorate([
|
55
|
-
(0, core_1.ManyToOne)(() =>
|
58
|
+
(0, core_1.ManyToOne)(() => order_1.default, {
|
56
59
|
persist: false,
|
57
60
|
}),
|
58
|
-
__metadata("design:type",
|
61
|
+
__metadata("design:type", Object)
|
59
62
|
], OrderSummary.prototype, "order", void 0);
|
60
63
|
__decorate([
|
61
64
|
(0, core_1.Property)({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order-summary.js","sourceRoot":"","sources":["../../src/models/order-summary.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"order-summary.js","sourceRoot":"","sources":["../../src/models/order-summary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAIwB;AACxB,0CAQwB;AACxB,oDAA2B;AAwB3B,MAAM,mBAAmB,GAAG,IAAA,sCAA8B,EAAC;IACzD,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;IAChC,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,IAAA,sCAA8B,EAAC;IACpD,SAAS,EAAE,OAAO;IAClB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,wBAAwB;CAChC,CAAC,CAAA;AAIa,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QAsBb,YAAO,GAAW,CAAC,CAAA;QAGnB,WAAM,GAA8B,EAAwB,CAAA;QAmB5D,eAAU,GAAgB,IAAI,CAAA;IAahC,CAAC;IAVC,QAAQ;QACN,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC7C,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,KAAK,EAAE,EAAE,CAAA;IAClC,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC7C,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,KAAK,EAAE,EAAE,CAAA;IAClC,CAAC;CACF,CAAA;AAvDC;IADC,IAAA,iBAAU,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;wCACzB;AASV;IAPC,IAAA,gBAAS,EAAC;QACT,MAAM,EAAE,GAAG,EAAE,C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