@medusajs/order 0.1.3 → 1.0.0-rc-20241003153304
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/joiner-config.d.ts +2 -5
- package/dist/joiner-config.d.ts.map +1 -0
- package/dist/joiner-config.js +21 -28
- package/dist/joiner-config.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 +53 -19
- 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 +371 -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/migrations/Migration20240801085921.d.ts +5 -0
- package/dist/migrations/Migration20240801085921.d.ts.map +1 -0
- package/dist/migrations/Migration20240801085921.js +30 -0
- package/dist/migrations/Migration20240801085921.js.map +1 -0
- package/dist/migrations/Migration20240821164505.d.ts +6 -0
- package/dist/migrations/Migration20240821164505.d.ts.map +1 -0
- package/dist/migrations/Migration20240821164505.js +26 -0
- package/dist/migrations/Migration20240821164505.js.map +1 -0
- package/dist/migrations/Migration20240821170920.d.ts +6 -0
- package/dist/migrations/Migration20240821170920.d.ts.map +1 -0
- package/dist/migrations/Migration20240821170920.js +18 -0
- package/dist/migrations/Migration20240821170920.js.map +1 -0
- package/dist/migrations/Migration20240827133639.d.ts +6 -0
- package/dist/migrations/Migration20240827133639.d.ts.map +1 -0
- package/dist/migrations/Migration20240827133639.js +17 -0
- package/dist/migrations/Migration20240827133639.js.map +1 -0
- package/dist/migrations/Migration20240902195921.d.ts +6 -0
- package/dist/migrations/Migration20240902195921.d.ts.map +1 -0
- package/dist/migrations/Migration20240902195921.js +16 -0
- package/dist/migrations/Migration20240902195921.js.map +1 -0
- package/dist/migrations/Migration20240913092514.d.ts +6 -0
- package/dist/migrations/Migration20240913092514.d.ts.map +1 -0
- package/dist/migrations/Migration20240913092514.js +17 -0
- package/dist/migrations/Migration20240913092514.js.map +1 -0
- package/dist/models/address.d.ts +4 -3
- package/dist/models/address.d.ts.map +1 -0
- package/dist/models/address.js +22 -22
- package/dist/models/address.js.map +1 -1
- package/dist/models/adjustment-line.d.ts +5 -3
- package/dist/models/adjustment-line.d.ts.map +1 -0
- package/dist/models/adjustment-line.js +6 -1
- 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 +157 -0
- package/dist/models/claim-item.js.map +1 -0
- package/dist/models/claim.d.ts +37 -0
- package/dist/models/claim.d.ts.map +1 -0
- package/dist/models/claim.js +201 -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 +35 -0
- package/dist/models/exchange.d.ts.map +1 -0
- package/dist/models/exchange.js +194 -0
- package/dist/models/exchange.js.map +1 -0
- package/dist/models/index.d.ts +18 -9
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +26 -10
- package/dist/models/index.js.map +1 -1
- package/dist/models/line-item-adjustment.d.ts +5 -3
- package/dist/models/line-item-adjustment.d.ts.map +1 -0
- package/dist/models/line-item-adjustment.js +12 -12
- package/dist/models/line-item-adjustment.js.map +1 -1
- package/dist/models/line-item-tax-line.d.ts +5 -3
- package/dist/models/line-item-tax-line.d.ts.map +1 -0
- package/dist/models/line-item-tax-line.js +12 -12
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +11 -8
- package/dist/models/line-item.d.ts.map +1 -0
- package/dist/models/line-item.js +58 -39
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/order-change-action.d.ts +17 -6
- package/dist/models/order-change-action.d.ts.map +1 -0
- package/dist/models/order-change-action.js +110 -8
- package/dist/models/order-change-action.js.map +1 -1
- package/dist/models/order-change.d.ts +18 -6
- package/dist/models/order-change.d.ts.map +1 -0
- package/dist/models/order-change.js +108 -6
- package/dist/models/order-change.js.map +1 -1
- package/dist/models/order-item.d.ts +10 -7
- package/dist/models/order-item.d.ts.map +1 -0
- package/dist/models/order-item.js +29 -19
- package/dist/models/order-item.js.map +1 -1
- package/dist/models/order-shipping-method.d.ts +17 -7
- package/dist/models/order-shipping-method.d.ts.map +1 -0
- package/dist/models/order-shipping-method.js +113 -33
- package/dist/models/order-shipping-method.js.map +1 -1
- package/dist/models/order-summary.d.ts +7 -8
- package/dist/models/order-summary.d.ts.map +1 -0
- package/dist/models/order-summary.js +14 -10
- package/dist/models/order-summary.js.map +1 -1
- package/dist/models/order.d.ts +13 -11
- package/dist/models/order.d.ts.map +1 -0
- package/dist/models/order.js +12 -2
- package/dist/models/order.js.map +1 -1
- package/dist/models/return-item.d.ts +31 -0
- package/dist/models/return-item.d.ts.map +1 -0
- package/dist/models/return-item.js +180 -0
- package/dist/models/return-item.js.map +1 -0
- package/dist/models/return-reason.d.ts +22 -0
- package/dist/models/return-reason.d.ts.map +1 -0
- package/dist/models/return-reason.js +122 -0
- package/dist/models/return-reason.js.map +1 -0
- package/dist/models/return.d.ts +41 -0
- package/dist/models/return.d.ts.map +1 -0
- package/dist/models/return.js +227 -0
- package/dist/models/return.js.map +1 -0
- package/dist/models/shipping-method-adjustment.d.ts +5 -3
- package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
- package/dist/models/shipping-method-adjustment.js +12 -12
- package/dist/models/shipping-method-adjustment.js.map +1 -1
- package/dist/models/shipping-method-tax-line.d.ts +5 -3
- package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
- package/dist/models/shipping-method-tax-line.js +12 -12
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/shipping-method.d.ts +10 -7
- package/dist/models/shipping-method.d.ts.map +1 -0
- package/dist/models/shipping-method.js +42 -24
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/tax-line.d.ts +4 -2
- package/dist/models/tax-line.d.ts.map +1 -0
- package/dist/models/tax-line.js +8 -1
- package/dist/models/tax-line.js.map +1 -1
- package/dist/models/transaction.d.ts +18 -6
- package/dist/models/transaction.d.ts.map +1 -0
- package/dist/models/transaction.js +133 -24
- 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 +5 -2
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +8 -17
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/order.d.ts +2 -4
- package/dist/repositories/order.d.ts.map +1 -0
- package/dist/repositories/order.js +3 -86
- 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/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +556 -0
- package/dist/schema/index.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 +85 -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 +71 -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 +31 -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 +69 -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 +225 -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 +191 -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 +100 -0
- package/dist/services/actions/create-return.js.map +1 -0
- package/dist/services/actions/index.d.ts +12 -0
- package/dist/services/actions/index.d.ts.map +1 -0
- package/dist/services/actions/index.js +28 -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 +71 -0
- package/dist/services/actions/receive-return.js.map +1 -0
- package/dist/services/actions/register-delivery.d.ts +3 -0
- package/dist/services/actions/register-delivery.d.ts.map +1 -0
- package/dist/services/actions/register-delivery.js +29 -0
- package/dist/services/actions/register-delivery.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 +29 -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 +37 -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 +191 -109
- package/dist/services/order-module-service.d.ts.map +1 -0
- package/dist/services/order-module-service.js +1165 -425
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/services/order-service.d.ts +6 -5
- package/dist/services/order-service.d.ts.map +1 -0
- package/dist/services/order-service.js +2 -2
- package/dist/services/order-service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/address.d.ts +2 -1
- package/dist/types/address.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/line-item-adjustment.d.ts +2 -1
- 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 +2 -1
- package/dist/types/line-item.d.ts.map +1 -0
- package/dist/types/order-change.d.ts +4 -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 +3 -2
- package/dist/types/order-detail.d.ts.map +1 -0
- package/dist/types/order.d.ts +4 -3
- package/dist/types/order.d.ts.map +1 -0
- package/dist/types/return-reason.d.ts +5 -0
- package/dist/types/return-reason.d.ts.map +1 -0
- package/dist/types/return-reason.js +3 -0
- package/dist/types/return-reason.js.map +1 -0
- package/dist/types/shipping-method-adjustment.d.ts +2 -1
- 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 +5 -1
- package/dist/types/shipping-method.d.ts.map +1 -0
- package/dist/types/tax-line.d.ts +2 -1
- package/dist/types/tax-line.d.ts.map +1 -0
- package/dist/types/transaction.d.ts +2 -1
- package/dist/types/transaction.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +41 -23
- 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 +9 -16
- package/dist/utils/actions/cancel-return.js.map +1 -1
- package/dist/utils/actions/deliver-item.d.ts +2 -0
- package/dist/utils/actions/deliver-item.d.ts.map +1 -0
- package/dist/utils/actions/deliver-item.js +38 -0
- package/dist/utils/actions/deliver-item.js.map +1 -0
- 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 +8 -12
- package/dist/utils/actions/fulfill-item.js.map +1 -1
- package/dist/utils/actions/index.d.ts +7 -1
- package/dist/utils/actions/index.d.ts.map +1 -0
- package/dist/utils/actions/index.js +6 -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 +17 -26
- 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 +10 -30
- package/dist/utils/actions/item-remove.js.map +1 -1
- package/dist/utils/actions/item-update.d.ts +2 -0
- package/dist/utils/actions/item-update.d.ts.map +1 -0
- package/dist/utils/actions/item-update.js +37 -0
- package/dist/utils/actions/item-update.js.map +1 -0
- 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 +11 -37
- 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 +9 -38
- 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 +10 -15
- 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 +8 -12
- 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 +18 -18
- 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 +22 -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 +8 -12
- 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 +98 -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 +154 -0
- package/dist/utils/base-repository-find.js.map +1 -0
- package/dist/utils/calculate-order-change.d.ts +12 -6
- package/dist/utils/calculate-order-change.d.ts.map +1 -0
- package/dist/utils/calculate-order-change.js +56 -187
- 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 +10 -0
- package/dist/utils/set-action-reference.js.map +1 -0
- package/dist/utils/transform-order.d.ts +5 -4
- package/dist/utils/transform-order.d.ts.map +1 -0
- package/dist/utils/transform-order.js +138 -21
- package/dist/utils/transform-order.js.map +1 -1
- package/package.json +25 -26
- 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
@@ -0,0 +1,371 @@
|
|
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 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 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 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 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 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 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 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 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 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 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 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 NULL;
|
134
|
+
|
135
|
+
DO $$
|
136
|
+
BEGIN
|
137
|
+
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'return_status_enum') THEN
|
138
|
+
CREATE TYPE return_status_enum AS ENUM (
|
139
|
+
'requested',
|
140
|
+
'received',
|
141
|
+
'partially_received',
|
142
|
+
'canceled');
|
143
|
+
END IF;
|
144
|
+
END$$;
|
145
|
+
|
146
|
+
CREATE TABLE IF NOT EXISTS "return" (
|
147
|
+
"id" TEXT NOT NULL,
|
148
|
+
"order_id" TEXT NOT NULL,
|
149
|
+
"claim_id" TEXT NULL,
|
150
|
+
"exchange_id" TEXT NULL,
|
151
|
+
"order_version" INTEGER NOT NULL,
|
152
|
+
"display_id" SERIAL,
|
153
|
+
"status" return_status_enum NOT NULL DEFAULT 'requested',
|
154
|
+
"no_notification" boolean NULL,
|
155
|
+
"refund_amount" NUMERIC NULL,
|
156
|
+
"raw_refund_amount" JSONB NULL,
|
157
|
+
"metadata" jsonb NULL,
|
158
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
159
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
160
|
+
"deleted_at" timestamptz NULL,
|
161
|
+
"received_at" timestamptz NULL,
|
162
|
+
"canceled_at" timestamptz NULL,
|
163
|
+
CONSTRAINT "return_pkey" PRIMARY KEY ("id")
|
164
|
+
);
|
165
|
+
|
166
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_order_id" ON "return" (
|
167
|
+
order_id
|
168
|
+
)
|
169
|
+
WHERE deleted_at IS NULL;
|
170
|
+
|
171
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_claim_id" ON "return" (
|
172
|
+
claim_id
|
173
|
+
)
|
174
|
+
WHERE claim_id IS NOT NULL AND deleted_at IS NULL;
|
175
|
+
|
176
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_exchange_id" ON "return" (
|
177
|
+
exchange_id
|
178
|
+
)
|
179
|
+
WHERE exchange_id IS NOT NULL AND deleted_at IS NULL;
|
180
|
+
|
181
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_display_id" ON "return" (
|
182
|
+
display_id
|
183
|
+
)
|
184
|
+
WHERE deleted_at IS NULL;
|
185
|
+
|
186
|
+
|
187
|
+
CREATE TABLE IF NOT EXISTS "return_item" (
|
188
|
+
"id" TEXT NOT NULL,
|
189
|
+
"return_id" TEXT NOT NULL,
|
190
|
+
"reason_id" TEXT NULL,
|
191
|
+
"item_id" TEXT NOT NULL,
|
192
|
+
"quantity" NUMERIC NOT NULL,
|
193
|
+
"raw_quantity" JSONB NOT NULL,
|
194
|
+
"received_quantity" NUMERIC NOT NULL DEFAULT 0,
|
195
|
+
"raw_received_quantity" JSONB NOT NULL,
|
196
|
+
"note" TEXT NULL,
|
197
|
+
"metadata" JSONB NULL,
|
198
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
199
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
200
|
+
"deleted_at" timestamptz NULL,
|
201
|
+
CONSTRAINT "return_item_pkey" PRIMARY KEY ("id")
|
202
|
+
);
|
203
|
+
|
204
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" ("deleted_at")
|
205
|
+
WHERE deleted_at IS NULL;
|
206
|
+
|
207
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_return_id" ON "return_item" ("return_id")
|
208
|
+
WHERE deleted_at IS NULL;
|
209
|
+
|
210
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_item_id" ON "return_item" ("item_id")
|
211
|
+
WHERE deleted_at IS NULL;
|
212
|
+
|
213
|
+
CREATE INDEX IF NOT EXISTS "IDX_return_item_reason_id" ON "return_item" ("reason_id")
|
214
|
+
WHERE deleted_at IS NULL;
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
CREATE TABLE IF NOT EXISTS "order_exchange" (
|
219
|
+
"id" TEXT NOT NULL,
|
220
|
+
"order_id" TEXT NOT NULL,
|
221
|
+
"return_id" TEXT NULL,
|
222
|
+
"order_version" INTEGER NOT NULL,
|
223
|
+
"display_id" SERIAL,
|
224
|
+
"no_notification" BOOLEAN NULL,
|
225
|
+
"allow_backorder" BOOLEAN NOT NULL DEFAULT FALSE,
|
226
|
+
"difference_due" NUMERIC NULL,
|
227
|
+
"raw_difference_due" JSONB NULL,
|
228
|
+
"metadata" JSONB NULL,
|
229
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
230
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
231
|
+
"deleted_at" timestamptz NULL,
|
232
|
+
"canceled_at" timestamptz NULL,
|
233
|
+
CONSTRAINT "order_exchange_pkey" PRIMARY KEY ("id")
|
234
|
+
);
|
235
|
+
|
236
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_display_id" ON "order_exchange" ("display_id")
|
237
|
+
WHERE deleted_at IS NULL;
|
238
|
+
|
239
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_deleted_at" ON "order_exchange" ("deleted_at")
|
240
|
+
WHERE deleted_at IS NULL;
|
241
|
+
|
242
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_order_id" ON "order_exchange" ("order_id")
|
243
|
+
WHERE deleted_at IS NULL;
|
244
|
+
|
245
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_return_id" ON "order_exchange" ("return_id")
|
246
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NULL;
|
247
|
+
|
248
|
+
|
249
|
+
CREATE TABLE IF NOT EXISTS "order_exchange_item" (
|
250
|
+
"id" TEXT NOT NULL,
|
251
|
+
"exchange_id" TEXT NOT NULL,
|
252
|
+
"item_id" TEXT NOT NULL,
|
253
|
+
"quantity" NUMERIC NOT NULL,
|
254
|
+
"raw_quantity" JSONB NOT NULL,
|
255
|
+
"note" TEXT NULL,
|
256
|
+
"metadata" JSONB NULL,
|
257
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
258
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
259
|
+
"deleted_at" timestamptz NULL,
|
260
|
+
CONSTRAINT "order_exchange_item_pkey" PRIMARY KEY ("id")
|
261
|
+
);
|
262
|
+
|
263
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_deleted_at" ON "order_exchange_item" ("deleted_at")
|
264
|
+
WHERE deleted_at IS NULL;
|
265
|
+
|
266
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_exchange_id" ON "order_exchange_item" ("exchange_id")
|
267
|
+
WHERE deleted_at IS NULL;
|
268
|
+
|
269
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_exchange_item_item_id" ON "order_exchange_item" ("item_id")
|
270
|
+
WHERE deleted_at IS NULL;
|
271
|
+
|
272
|
+
DO $$
|
273
|
+
BEGIN
|
274
|
+
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'order_claim_type_enum') THEN
|
275
|
+
CREATE TYPE order_claim_type_enum AS ENUM (
|
276
|
+
'refund',
|
277
|
+
'replace'
|
278
|
+
);
|
279
|
+
END IF;
|
280
|
+
END$$;
|
281
|
+
|
282
|
+
CREATE TABLE IF NOT EXISTS "order_claim" (
|
283
|
+
"id" TEXT NOT NULL,
|
284
|
+
"order_id" TEXT NOT NULL,
|
285
|
+
"return_id" TEXT NULL,
|
286
|
+
"order_version" INTEGER NOT NULL,
|
287
|
+
"display_id" SERIAL,
|
288
|
+
"type" order_claim_type_enum NOT NULL,
|
289
|
+
"no_notification" BOOLEAN NULL,
|
290
|
+
"refund_amount" NUMERIC NULL,
|
291
|
+
"raw_refund_amount" JSONB NULL,
|
292
|
+
"metadata" JSONB NULL,
|
293
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
294
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
295
|
+
"deleted_at" timestamptz NULL,
|
296
|
+
"canceled_at" timestamptz NULL,
|
297
|
+
CONSTRAINT "order_claim_pkey" PRIMARY KEY ("id")
|
298
|
+
);
|
299
|
+
|
300
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_display_id" ON "order_claim" ("display_id")
|
301
|
+
WHERE deleted_at IS NULL;
|
302
|
+
|
303
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_deleted_at" ON "order_claim" ("deleted_at")
|
304
|
+
WHERE deleted_at IS NULL;
|
305
|
+
|
306
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_order_id" ON "order_claim" ("order_id")
|
307
|
+
WHERE deleted_at IS NULL;
|
308
|
+
|
309
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_return_id" ON "order_claim" ("return_id")
|
310
|
+
WHERE return_id IS NOT NULL AND deleted_at IS NULL;
|
311
|
+
|
312
|
+
DO $$
|
313
|
+
BEGIN
|
314
|
+
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'claim_reason_enum') THEN
|
315
|
+
CREATE TYPE claim_reason_enum AS ENUM (
|
316
|
+
'missing_item',
|
317
|
+
'wrong_item',
|
318
|
+
'production_failure',
|
319
|
+
'other'
|
320
|
+
);
|
321
|
+
END IF;
|
322
|
+
END$$;
|
323
|
+
|
324
|
+
CREATE TABLE IF NOT EXISTS "order_claim_item" (
|
325
|
+
"id" TEXT NOT NULL,
|
326
|
+
"claim_id" TEXT NOT NULL,
|
327
|
+
"item_id" TEXT NOT NULL,
|
328
|
+
"is_additional_item" BOOLEAN NOT NULL DEFAULT FALSE,
|
329
|
+
"reason" claim_reason_enum NULL,
|
330
|
+
"quantity" NUMERIC NOT NULL,
|
331
|
+
"raw_quantity" JSONB NOT NULL,
|
332
|
+
"note" TEXT NULL,
|
333
|
+
"metadata" JSONB NULL,
|
334
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
335
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
336
|
+
"deleted_at" timestamptz NULL,
|
337
|
+
CONSTRAINT "order_claim_item_pkey" PRIMARY KEY ("id")
|
338
|
+
);
|
339
|
+
|
340
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" ("deleted_at")
|
341
|
+
WHERE deleted_at IS NULL;
|
342
|
+
|
343
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_claim_id" ON "order_claim_item" ("claim_id")
|
344
|
+
WHERE deleted_at IS NULL;
|
345
|
+
|
346
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_item_id" ON "order_claim_item" ("item_id")
|
347
|
+
WHERE deleted_at IS NULL;
|
348
|
+
|
349
|
+
|
350
|
+
CREATE TABLE IF NOT EXISTS "order_claim_item_image" (
|
351
|
+
"id" TEXT NOT NULL,
|
352
|
+
"claim_item_id" TEXT NOT NULL,
|
353
|
+
"url" TEXT NOT NULL,
|
354
|
+
"metadata" JSONB NULL,
|
355
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
356
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
357
|
+
"deleted_at" timestamptz NULL,
|
358
|
+
CONSTRAINT "order_claim_item_image_pkey" PRIMARY KEY ("id")
|
359
|
+
);
|
360
|
+
|
361
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_claim_item_id" ON "order_claim_item_image" ("claim_item_id")
|
362
|
+
WHERE "deleted_at" IS NOT NULL;
|
363
|
+
|
364
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_image_deleted_at" ON "order_claim_item_image" ("deleted_at")
|
365
|
+
WHERE "deleted_at" IS NOT NULL;
|
366
|
+
`;
|
367
|
+
this.addSql(sql);
|
368
|
+
}
|
369
|
+
}
|
370
|
+
exports.Migration20240604100512 = Migration20240604100512;
|
371
|
+
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuWX,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AA5WD,0DA4WC"}
|
@@ -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"}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240716081800 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240716081800 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
const sql = `
|
8
|
+
DROP INDEX IF EXISTS "IDX_order_line_item_variant_id";
|
9
|
+
DROP INDEX IF EXISTS "IDX_order_line_item_product_id";
|
10
|
+
|
11
|
+
ALTER TABLE "order_line_item"
|
12
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
13
|
+
|
14
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_line_item_variant_id" ON "order_line_item" (
|
15
|
+
variant_id
|
16
|
+
) WHERE deleted_at IS NULL;
|
17
|
+
|
18
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_line_item_product_id" ON "order_line_item" (
|
19
|
+
product_id
|
20
|
+
) WHERE deleted_at IS NULL;
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
DROP INDEX IF EXISTS "IDX_order_shipping_method_tax_line_shipping_method_id";
|
25
|
+
|
26
|
+
ALTER TABLE "order_shipping_method_tax_line"
|
27
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
28
|
+
|
29
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_method_tax_line_shipping_method_id" ON "order_shipping_method_tax_line" (
|
30
|
+
shipping_method_id
|
31
|
+
) WHERE deleted_at IS NULL;
|
32
|
+
|
33
|
+
|
34
|
+
DROP INDEX IF EXISTS "IDX_order_shipping_method_adjustment_shipping_method_id";
|
35
|
+
|
36
|
+
ALTER TABLE "order_shipping_method_adjustment"
|
37
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
38
|
+
|
39
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_shipping_method_adjustment_shipping_method_id" ON "order_shipping_method_adjustment" (
|
40
|
+
shipping_method_id
|
41
|
+
) WHERE deleted_at IS NULL;
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
DROP INDEX IF EXISTS "IDX_order_line_item_tax_line_item_id";
|
46
|
+
|
47
|
+
ALTER TABLE "order_line_item_tax_line"
|
48
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
49
|
+
|
50
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_line_item_tax_line_item_id" ON "order_line_item_tax_line" (
|
51
|
+
item_id
|
52
|
+
) WHERE deleted_at IS NULL;
|
53
|
+
|
54
|
+
DROP INDEX IF EXISTS "IDX_order_line_item_adjustment_item_id";
|
55
|
+
|
56
|
+
ALTER TABLE "order_line_item_adjustment"
|
57
|
+
ADD COLUMN if NOT exists "deleted_at" timestamptz NULL;
|
58
|
+
|
59
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_line_item_adjustment_item_id" ON "order_line_item_adjustment" (
|
60
|
+
item_id
|
61
|
+
) WHERE deleted_at IS NULL;
|
62
|
+
`;
|
63
|
+
this.addSql(sql);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
exports.Migration20240716081800 = Migration20240716081800;
|
67
|
+
//# sourceMappingURL=Migration20240716081800.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240716081800.js","sourceRoot":"","sources":["../../src/migrations/Migration20240716081800.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuDX,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,CAAC;CACF;AA7DD,0DA6DC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240801085921.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240801085921.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAsB1B"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240801085921 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240801085921 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
this.addSql(`
|
8
|
+
ALTER TABLE "return"
|
9
|
+
ADD COLUMN IF NOT exists "requested_at" timestamptz NULL;
|
10
|
+
|
11
|
+
|
12
|
+
ALTER TABLE "return" ALTER COLUMN "status" DROP DEFAULT;
|
13
|
+
ALTER TABLE "return" ALTER COLUMN "status" TYPE text USING "status"::text;
|
14
|
+
DROP TYPE return_status_enum;
|
15
|
+
|
16
|
+
CREATE TYPE return_status_enum AS ENUM (
|
17
|
+
'open',
|
18
|
+
'requested',
|
19
|
+
'received',
|
20
|
+
'partially_received',
|
21
|
+
'canceled'
|
22
|
+
);
|
23
|
+
|
24
|
+
ALTER TABLE "return" ALTER COLUMN "status" TYPE return_status_enum USING "status"::text::return_status_enum;
|
25
|
+
ALTER TABLE "return" ALTER COLUMN "status" SET DEFAULT 'open';
|
26
|
+
`);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
exports.Migration20240801085921 = Migration20240801085921;
|
30
|
+
//# sourceMappingURL=Migration20240801085921.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240801085921.js","sourceRoot":"","sources":["../../src/migrations/Migration20240801085921.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;OAmBT,CAAC,CAAA;IACN,CAAC;CACF;AAvBD,0DAuBC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240821164505.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240821164505.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAS5B"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240821164505 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240821164505 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_item_deleted_at" ON "order_item" (deleted_at) WHERE deleted_at IS NOT NULL;');
|
8
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_summary_deleted_at" ON "order_summary" (deleted_at) WHERE deleted_at IS NOT NULL;');
|
9
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" (deleted_at) WHERE deleted_at IS NOT NULL;');
|
10
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" (deleted_at) WHERE deleted_at IS NOT NULL;');
|
11
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_shipping_deleted_at" ON "order_shipping" (deleted_at) WHERE deleted_at IS NOT NULL;');
|
12
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_transaction_exchange_id" ON "order_transaction" (exchange_id) WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;');
|
13
|
+
this.addSql('CREATE INDEX IF NOT EXISTS "IDX_order_transaction_claim_id" ON "order_transaction" (claim_id) WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;');
|
14
|
+
}
|
15
|
+
async down() {
|
16
|
+
this.addSql('drop index if exists "IDX_order_item_deleted_at";');
|
17
|
+
this.addSql('drop index if exists "IDX_order_summary_deleted_at";');
|
18
|
+
this.addSql('drop index if exists "IDX_order_claim_item_deleted_at";');
|
19
|
+
this.addSql('drop index if exists "IDX_return_item_deleted_at";');
|
20
|
+
this.addSql('drop index if exists "IDX_order_shipping_deleted_at";');
|
21
|
+
this.addSql('drop index if exists "IDX_order_transaction_exchange_id";');
|
22
|
+
this.addSql('drop index if exists "IDX_order_transaction_claim_id";');
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.Migration20240821164505 = Migration20240821164505;
|
26
|
+
//# sourceMappingURL=Migration20240821164505.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240821164505.js","sourceRoot":"","sources":["../../src/migrations/Migration20240821164505.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT,mHAAmH,CACpH,CAAA;QAED,IAAI,CAAC,MAAM,CACT,yHAAyH,CAC1H,CAAA;QAED,IAAI,CAAC,MAAM,CACT,+HAA+H,CAChI,CAAA;QAED,IAAI,CAAC,MAAM,CACT,qHAAqH,CACtH,CAAA;QAED,IAAI,CAAC,MAAM,CACT,2HAA2H,CAC5H,CAAA;QAED,IAAI,CAAC,MAAM,CACT,+JAA+J,CAChK,CAAA;QAED,IAAI,CAAC,MAAM,CACT,sJAAsJ,CACvJ,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC,mDAAmD,CAAC,CAAA;QAChE,IAAI,CAAC,MAAM,CAAC,sDAAsD,CAAC,CAAA;QACnE,IAAI,CAAC,MAAM,CAAC,yDAAyD,CAAC,CAAA;QACtE,IAAI,CAAC,MAAM,CAAC,oDAAoD,CAAC,CAAA;QACjE,IAAI,CAAC,MAAM,CAAC,uDAAuD,CAAC,CAAA;QACpE,IAAI,CAAC,MAAM,CAAC,2DAA2D,CAAC,CAAA;QACxE,IAAI,CAAC,MAAM,CAAC,wDAAwD,CAAC,CAAA;IACvE,CAAC;CACF;AAxCD,0DAwCC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240821170920.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240821170920.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAcnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAa5B"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migration20240821170920 = void 0;
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
5
|
+
class Migration20240821170920 extends migrations_1.Migration {
|
6
|
+
async up() {
|
7
|
+
this.addSql('alter table if exists "return" add column if not exists "created_by" text null;');
|
8
|
+
this.addSql('alter table if exists "order_exchange" add column if not exists "created_by" text null;');
|
9
|
+
this.addSql('alter table if exists "order_claim" add column if not exists "created_by" text null;');
|
10
|
+
}
|
11
|
+
async down() {
|
12
|
+
this.addSql('alter table if exists "return" drop column if exists "created_by";');
|
13
|
+
this.addSql('alter table if exists "order_exchange" drop column if exists "created_by";');
|
14
|
+
this.addSql('alter table if exists "order_claim" drop column if exists "created_by";');
|
15
|
+
}
|
16
|
+
}
|
17
|
+
exports.Migration20240821170920 = Migration20240821170920;
|
18
|
+
//# sourceMappingURL=Migration20240821170920.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240821170920.js","sourceRoot":"","sources":["../../src/migrations/Migration20240821170920.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT,iFAAiF,CAClF,CAAA;QAED,IAAI,CAAC,MAAM,CACT,yFAAyF,CAC1F,CAAA;QAED,IAAI,CAAC,MAAM,CACT,sFAAsF,CACvF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CACT,oEAAoE,CACrE,CAAA;QAED,IAAI,CAAC,MAAM,CACT,4EAA4E,CAC7E,CAAA;QAED,IAAI,CAAC,MAAM,CACT,yEAAyE,CAC1E,CAAA;IACH,CAAC;CACF;AA5BD,0DA4BC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Migration20240827133639.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240827133639.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAcnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B"}
|