Add missing data model name in `model.define` in the Order Module where missing, as we need to infer the names in the references we generate Closes DX-1305
34 lines
957 B
TypeScript
34 lines
957 B
TypeScript
import { model } from "@medusajs/framework/utils"
|
|
import { OrderShippingMethod } from "./shipping-method"
|
|
|
|
const _OrderShippingMethodAdjustment = model
|
|
.define(
|
|
{
|
|
tableName: "order_shipping_method_adjustment",
|
|
name: "OrderShippingMethodAdjustment",
|
|
},
|
|
{
|
|
id: model.id({ prefix: "ordsmadj" }).primaryKey(),
|
|
description: model.text().nullable(),
|
|
promotion_id: model.text().nullable(),
|
|
code: model.text().nullable(),
|
|
amount: model.bigNumber(),
|
|
provider_id: model.text().nullable(),
|
|
shipping_method: model.belongsTo<() => typeof OrderShippingMethod>(
|
|
() => OrderShippingMethod,
|
|
{
|
|
mappedBy: "adjustments",
|
|
}
|
|
),
|
|
}
|
|
)
|
|
.indexes([
|
|
{
|
|
name: "IDX_order_shipping_method_adjustment_shipping_method_id",
|
|
on: ["shipping_method_id"],
|
|
unique: false,
|
|
},
|
|
])
|
|
|
|
export const OrderShippingMethodAdjustment = _OrderShippingMethodAdjustment
|