Chore/order claims 2 (#8312)
This commit is contained in:
@@ -33,7 +33,7 @@ const ClaimItemIdIndex = createPsqlIndexStatementHelper({
|
||||
|
||||
@Entity({ tableName: "order_claim_item_image" })
|
||||
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
|
||||
export default class ClaimItemImage {
|
||||
export default class OrderClaimItemImage {
|
||||
[OptionalProps]?: OptionalClaimItemImageProps
|
||||
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Claim from "./claim"
|
||||
import ClaimItemImage from "./claim-item-image"
|
||||
import OrderClaimItemImage from "./claim-item-image"
|
||||
import LineItem from "./line-item"
|
||||
|
||||
type OptionalLineItemProps = DAL.ModelDateColumns
|
||||
@@ -50,10 +50,10 @@ export default class OrderClaimItem {
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
id: string
|
||||
|
||||
@OneToMany(() => ClaimItemImage, (ci) => ci.item, {
|
||||
@OneToMany(() => OrderClaimItemImage, (ci) => ci.item, {
|
||||
cascade: [Cascade.PERSIST, Cascade.REMOVE],
|
||||
})
|
||||
images = new Collection<Rel<ClaimItemImage>>(this)
|
||||
images = new Collection<Rel<OrderClaimItemImage>>(this)
|
||||
|
||||
@Enum({ items: () => ClaimReason, nullable: true })
|
||||
reason: Rel<ClaimReason> | null = null
|
||||
@@ -123,7 +123,7 @@ export default class OrderClaimItem {
|
||||
@BeforeCreate()
|
||||
onCreate() {
|
||||
this.id = generateEntityId(this.id, "claitem")
|
||||
this.claim_id = this.claim?.id
|
||||
this.claim_id ??= this.claim?.id
|
||||
}
|
||||
|
||||
@OnInit()
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import { ExchangeItem, Transaction } from "@models"
|
||||
import { OrderExchangeItem, Transaction } from "@models"
|
||||
import Order from "./order"
|
||||
import OrderShippingMethod from "./order-shipping-method"
|
||||
import Return from "./return"
|
||||
@@ -107,10 +107,10 @@ export default class OrderExchange {
|
||||
@Property({ columnType: "boolean", default: false })
|
||||
allow_backorder: boolean = false
|
||||
|
||||
@OneToMany(() => ExchangeItem, (item) => item.exchange, {
|
||||
@OneToMany(() => OrderExchangeItem, (item) => item.exchange, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
additional_items = new Collection<Rel<ExchangeItem>>(this)
|
||||
additional_items = new Collection<Rel<OrderExchangeItem>>(this)
|
||||
|
||||
@OneToMany(
|
||||
() => OrderShippingMethod,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export { default as Address } from "./address"
|
||||
export { default as OrderClaim } from "./claim"
|
||||
export { default as ClaimItem } from "./claim-item"
|
||||
export { default as ClaimItemImage } from "./claim-item-image"
|
||||
export { default as OrderClaimItem } from "./claim-item"
|
||||
export { default as OrderClaimItemImage } from "./claim-item-image"
|
||||
export { default as OrderExchange } from "./exchange"
|
||||
export { default as ExchangeItem } from "./exchange-item"
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user