Files
medusa-store/packages/modules/order/src/models/shipping-method-adjustment.ts
Shahed Nasser 16fe43f214 fix(order): add data model name in define schema (#11181)
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
2025-01-29 10:53:13 +00:00

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