Raw
1 import { model } from "@medusajs/framework/utils"
2 import { OrderShippingMethod } from "./shipping-method"
3
4 const _OrderShippingMethodTaxLine = model
5 .define(
6 {
7 tableName: "order_shipping_method_tax_line",
8 name: "OrderShippingMethodTaxLine",
9 },
10 {
11 id: model.id({ prefix: "ordsmtxl" }).primaryKey(),
12 description: model.text().nullable(),
13 tax_rate_id: model.text().nullable(),
14 code: model.text(),
15 rate: model.bigNumber(),
16 provider_id: model.text().nullable(),
17 metadata: model.json().nullable(),
18 data: model.json().nullable(),
19 shipping_method: model.belongsTo<() => typeof OrderShippingMethod>(
20 () => OrderShippingMethod,
21 {
22 mappedBy: "tax_lines",
23 }
24 ),
25 }
26 )
27 .indexes([
28 {
29 name: "IDX_order_shipping_method_tax_line_shipping_method_id",
30 on: ["shipping_method_id"],
31 unique: false,
32 },
33 ])
34
35 export const OrderShippingMethodTaxLine = _OrderShippingMethodTaxLine