feat(order, types): Add Credit Line to order module (#10636)
* feat(order, types): Add Credit Line to order module * chore: add action to inject credit lines
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import OrderAddress from "./address"
|
||||
import OrderCreditLine from "./credit-line"
|
||||
import OrderItem from "./order-item"
|
||||
import OrderShipping from "./order-shipping-method"
|
||||
import OrderSummary from "./order-summary"
|
||||
@@ -180,6 +181,11 @@ export default class Order {
|
||||
})
|
||||
items = new Collection<Rel<OrderItem>>(this)
|
||||
|
||||
@OneToMany(() => OrderCreditLine, (creditLine) => creditLine.order, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
credit_lines = new Collection<Rel<OrderCreditLine>>(this)
|
||||
|
||||
@OneToMany(() => OrderShipping, (shippingMethod) => shippingMethod.order, {
|
||||
cascade: [Cascade.PERSIST],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user