feat(core-flows,medusa,order): remove return shipping (#8137)
What: * `DELETE /admin/returs/:id/shipping_methods/:action_id` FIXES: CC-187
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { DAL } from "@medusajs/types"
|
||||
import {
|
||||
DALUtils,
|
||||
createPsqlIndexStatementHelper,
|
||||
generateEntityId,
|
||||
} from "@medusajs/utils"
|
||||
import {
|
||||
BeforeCreate,
|
||||
Entity,
|
||||
Filter,
|
||||
ManyToOne,
|
||||
OnInit,
|
||||
OptionalProps,
|
||||
@@ -30,6 +32,7 @@ const ClaimItemIdIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_claim_item_image" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
export default class ClaimItemImage {
|
||||
[OptionalProps]?: OptionalClaimItemImageProps
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { BigNumberRawValue, DAL } from "@medusajs/types"
|
||||
import {
|
||||
BigNumber,
|
||||
DALUtils,
|
||||
MikroOrmBigNumberProperty,
|
||||
createPsqlIndexStatementHelper,
|
||||
generateEntityId,
|
||||
@@ -8,6 +9,7 @@ import {
|
||||
import {
|
||||
BeforeCreate,
|
||||
Entity,
|
||||
Filter,
|
||||
ManyToOne,
|
||||
OnInit,
|
||||
OptionalProps,
|
||||
@@ -66,6 +68,7 @@ const ActionOrderingIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_change_action" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
export default class OrderChangeAction {
|
||||
[OptionalProps]?: OptionalLineItemProps
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { DAL } from "@medusajs/types"
|
||||
import {
|
||||
createPsqlIndexStatementHelper,
|
||||
DALUtils,
|
||||
generateEntityId,
|
||||
OrderChangeStatus,
|
||||
OrderChangeType,
|
||||
@@ -11,6 +12,7 @@ import {
|
||||
Collection,
|
||||
Entity,
|
||||
Enum,
|
||||
Filter,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
OnInit,
|
||||
@@ -77,6 +79,7 @@ const VersionIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_change" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
@VersionIndex.MikroORMIndex()
|
||||
export default class OrderChange {
|
||||
[OptionalProps]?: OptionalLineItemProps
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DAL } from "@medusajs/types"
|
||||
import {
|
||||
DALUtils,
|
||||
createPsqlIndexStatementHelper,
|
||||
generateEntityId,
|
||||
} from "@medusajs/utils"
|
||||
@@ -7,6 +8,7 @@ import {
|
||||
BeforeCreate,
|
||||
Cascade,
|
||||
Entity,
|
||||
Filter,
|
||||
ManyToOne,
|
||||
OnInit,
|
||||
OneToMany,
|
||||
@@ -37,6 +39,7 @@ const ParentIndex = createPsqlIndexStatementHelper({
|
||||
type OptionalOrderProps = "parent_return_reason" | DAL.ModelDateColumns
|
||||
|
||||
@Entity({ tableName: "return_reason" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
export default class ReturnReason {
|
||||
[OptionalProps]?: OptionalOrderProps
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { BigNumberRawValue } from "@medusajs/types"
|
||||
import {
|
||||
BigNumber,
|
||||
createPsqlIndexStatementHelper,
|
||||
DALUtils,
|
||||
generateEntityId,
|
||||
MikroOrmBigNumberProperty,
|
||||
} from "@medusajs/utils"
|
||||
@@ -10,6 +11,7 @@ import {
|
||||
Cascade,
|
||||
Collection,
|
||||
Entity,
|
||||
Filter,
|
||||
OneToMany,
|
||||
OnInit,
|
||||
PrimaryKey,
|
||||
@@ -19,12 +21,20 @@ import {
|
||||
import ShippingMethodAdjustment from "./shipping-method-adjustment"
|
||||
import ShippingMethodTaxLine from "./shipping-method-tax-line"
|
||||
|
||||
const DeletedAtIndex = createPsqlIndexStatementHelper({
|
||||
tableName: "order_shipping_method",
|
||||
columns: "deleted_at",
|
||||
where: "deleted_at IS NOT NULL",
|
||||
})
|
||||
|
||||
const ShippingOptionIdIndex = createPsqlIndexStatementHelper({
|
||||
tableName: "order_shipping_method",
|
||||
columns: "shipping_option_id",
|
||||
where: "deleted_at IS NOT NULL",
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_shipping_method" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
export default class ShippingMethod {
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
id: string
|
||||
@@ -61,7 +71,7 @@ export default class ShippingMethod {
|
||||
() => ShippingMethodTaxLine,
|
||||
(taxLine) => taxLine.shipping_method,
|
||||
{
|
||||
cascade: [Cascade.PERSIST],
|
||||
cascade: [Cascade.PERSIST, "soft-remove"] as any,
|
||||
}
|
||||
)
|
||||
tax_lines = new Collection<Rel<ShippingMethodTaxLine>>(this)
|
||||
@@ -70,7 +80,7 @@ export default class ShippingMethod {
|
||||
() => ShippingMethodAdjustment,
|
||||
(adjustment) => adjustment.shipping_method,
|
||||
{
|
||||
cascade: [Cascade.PERSIST],
|
||||
cascade: [Cascade.PERSIST, "soft-remove"] as any,
|
||||
}
|
||||
)
|
||||
adjustments = new Collection<Rel<ShippingMethodAdjustment>>(this)
|
||||
@@ -90,6 +100,10 @@ export default class ShippingMethod {
|
||||
})
|
||||
updated_at: Date
|
||||
|
||||
@Property({ columnType: "timestamptz", nullable: true })
|
||||
@DeletedAtIndex.MikroORMIndex()
|
||||
deleted_at: Date | null = null
|
||||
|
||||
@BeforeCreate()
|
||||
onCreate() {
|
||||
this.id = generateEntityId(this.id, "ordsm")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { BigNumberRawValue, DAL } from "@medusajs/types"
|
||||
import {
|
||||
BigNumber,
|
||||
DALUtils,
|
||||
MikroOrmBigNumberProperty,
|
||||
createPsqlIndexStatementHelper,
|
||||
generateEntityId,
|
||||
@@ -8,6 +9,7 @@ import {
|
||||
import {
|
||||
BeforeCreate,
|
||||
Entity,
|
||||
Filter,
|
||||
ManyToOne,
|
||||
OnInit,
|
||||
OptionalProps,
|
||||
@@ -71,6 +73,7 @@ const OrderIdVersionIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_transaction" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
@OrderIdVersionIndex.MikroORMIndex()
|
||||
export default class Transaction {
|
||||
[OptionalProps]?: OptionalLineItemProps
|
||||
|
||||
Reference in New Issue
Block a user