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:
Riqwan Thamir
2024-12-19 10:36:59 +01:00
committed by GitHub
parent fec24aa7eb
commit 3f4d574748
15 changed files with 545 additions and 4 deletions
@@ -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],
})