fix(orchestration): remote joiner alias conflict (#8844)
This commit is contained in:
committed by
GitHub
parent
68f3244de3
commit
6cfe9bd874
@@ -20,7 +20,7 @@ const CustomerIdIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_address" })
|
||||
export default class Address {
|
||||
export default class OrderAddress {
|
||||
[OptionalProps]: OptionalAddressProps
|
||||
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
} from "@mikro-orm/core"
|
||||
import Claim from "./claim"
|
||||
import OrderClaimItemImage from "./claim-item-image"
|
||||
import LineItem from "./line-item"
|
||||
import OrderLineItem from "./line-item"
|
||||
|
||||
type OptionalLineItemProps = DAL.ModelDateColumns
|
||||
|
||||
@@ -80,7 +80,7 @@ export default class OrderClaimItem {
|
||||
claim: Rel<Claim>
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => LineItem,
|
||||
entity: () => OrderLineItem,
|
||||
fieldName: "item_id",
|
||||
mapToPk: true,
|
||||
columnType: "text",
|
||||
@@ -88,10 +88,10 @@ export default class OrderClaimItem {
|
||||
@ItemIdIndex.MikroORMIndex()
|
||||
item_id: string
|
||||
|
||||
@ManyToOne(() => LineItem, {
|
||||
@ManyToOne(() => OrderLineItem, {
|
||||
persist: false,
|
||||
})
|
||||
item: Rel<LineItem>
|
||||
item: Rel<OrderLineItem>
|
||||
|
||||
@Property({ columnType: "boolean", default: false })
|
||||
is_additional_item: boolean = false
|
||||
|
||||
@@ -25,9 +25,9 @@ import {
|
||||
} from "@mikro-orm/core"
|
||||
import ClaimItem from "./claim-item"
|
||||
import Order from "./order"
|
||||
import OrderShippingMethod from "./order-shipping-method"
|
||||
import OrderShipping from "./order-shipping-method"
|
||||
import Return from "./return"
|
||||
import Transaction from "./transaction"
|
||||
import OrderTransaction from "./transaction"
|
||||
|
||||
type OptionalOrderClaimProps = DAL.ModelDateColumns
|
||||
|
||||
@@ -123,19 +123,15 @@ export default class OrderClaim {
|
||||
})
|
||||
claim_items = new Collection<Rel<ClaimItem>>(this)
|
||||
|
||||
@OneToMany(
|
||||
() => OrderShippingMethod,
|
||||
(shippingMethod) => shippingMethod.claim,
|
||||
{
|
||||
cascade: [Cascade.PERSIST],
|
||||
}
|
||||
)
|
||||
shipping_methods = new Collection<Rel<OrderShippingMethod>>(this)
|
||||
|
||||
@OneToMany(() => Transaction, (transaction) => transaction.claim, {
|
||||
@OneToMany(() => OrderShipping, (shippingMethod) => shippingMethod.claim, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<Transaction>(this)
|
||||
shipping_methods = new Collection<Rel<OrderShipping>>(this)
|
||||
|
||||
@OneToMany(() => OrderTransaction, (transaction) => transaction.claim, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<OrderTransaction>(this)
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
created_by: string | null = null
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
Property,
|
||||
} from "@mikro-orm/core"
|
||||
import Exchange from "./exchange"
|
||||
import LineItem from "./line-item"
|
||||
import OrderLineItem from "./line-item"
|
||||
|
||||
type OptionalLineItemProps = DAL.ModelDateColumns
|
||||
|
||||
@@ -64,7 +64,7 @@ export default class OrderExchangeItem {
|
||||
exchange: Exchange
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => LineItem,
|
||||
entity: () => OrderLineItem,
|
||||
fieldName: "item_id",
|
||||
mapToPk: true,
|
||||
columnType: "text",
|
||||
@@ -72,10 +72,10 @@ export default class OrderExchangeItem {
|
||||
@ItemIdIndex.MikroORMIndex()
|
||||
item_id: string
|
||||
|
||||
@ManyToOne(() => LineItem, {
|
||||
@ManyToOne(() => OrderLineItem, {
|
||||
persist: false,
|
||||
})
|
||||
item: LineItem
|
||||
item: OrderLineItem
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
note: string
|
||||
|
||||
@@ -21,9 +21,9 @@ import {
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import { OrderExchangeItem, Transaction } from "@models"
|
||||
import { OrderExchangeItem, OrderTransaction } from "@models"
|
||||
import Order from "./order"
|
||||
import OrderShippingMethod from "./order-shipping-method"
|
||||
import OrderShipping from "./order-shipping-method"
|
||||
import Return from "./return"
|
||||
|
||||
type OptionalOrderExchangeProps = DAL.ModelDateColumns
|
||||
@@ -115,19 +115,15 @@ export default class OrderExchange {
|
||||
})
|
||||
additional_items = new Collection<Rel<OrderExchangeItem>>(this)
|
||||
|
||||
@OneToMany(
|
||||
() => OrderShippingMethod,
|
||||
(shippingMethod) => shippingMethod.exchange,
|
||||
{
|
||||
cascade: [Cascade.PERSIST],
|
||||
}
|
||||
)
|
||||
shipping_methods = new Collection<Rel<OrderShippingMethod>>(this)
|
||||
|
||||
@OneToMany(() => Transaction, (transaction) => transaction.exchange, {
|
||||
@OneToMany(() => OrderShipping, (shippingMethod) => shippingMethod.exchange, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<Transaction>(this)
|
||||
shipping_methods = new Collection<Rel<OrderShipping>>(this)
|
||||
|
||||
@OneToMany(() => OrderTransaction, (transaction) => transaction.exchange, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<OrderTransaction>(this)
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
created_by: string | null = null
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
export { default as Address } from "./address"
|
||||
export { default as OrderAddress } from "./address"
|
||||
export { default as OrderClaim } from "./claim"
|
||||
export { default as OrderClaimItem } from "./claim-item"
|
||||
export { default as OrderClaimItemImage } from "./claim-item-image"
|
||||
export { default as OrderExchange } from "./exchange"
|
||||
export { default as OrderExchangeItem } from "./exchange-item"
|
||||
export { default as LineItem } from "./line-item"
|
||||
export { default as LineItemAdjustment } from "./line-item-adjustment"
|
||||
export { default as LineItemTaxLine } from "./line-item-tax-line"
|
||||
export { default as OrderLineItem } from "./line-item"
|
||||
export { default as OrderLineItemAdjustment } from "./line-item-adjustment"
|
||||
export { default as OrderLineItemTaxLine } from "./line-item-tax-line"
|
||||
export { default as Order } from "./order"
|
||||
export { default as OrderChange } from "./order-change"
|
||||
export { default as OrderChangeAction } from "./order-change-action"
|
||||
export { default as OrderItem } from "./order-item"
|
||||
export { default as OrderShippingMethod } from "./order-shipping-method"
|
||||
export { default as OrderShipping } from "./order-shipping-method"
|
||||
export { default as OrderSummary } from "./order-summary"
|
||||
export { default as Return } from "./return"
|
||||
export { default as ReturnItem } from "./return-item"
|
||||
export { default as ReturnReason } from "./return-reason"
|
||||
export { default as ShippingMethod } from "./shipping-method"
|
||||
export { default as ShippingMethodAdjustment } from "./shipping-method-adjustment"
|
||||
export { default as ShippingMethodTaxLine } from "./shipping-method-tax-line"
|
||||
export { default as Transaction } from "./transaction"
|
||||
export { default as OrderShippingMethod } from "./shipping-method"
|
||||
export { default as OrderShippingMethodAdjustment } from "./shipping-method-adjustment"
|
||||
export { default as OrderShippingMethodTaxLine } from "./shipping-method-tax-line"
|
||||
export { default as OrderTransaction } from "./transaction"
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
} from "@medusajs/utils"
|
||||
import { BeforeCreate, Entity, ManyToOne, OnInit, Rel } from "@mikro-orm/core"
|
||||
import AdjustmentLine from "./adjustment-line"
|
||||
import LineItem from "./line-item"
|
||||
import OrderLineItem from "./line-item"
|
||||
|
||||
const ItemIdIndex = createPsqlIndexStatementHelper({
|
||||
tableName: "order_line_item_adjustment",
|
||||
@@ -12,14 +12,14 @@ const ItemIdIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_line_item_adjustment" })
|
||||
export default class LineItemAdjustment extends AdjustmentLine {
|
||||
@ManyToOne(() => LineItem, {
|
||||
export default class OrderLineItemAdjustment extends AdjustmentLine {
|
||||
@ManyToOne(() => OrderLineItem, {
|
||||
persist: false,
|
||||
})
|
||||
item: Rel<LineItem>
|
||||
item: Rel<OrderLineItem>
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => LineItem,
|
||||
entity: () => OrderLineItem,
|
||||
columnType: "text",
|
||||
fieldName: "item_id",
|
||||
onDelete: "cascade",
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
OnInit,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import LineItem from "./line-item"
|
||||
import OrderLineItem from "./line-item"
|
||||
import TaxLine from "./tax-line"
|
||||
|
||||
const ItemIdIndex = createPsqlIndexStatementHelper({
|
||||
@@ -19,15 +19,15 @@ const ItemIdIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_line_item_tax_line" })
|
||||
export default class LineItemTaxLine extends TaxLine {
|
||||
@ManyToOne(() => LineItem, {
|
||||
export default class OrderLineItemTaxLine extends TaxLine {
|
||||
@ManyToOne(() => OrderLineItem, {
|
||||
fieldName: "item_id",
|
||||
persist: false,
|
||||
})
|
||||
item: Rel<LineItem>
|
||||
item: Rel<OrderLineItem>
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => LineItem,
|
||||
entity: () => OrderLineItem,
|
||||
columnType: "text",
|
||||
fieldName: "item_id",
|
||||
cascade: [Cascade.PERSIST, Cascade.REMOVE],
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import LineItemAdjustment from "./line-item-adjustment"
|
||||
import LineItemTaxLine from "./line-item-tax-line"
|
||||
import OrderLineItemAdjustment from "./line-item-adjustment"
|
||||
import OrderLineItemTaxLine from "./line-item-tax-line"
|
||||
|
||||
type OptionalLineItemProps = DAL.ModelDateColumns
|
||||
|
||||
@@ -44,7 +44,7 @@ const VariantIdIndex = createPsqlIndexStatementHelper({
|
||||
|
||||
@Entity({ tableName: "order_line_item" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
export default class LineItem {
|
||||
export default class OrderLineItem {
|
||||
[OptionalProps]?: OptionalLineItemProps
|
||||
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
@@ -128,15 +128,15 @@ export default class LineItem {
|
||||
@Property({ columnType: "jsonb" })
|
||||
raw_unit_price: BigNumberRawValue
|
||||
|
||||
@OneToMany(() => LineItemTaxLine, (taxLine) => taxLine.item, {
|
||||
@OneToMany(() => OrderLineItemTaxLine, (taxLine) => taxLine.item, {
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
tax_lines = new Collection<Rel<LineItemTaxLine>>(this)
|
||||
tax_lines = new Collection<Rel<OrderLineItemTaxLine>>(this)
|
||||
|
||||
@OneToMany(() => LineItemAdjustment, (adjustment) => adjustment.item, {
|
||||
@OneToMany(() => OrderLineItemAdjustment, (adjustment) => adjustment.item, {
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
adjustments = new Collection<Rel<LineItemAdjustment>>(this)
|
||||
adjustments = new Collection<Rel<OrderLineItemAdjustment>>(this)
|
||||
|
||||
@Property({ columnType: "jsonb", nullable: true })
|
||||
metadata: Record<string, unknown> | null = null
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import LineItem from "./line-item"
|
||||
import OrderLineItem from "./line-item"
|
||||
import Order from "./order"
|
||||
|
||||
type OptionalLineItemProps = DAL.ModelDateColumns
|
||||
@@ -71,7 +71,7 @@ export default class OrderItem {
|
||||
version: number
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => LineItem,
|
||||
entity: () => OrderLineItem,
|
||||
fieldName: "item_id",
|
||||
mapToPk: true,
|
||||
columnType: "text",
|
||||
@@ -79,10 +79,10 @@ export default class OrderItem {
|
||||
@ItemIdIndex.MikroORMIndex()
|
||||
item_id: string
|
||||
|
||||
@ManyToOne(() => LineItem, {
|
||||
@ManyToOne(() => OrderLineItem, {
|
||||
persist: false,
|
||||
})
|
||||
item: Rel<LineItem>
|
||||
item: Rel<OrderLineItem>
|
||||
|
||||
@MikroOrmBigNumberProperty()
|
||||
quantity: BigNumber | number
|
||||
|
||||
@@ -17,7 +17,7 @@ import Claim from "./claim"
|
||||
import Exchange from "./exchange"
|
||||
import Order from "./order"
|
||||
import Return from "./return"
|
||||
import ShippingMethod from "./shipping-method"
|
||||
import OrderShippingMethod from "./shipping-method"
|
||||
|
||||
type OptionalShippingMethodProps = DAL.ModelDateColumns
|
||||
|
||||
@@ -65,7 +65,7 @@ const DeletedAtIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName })
|
||||
export default class OrderShippingMethod {
|
||||
export default class OrderShipping {
|
||||
[OptionalProps]?: OptionalShippingMethodProps
|
||||
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
@@ -138,7 +138,7 @@ export default class OrderShippingMethod {
|
||||
version: number
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => ShippingMethod,
|
||||
entity: () => OrderShippingMethod,
|
||||
fieldName: "shipping_method_id",
|
||||
mapToPk: true,
|
||||
columnType: "text",
|
||||
@@ -146,10 +146,10 @@ export default class OrderShippingMethod {
|
||||
@ItemIdIndex.MikroORMIndex()
|
||||
shipping_method_id: string
|
||||
|
||||
@ManyToOne(() => ShippingMethod, {
|
||||
@ManyToOne(() => OrderShippingMethod, {
|
||||
persist: false,
|
||||
})
|
||||
shipping_method: Rel<ShippingMethod>
|
||||
shipping_method: Rel<OrderShippingMethod>
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
@@ -18,11 +18,11 @@ import {
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Address from "./address"
|
||||
import OrderAddress from "./address"
|
||||
import OrderItem from "./order-item"
|
||||
import OrderShippingMethod from "./order-shipping-method"
|
||||
import OrderShipping from "./order-shipping-method"
|
||||
import OrderSummary from "./order-summary"
|
||||
import Transaction from "./transaction"
|
||||
import OrderTransaction from "./transaction"
|
||||
|
||||
type OptionalOrderProps =
|
||||
| "shipping_address"
|
||||
@@ -142,24 +142,24 @@ export default class Order {
|
||||
shipping_address_id?: string | null
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => Address,
|
||||
entity: () => OrderAddress,
|
||||
fieldName: "shipping_address_id",
|
||||
nullable: true,
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
shipping_address?: Rel<Address> | null
|
||||
shipping_address?: Rel<OrderAddress> | null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@BillingAddressIdIndex.MikroORMIndex()
|
||||
billing_address_id?: string | null
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => Address,
|
||||
entity: () => OrderAddress,
|
||||
fieldName: "billing_address_id",
|
||||
nullable: true,
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
billing_address?: Rel<Address> | null
|
||||
billing_address?: Rel<OrderAddress> | null
|
||||
|
||||
@Property({ columnType: "boolean", nullable: true })
|
||||
no_notification: boolean | null = null
|
||||
@@ -177,19 +177,15 @@ export default class Order {
|
||||
})
|
||||
items = new Collection<Rel<OrderItem>>(this)
|
||||
|
||||
@OneToMany(
|
||||
() => OrderShippingMethod,
|
||||
(shippingMethod) => shippingMethod.order,
|
||||
{
|
||||
cascade: [Cascade.PERSIST],
|
||||
}
|
||||
)
|
||||
shipping_methods = new Collection<Rel<OrderShippingMethod>>(this)
|
||||
|
||||
@OneToMany(() => Transaction, (transaction) => transaction.order, {
|
||||
@OneToMany(() => OrderShipping, (shippingMethod) => shippingMethod.order, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<Rel<Transaction>>(this)
|
||||
shipping_methods = new Collection<Rel<OrderShipping>>(this)
|
||||
|
||||
@OneToMany(() => OrderTransaction, (transaction) => transaction.order, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<Rel<OrderTransaction>>(this)
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
PrimaryKey,
|
||||
Property,
|
||||
} from "@mikro-orm/core"
|
||||
import LineItem from "./line-item"
|
||||
import OrderLineItem from "./line-item"
|
||||
import Return from "./return"
|
||||
import ReturnReason from "./return-reason"
|
||||
|
||||
@@ -98,7 +98,7 @@ export default class ReturnItem {
|
||||
return: Return
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => LineItem,
|
||||
entity: () => OrderLineItem,
|
||||
fieldName: "item_id",
|
||||
mapToPk: true,
|
||||
columnType: "text",
|
||||
@@ -106,10 +106,10 @@ export default class ReturnItem {
|
||||
@ItemIdIndex.MikroORMIndex()
|
||||
item_id: string
|
||||
|
||||
@ManyToOne(() => LineItem, {
|
||||
@ManyToOne(() => OrderLineItem, {
|
||||
persist: false,
|
||||
})
|
||||
item: LineItem
|
||||
item: OrderLineItem
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
note: string
|
||||
|
||||
@@ -23,11 +23,11 @@ import {
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import { ReturnItem, Transaction } from "@models"
|
||||
import { OrderTransaction, ReturnItem } from "@models"
|
||||
import Claim from "./claim"
|
||||
import Exchange from "./exchange"
|
||||
import Order from "./order"
|
||||
import OrderShippingMethod from "./order-shipping-method"
|
||||
import OrderShipping from "./order-shipping-method"
|
||||
|
||||
type OptionalReturnProps = DAL.ModelDateColumns
|
||||
|
||||
@@ -136,19 +136,15 @@ export default class Return {
|
||||
})
|
||||
items = new Collection<Rel<ReturnItem>>(this)
|
||||
|
||||
@OneToMany(
|
||||
() => OrderShippingMethod,
|
||||
(shippingMethod) => shippingMethod.return,
|
||||
{
|
||||
cascade: [Cascade.PERSIST],
|
||||
}
|
||||
)
|
||||
shipping_methods = new Collection<OrderShippingMethod>(this)
|
||||
|
||||
@OneToMany(() => Transaction, (transaction) => transaction.return, {
|
||||
@OneToMany(() => OrderShipping, (shippingMethod) => shippingMethod.return, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<Transaction>(this)
|
||||
shipping_methods = new Collection<OrderShipping>(this)
|
||||
|
||||
@OneToMany(() => OrderTransaction, (transaction) => transaction.return, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
transactions = new Collection<OrderTransaction>(this)
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
created_by: string | null = null
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
} from "@medusajs/utils"
|
||||
import { BeforeCreate, Entity, ManyToOne, OnInit, Rel } from "@mikro-orm/core"
|
||||
import AdjustmentLine from "./adjustment-line"
|
||||
import ShippingMethod from "./shipping-method"
|
||||
import OrderShippingMethod from "./shipping-method"
|
||||
|
||||
const ShippingMethodIdIdIndex = createPsqlIndexStatementHelper({
|
||||
tableName: "order_shipping_method_adjustment",
|
||||
@@ -12,14 +12,14 @@ const ShippingMethodIdIdIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_shipping_method_adjustment" })
|
||||
export default class ShippingMethodAdjustment extends AdjustmentLine {
|
||||
@ManyToOne(() => ShippingMethod, {
|
||||
export default class OrderShippingMethodAdjustment extends AdjustmentLine {
|
||||
@ManyToOne(() => OrderShippingMethod, {
|
||||
persist: false,
|
||||
})
|
||||
shipping_method: Rel<ShippingMethod>
|
||||
shipping_method: Rel<OrderShippingMethod>
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => ShippingMethod,
|
||||
entity: () => OrderShippingMethod,
|
||||
columnType: "text",
|
||||
fieldName: "shipping_method_id",
|
||||
mapToPk: true,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
generateEntityId,
|
||||
} from "@medusajs/utils"
|
||||
import { BeforeCreate, Entity, ManyToOne, OnInit, Rel } from "@mikro-orm/core"
|
||||
import ShippingMethod from "./shipping-method"
|
||||
import OrderShippingMethod from "./shipping-method"
|
||||
import TaxLine from "./tax-line"
|
||||
|
||||
const ShippingMethodIdIdIndex = createPsqlIndexStatementHelper({
|
||||
@@ -12,14 +12,14 @@ const ShippingMethodIdIdIndex = createPsqlIndexStatementHelper({
|
||||
})
|
||||
|
||||
@Entity({ tableName: "order_shipping_method_tax_line" })
|
||||
export default class ShippingMethodTaxLine extends TaxLine {
|
||||
@ManyToOne(() => ShippingMethod, {
|
||||
export default class OrderShippingMethodTaxLine extends TaxLine {
|
||||
@ManyToOne(() => OrderShippingMethod, {
|
||||
persist: false,
|
||||
})
|
||||
shipping_method: Rel<ShippingMethod>
|
||||
shipping_method: Rel<OrderShippingMethod>
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => ShippingMethod,
|
||||
entity: () => OrderShippingMethod,
|
||||
fieldName: "shipping_method_id",
|
||||
columnType: "text",
|
||||
mapToPk: true,
|
||||
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import ShippingMethodAdjustment from "./shipping-method-adjustment"
|
||||
import ShippingMethodTaxLine from "./shipping-method-tax-line"
|
||||
import OrderShippingMethodAdjustment from "./shipping-method-adjustment"
|
||||
import OrderShippingMethodTaxLine from "./shipping-method-tax-line"
|
||||
|
||||
const DeletedAtIndex = createPsqlIndexStatementHelper({
|
||||
tableName: "order_shipping_method",
|
||||
@@ -35,7 +35,7 @@ const ShippingOptionIdIndex = createPsqlIndexStatementHelper({
|
||||
|
||||
@Entity({ tableName: "order_shipping_method" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
export default class ShippingMethod {
|
||||
export default class OrderShippingMethod {
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
id: string
|
||||
|
||||
@@ -68,22 +68,22 @@ export default class ShippingMethod {
|
||||
metadata: Record<string, unknown> | null = null
|
||||
|
||||
@OneToMany(
|
||||
() => ShippingMethodTaxLine,
|
||||
() => OrderShippingMethodTaxLine,
|
||||
(taxLine) => taxLine.shipping_method,
|
||||
{
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
}
|
||||
)
|
||||
tax_lines = new Collection<Rel<ShippingMethodTaxLine>>(this)
|
||||
tax_lines = new Collection<Rel<OrderShippingMethodTaxLine>>(this)
|
||||
|
||||
@OneToMany(
|
||||
() => ShippingMethodAdjustment,
|
||||
() => OrderShippingMethodAdjustment,
|
||||
(adjustment) => adjustment.shipping_method,
|
||||
{
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
}
|
||||
)
|
||||
adjustments = new Collection<Rel<ShippingMethodAdjustment>>(this)
|
||||
adjustments = new Collection<Rel<OrderShippingMethodAdjustment>>(this)
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
@@ -77,7 +77,7 @@ const OrderIdVersionIndex = createPsqlIndexStatementHelper({
|
||||
@Entity({ tableName })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
@OrderIdVersionIndex.MikroORMIndex()
|
||||
export default class Transaction {
|
||||
export default class OrderTransaction {
|
||||
[OptionalProps]?: OptionalLineItemProps
|
||||
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
|
||||
Reference in New Issue
Block a user