@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
package/dist/index.d.ts
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
export
|
6
|
-
|
7
|
-
export declare const revertMigration: ((options: import("@medusajs/modules-sdk").LoaderOptions<any>, moduleDeclaration?: import("@medusajs/modules-sdk").InternalModuleDeclaration | undefined) => Promise<void>) | undefined;
|
8
|
-
export default moduleDefinition;
|
1
|
+
import { OrderModuleService } from "./services";
|
2
|
+
declare const _default: import("@medusajs/types").ModuleExports<typeof OrderModuleService> & {
|
3
|
+
linkable: Record<string, any>;
|
4
|
+
};
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;;;;AAG9C,wBAEE"}
|
package/dist/index.js
CHANGED
@@ -1,30 +1,8 @@
|
|
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
|
-
|
18
|
-
const
|
19
|
-
|
20
|
-
|
21
|
-
__exportStar(require("./services"), exports);
|
22
|
-
__exportStar(require("./types"), exports);
|
23
|
-
exports.initialize = (0, modules_sdk_1.initializeFactory)({
|
24
|
-
moduleName: modules_sdk_1.Modules.ORDER,
|
25
|
-
moduleDefinition: module_definition_1.moduleDefinition,
|
3
|
+
const _services_1 = require("./services");
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
exports.default = (0, utils_1.Module)(utils_1.Modules.ORDER, {
|
6
|
+
service: _services_1.OrderModuleService,
|
26
7
|
});
|
27
|
-
exports.runMigrations = module_definition_1.moduleDefinition.runMigrations;
|
28
|
-
exports.revertMigration = module_definition_1.moduleDefinition.revertMigration;
|
29
|
-
exports.default = module_definition_1.moduleDefinition;
|
30
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,yCAA8C;AAC9C,2CAAiD;AAEjD,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,KAAK,EAAE;IACnC,OAAO,EAAE,8BAAkB;CAC5B,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240219102530.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240219102530.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAijB1B"}
|
@@ -32,6 +32,7 @@ class Migration20240219102530 extends migrations_1.Migration {
|
|
32
32
|
CREATE TABLE IF NOT EXISTS "order" (
|
33
33
|
"id" TEXT NOT NULL,
|
34
34
|
"region_id" TEXT NULL,
|
35
|
+
"display_id" SERIAL,
|
35
36
|
"customer_id" TEXT NULL,
|
36
37
|
"version" INTEGER NOT NULL DEFAULT 1,
|
37
38
|
"sales_channel_id" TEXT NULL,
|
@@ -109,6 +110,11 @@ class Migration20240219102530 extends migrations_1.Migration {
|
|
109
110
|
|
110
111
|
${(0, utils_1.generatePostgresAlterColummnIfExistStatement)("order", ["fulfillment_status", "payment_status", "display_id"], "DROP NOT NULL")}
|
111
112
|
|
113
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_display_id" ON "order" (
|
114
|
+
display_id
|
115
|
+
)
|
116
|
+
WHERE deleted_at IS NOT NULL;
|
117
|
+
|
112
118
|
CREATE INDEX IF NOT EXISTS "IDX_order_region_id" ON "order" (
|
113
119
|
region_id
|
114
120
|
)
|
@@ -437,6 +443,7 @@ class Migration20240219102530 extends migrations_1.Migration {
|
|
437
443
|
CREATE TABLE IF NOT EXISTS "order_transaction" (
|
438
444
|
"id" TEXT NOT NULL,
|
439
445
|
"order_id" TEXT NOT NULL,
|
446
|
+
"version" INTEGER NOT NULL DEFAULT 1,
|
440
447
|
"amount" NUMERIC NOT NULL,
|
441
448
|
"raw_amount" JSONB NOT NULL,
|
442
449
|
"currency_code" TEXT NOT NULL,
|
@@ -444,21 +451,48 @@ class Migration20240219102530 extends migrations_1.Migration {
|
|
444
451
|
"reference_id" TEXT NULL,
|
445
452
|
"created_at" TIMESTAMPTZ NOT NULL DEFAULT Now(),
|
446
453
|
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT Now(),
|
454
|
+
"deleted_at" timestamptz NULL,
|
447
455
|
CONSTRAINT "order_transaction_pkey" PRIMARY KEY ("id")
|
448
456
|
);
|
449
457
|
|
450
|
-
CREATE INDEX IF NOT EXISTS "
|
451
|
-
order_id
|
452
|
-
|
458
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_order_id_version" ON "order_transaction" (
|
459
|
+
order_id,
|
460
|
+
version
|
461
|
+
)
|
462
|
+
WHERE deleted_at IS NOT NULL;
|
453
463
|
|
454
464
|
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_currency_code" ON "order_transaction" (
|
455
465
|
currency_code
|
456
|
-
)
|
466
|
+
)
|
467
|
+
WHERE deleted_at IS NOT NULL;
|
457
468
|
|
458
469
|
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_reference_id" ON "order_transaction" (
|
459
470
|
reference_id
|
471
|
+
)
|
472
|
+
WHERE deleted_at IS NOT NULL;
|
473
|
+
|
474
|
+
CREATE TABLE IF NOT EXISTS "return_reason"
|
475
|
+
(
|
476
|
+
id character varying NOT NULL,
|
477
|
+
value character varying NOT NULL,
|
478
|
+
label character varying NOT NULL,
|
479
|
+
description character varying,
|
480
|
+
metadata JSONB NULL,
|
481
|
+
parent_return_reason_id character varying,
|
482
|
+
created_at timestamp with time zone NOT NULL DEFAULT now(),
|
483
|
+
updated_at timestamp with time zone NOT NULL DEFAULT now(),
|
484
|
+
deleted_at timestamp with time zone,
|
485
|
+
CONSTRAINT "return_reason_pkey" PRIMARY KEY (id),
|
486
|
+
CONSTRAINT "return_reason_parent_return_reason_id_foreign" FOREIGN KEY (parent_return_reason_id)
|
487
|
+
REFERENCES "return_reason" (id) MATCH SIMPLE
|
488
|
+
ON UPDATE NO ACTION
|
489
|
+
ON DELETE NO ACTION
|
460
490
|
);
|
461
491
|
|
492
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "IDX_return_reason_value" ON "return_reason" USING btree (value ASC NULLS LAST)
|
493
|
+
WHERE deleted_at IS NOT NULL;
|
494
|
+
|
495
|
+
|
462
496
|
ALTER TABLE if exists "order"
|
463
497
|
ADD CONSTRAINT "order_shipping_address_id_foreign" FOREIGN KEY ("shipping_address_id") REFERENCES "order_address" ("id") ON
|
464
498
|
UPDATE CASCADE ON
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Migration20240219102530.js","sourceRoot":"","sources":["../../src/migrations/Migration20240219102530.ts"],"names":[],"mappings":";;;AAAA,2CAA8E;AAC9E,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG
|
1
|
+
{"version":3,"file":"Migration20240219102530.js","sourceRoot":"","sources":["../../src/migrations/Migration20240219102530.ts"],"names":[],"mappings":";;;AAAA,2CAA8E;AAC9E,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuGR,IAAA,oDAA4C,EAC5C,OAAO,EACP,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,CAAC,EACtD,eAAe,CAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAicF,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AAljBD,0DAkjBC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240604100512.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240604100512.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAoW1B"}
|
@@ -0,0 +1,364 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240604100512 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240604100512 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
const sql = `
|
8
|
+
ALTER TABLE "order_change"
|
9
|
+
ADD COLUMN if NOT exists "change_type" TEXT NULL;
|
10
|
+
|
11
|
+
ALTER TABLE "order_change"
|
12
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
13
|
+
|
14
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_change_type" ON "order_change" (
|
15
|
+
change_type
|
16
|
+
);
|
17
|
+
|
18
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_deleted_at" ON "order_change" (
|
19
|
+
deleted_at
|
20
|
+
);
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
ALTER TABLE "order_transaction"
|
26
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
27
|
+
|
28
|
+
ALTER TABLE "order_transaction"
|
29
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
30
|
+
|
31
|
+
ALTER TABLE "order_transaction"
|
32
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
33
|
+
|
34
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_return_id" ON "order_transaction" (
|
35
|
+
return_id
|
36
|
+
)
|
37
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
38
|
+
|
39
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_claim_id" ON "order_transaction" (
|
40
|
+
claim_id
|
41
|
+
)
|
42
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
43
|
+
|
44
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_transaction_exchange_id" ON "order_transaction" (
|
45
|
+
exchange_id
|
46
|
+
)
|
47
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
ALTER TABLE "order_shipping"
|
52
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
53
|
+
|
54
|
+
ALTER TABLE "order_shipping"
|
55
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
56
|
+
|
57
|
+
ALTER TABLE "order_shipping"
|
58
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
59
|
+
|
60
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_return_id" ON "order_shipping" (
|
61
|
+
return_id
|
62
|
+
)
|
63
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
64
|
+
|
65
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_claim_id" ON "order_shipping" (
|
66
|
+
claim_id
|
67
|
+
)
|
68
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
69
|
+
|
70
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_exchange_id" ON "order_shipping" (
|
71
|
+
exchange_id
|
72
|
+
)
|
73
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
ALTER TABLE "order_change"
|
79
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
80
|
+
|
81
|
+
ALTER TABLE "order_change"
|
82
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
83
|
+
|
84
|
+
ALTER TABLE "order_change"
|
85
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
86
|
+
|
87
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_return_id" ON "order_change" (
|
88
|
+
return_id
|
89
|
+
)
|
90
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
91
|
+
|
92
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_claim_id" ON "order_change" (
|
93
|
+
claim_id
|
94
|
+
)
|
95
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
96
|
+
|
97
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_exchange_id" ON "order_change" (
|
98
|
+
exchange_id
|
99
|
+
)
|
100
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
ALTER TABLE "order_change_action"
|
105
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
106
|
+
|
107
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_deleted_at" ON "order_change_action" (
|
108
|
+
deleted_at
|
109
|
+
);
|
110
|
+
|
111
|
+
ALTER TABLE "order_change_action"
|
112
|
+
ADD COLUMN if NOT exists "return_id" TEXT NULL;
|
113
|
+
|
114
|
+
ALTER TABLE "order_change_action"
|
115
|
+
ADD COLUMN if NOT exists "claim_id" TEXT NULL;
|
116
|
+
|
117
|
+
ALTER TABLE "order_change_action"
|
118
|
+
ADD COLUMN if NOT exists "exchange_id" TEXT NULL;
|
119
|
+
|
120
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_return_id" ON "order_change_action" (
|
121
|
+
return_id
|
122
|
+
)
|
123
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
124
|
+
|
125
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_claim_id" ON "order_change_action" (
|
126
|
+
claim_id
|
127
|
+
)
|
128
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
129
|
+
|
130
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_change_action_exchange_id" ON "order_change_action" (
|
131
|
+
exchange_id
|
132
|
+
)
|
133
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
CREATE TYPE return_status_enum AS ENUM (
|
138
|
+
'requested',
|
139
|
+
'received',
|
140
|
+
'partially_received',
|
141
|
+
'canceled'
|
142
|
+
);
|
143
|
+
|
144
|
+
CREATE TABLE IF NOT EXISTS "return" (
|
145
|
+
"id" TEXT NOT NULL,
|
146
|
+
"order_id" TEXT NOT NULL,
|
147
|
+
"claim_id" TEXT NULL,
|
148
|
+
"exchange_id" TEXT NULL,
|
149
|
+
"order_version" INTEGER NOT NULL,
|
150
|
+
"display_id" SERIAL,
|
151
|
+
"status" return_status_enum NOT NULL DEFAULT 'requested',
|
152
|
+
"no_notification" boolean NULL,
|
153
|
+
"refund_amount" NUMERIC NULL,
|
154
|
+
"raw_refund_amount" JSONB NULL,
|
155
|
+
"metadata" jsonb NULL,
|
156
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
157
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
158
|
+
"deleted_at" timestamptz NULL,
|
159
|
+
"received_at" timestamptz NULL,
|
160
|
+
"canceled_at" timestamptz NULL,
|
161
|
+
CONSTRAINT "return_pkey" PRIMARY KEY ("id")
|
162
|
+
);
|
163
|
+
|
164
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_order_id" ON "return" (
|
165
|
+
order_id
|
166
|
+
)
|
167
|
+
WHERE deleted_at IS NOT NULL;
|
168
|
+
|
169
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_claim_id" ON "return" (
|
170
|
+
claim_id
|
171
|
+
)
|
172
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;
|
173
|
+
|
174
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_exchange_id" ON "return" (
|
175
|
+
exchange_id
|
176
|
+
)
|
177
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;
|
178
|
+
|
179
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_display_id" ON "return" (
|
180
|
+
display_id
|
181
|
+
)
|
182
|
+
WHERE deleted_at IS NOT NULL;
|
183
|
+
|
184
|
+
|
185
|
+
CREATE TABLE IF NOT EXISTS "return_item" (
|
186
|
+
"id" TEXT NOT NULL,
|
187
|
+
"return_id" TEXT NOT NULL,
|
188
|
+
"reason_id" TEXT NULL,
|
189
|
+
"item_id" TEXT NOT NULL,
|
190
|
+
"quantity" NUMERIC NOT NULL,
|
191
|
+
"raw_quantity" JSONB NOT NULL,
|
192
|
+
"received_quantity" NUMERIC NOT NULL DEFAULT 0,
|
193
|
+
"raw_received_quantity" JSONB NOT NULL,
|
194
|
+
"note" TEXT NULL,
|
195
|
+
"metadata" JSONB NULL,
|
196
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
197
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
198
|
+
"deleted_at" timestamptz NULL,
|
199
|
+
CONSTRAINT "return_item_pkey" PRIMARY KEY ("id")
|
200
|
+
);
|
201
|
+
|
202
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" ("deleted_at")
|
203
|
+
WHERE deleted_at IS NOT NULL;
|
204
|
+
|
205
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_return_id" ON "return_item" ("return_id")
|
206
|
+
WHERE deleted_at IS NOT NULL;
|
207
|
+
|
208
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_item_id" ON "return_item" ("item_id")
|
209
|
+
WHERE deleted_at IS NOT NULL;
|
210
|
+
|
211
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_reason_id" ON "return_item" ("reason_id")
|
212
|
+
WHERE deleted_at IS NOT NULL;
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
CREATE TABLE IF NOT EXISTS "order_exchange" (
|
217
|
+
"id" TEXT NOT NULL,
|
218
|
+
"order_id" TEXT NOT NULL,
|
219
|
+
"return_id" TEXT NULL,
|
220
|
+
"order_version" INTEGER NOT NULL,
|
221
|
+
"display_id" SERIAL,
|
222
|
+
"no_notification" BOOLEAN NULL,
|
223
|
+
"allow_backorder" BOOLEAN NOT NULL DEFAULT FALSE,
|
224
|
+
"difference_due" NUMERIC NULL,
|
225
|
+
"raw_difference_due" JSONB NULL,
|
226
|
+
"metadata" JSONB NULL,
|
227
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
228
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
229
|
+
"deleted_at" timestamptz NULL,
|
230
|
+
"canceled_at" timestamptz NULL,
|
231
|
+
CONSTRAINT "order_exchange_pkey" PRIMARY KEY ("id")
|
232
|
+
);
|
233
|
+
|
234
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_display_id" ON "order_exchange" ("display_id")
|
235
|
+
WHERE deleted_at IS NOT NULL;
|
236
|
+
|
237
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_deleted_at" ON "order_exchange" ("deleted_at")
|
238
|
+
WHERE deleted_at IS NOT NULL;
|
239
|
+
|
240
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_order_id" ON "order_exchange" ("order_id")
|
241
|
+
WHERE deleted_at IS NOT NULL;
|
242
|
+
|
243
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_return_id" ON "order_exchange" ("return_id")
|
244
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
245
|
+
|
246
|
+
|
247
|
+
CREATE TABLE IF NOT EXISTS "order_exchange_item" (
|
248
|
+
"id" TEXT NOT NULL,
|
249
|
+
"exchange_id" TEXT NOT NULL,
|
250
|
+
"item_id" TEXT NOT NULL,
|
251
|
+
"quantity" NUMERIC NOT NULL,
|
252
|
+
"raw_quantity" JSONB NOT NULL,
|
253
|
+
"note" TEXT NULL,
|
254
|
+
"metadata" JSONB NULL,
|
255
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
256
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
257
|
+
"deleted_at" timestamptz NULL,
|
258
|
+
CONSTRAINT "order_exchange_item_pkey" PRIMARY KEY ("id")
|
259
|
+
);
|
260
|
+
|
261
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_deleted_at" ON "order_exchange_item" ("deleted_at")
|
262
|
+
WHERE deleted_at IS NOT NULL;
|
263
|
+
|
264
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_exchange_id" ON "order_exchange_item" ("exchange_id")
|
265
|
+
WHERE deleted_at IS NOT NULL;
|
266
|
+
|
267
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_item_id" ON "order_exchange_item" ("item_id")
|
268
|
+
WHERE deleted_at IS NOT NULL;
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
CREATE TYPE order_claim_type_enum AS ENUM (
|
273
|
+
'refund',
|
274
|
+
'replace'
|
275
|
+
);
|
276
|
+
|
277
|
+
CREATE TABLE IF NOT EXISTS "order_claim" (
|
278
|
+
"id" TEXT NOT NULL,
|
279
|
+
"order_id" TEXT NOT NULL,
|
280
|
+
"return_id" TEXT NULL,
|
281
|
+
"order_version" INTEGER NOT NULL,
|
282
|
+
"display_id" SERIAL,
|
283
|
+
"type" order_claim_type_enum NOT NULL,
|
284
|
+
"no_notification" BOOLEAN NULL,
|
285
|
+
"refund_amount" NUMERIC NULL,
|
286
|
+
"raw_refund_amount" JSONB NULL,
|
287
|
+
"metadata" JSONB NULL,
|
288
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
289
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
290
|
+
"deleted_at" timestamptz NULL,
|
291
|
+
"canceled_at" timestamptz NULL,
|
292
|
+
CONSTRAINT "order_claim_pkey" PRIMARY KEY ("id")
|
293
|
+
);
|
294
|
+
|
295
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_display_id" ON "order_claim" ("display_id")
|
296
|
+
WHERE deleted_at IS NOT NULL;
|
297
|
+
|
298
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_deleted_at" ON "order_claim" ("deleted_at")
|
299
|
+
WHERE deleted_at IS NOT NULL;
|
300
|
+
|
301
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_order_id" ON "order_claim" ("order_id")
|
302
|
+
WHERE deleted_at IS NOT NULL;
|
303
|
+
|
304
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_return_id" ON "order_claim" ("return_id")
|
305
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NOT NULL;
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
CREATE TYPE claim_reason_enum AS ENUM (
|
310
|
+
'missing_item',
|
311
|
+
'wrong_item',
|
312
|
+
'production_failure',
|
313
|
+
'other'
|
314
|
+
);
|
315
|
+
|
316
|
+
CREATE TABLE IF NOT EXISTS "order_claim_item" (
|
317
|
+
"id" TEXT NOT NULL,
|
318
|
+
"claim_id" TEXT NOT NULL,
|
319
|
+
"item_id" TEXT NOT NULL,
|
320
|
+
"is_additional_item" BOOLEAN NOT NULL DEFAULT FALSE,
|
321
|
+
"reason" claim_reason_enum NULL,
|
322
|
+
"quantity" NUMERIC NOT NULL,
|
323
|
+
"raw_quantity" JSONB NOT NULL,
|
324
|
+
"note" TEXT NULL,
|
325
|
+
"metadata" JSONB NULL,
|
326
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
327
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
328
|
+
"deleted_at" timestamptz NULL,
|
329
|
+
CONSTRAINT "order_claim_item_pkey" PRIMARY KEY ("id")
|
330
|
+
);
|
331
|
+
|
332
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" ("deleted_at")
|
333
|
+
WHERE deleted_at IS NOT NULL;
|
334
|
+
|
335
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_claim_id" ON "order_claim_item" ("claim_id")
|
336
|
+
WHERE deleted_at IS NOT NULL;
|
337
|
+
|
338
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_item_id" ON "order_claim_item" ("item_id")
|
339
|
+
WHERE deleted_at IS NOT NULL;
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
CREATE TABLE IF NOT EXISTS "order_claim_item_image" (
|
344
|
+
"id" TEXT NOT NULL,
|
345
|
+
"claim_item_id" TEXT NOT NULL,
|
346
|
+
"url" TEXT NOT NULL,
|
347
|
+
"metadata" JSONB NULL,
|
348
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
349
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
350
|
+
"deleted_at" timestamptz NULL,
|
351
|
+
CONSTRAINT "order_claim_item_image_pkey" PRIMARY KEY ("id")
|
352
|
+
);
|
353
|
+
|
354
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_claim_item_id" ON "order_claim_item_image" ("claim_item_id")
|
355
|
+
WHERE "deleted_at" IS NOT NULL;
|
356
|
+
|
357
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_deleted_at" ON "order_claim_item_image" ("deleted_at")
|
358
|
+
WHERE "deleted_at" IS NOT NULL;
|
359
|
+
`;
|
360
|
+
this.addSql(sql);
|
361
|
+
}
|
362
|
+
}
|
363
|
+
exports.Migration20240604100512 = Migration20240604100512;
|
364
|
+
//# sourceMappingURL=Migration20240604100512.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240604100512.js","sourceRoot":"","sources":["../../src/migrations/Migration20240604100512.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgWX,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AArWD,0DAqWC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240715102100.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240715102100.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ1B"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240715102100 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240715102100 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
const sql = `
|
8
|
+
ALTER TABLE "return"
|
9
|
+
ADD COLUMN if NOT exists "location_id" TEXT NULL;
|
10
|
+
`;
|
11
|
+
this.addSql(sql);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
exports.Migration20240715102100 = Migration20240715102100;
|
15
|
+
//# sourceMappingURL=Migration20240715102100.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240715102100.js","sourceRoot":"","sources":["../../src/migrations/Migration20240715102100.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;KAGX,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AATD,0DASC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240715174100.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240715174100.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAc1B"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240715174100 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240715174100 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
const sql = `
|
8
|
+
DROP INDEX IF EXISTS "IDX_order_shipping_method_shipping_option_id";
|
9
|
+
|
10
|
+
ALTER TABLE "order_shipping_method"
|
11
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
12
|
+
|
13
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_method_shipping_option_id" ON "order_shipping_method" (
|
14
|
+
shipping_option_id
|
15
|
+
) WHERE deleted_at IS NULL;
|
16
|
+
`;
|
17
|
+
this.addSql(sql);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.Migration20240715174100 = Migration20240715174100;
|
21
|
+
//# sourceMappingURL=Migration20240715174100.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240715174100.js","sourceRoot":"","sources":["../../src/migrations/Migration20240715174100.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;KASX,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AAfD,0DAeC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240716081800.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240716081800.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CA4D1B"}
|