Raw
1 import { model } from "@medusajs/framework/utils"
2
3 import { Fulfillment } from "./fulfillment"
4
5 export const FulfillmentItem = model
6 .define("fulfillment_item", {
7 id: model.id({ prefix: "fulit" }).primaryKey(),
8 title: model.text(),
9 sku: model.text(),
10 barcode: model.text(),
11 quantity: model.bigNumber(),
12 line_item_id: model.text().nullable(),
13 inventory_item_id: model.text().nullable(),
14 fulfillment: model.belongsTo(() => Fulfillment, {
15 mappedBy: "items",
16 }),
17 })
18 .indexes([
19 {
20 on: ["inventory_item_id"],
21 where: "deleted_at IS NULL",
22 },
23 {
24 on: ["line_item_id"],
25 where: "deleted_at IS NULL",
26 },
27 ])