import { DALUtils, generateEntityId } from "@medusajs/utils" import { BeforeCreate, Entity, Filter, Index, OnInit, OptionalProps, PrimaryKey, Property, } from "@mikro-orm/core" import { DAL } from "@medusajs/types" type FulfillmentSetOptionalProps = DAL.SoftDeletableEntityDateColumns @Entity() @Filter(DALUtils.mikroOrmSoftDeletableFilterOptions) export default class FulfillmentSet { [OptionalProps]?: FulfillmentSetOptionalProps @PrimaryKey({ columnType: "text" }) id: string @Property({ columnType: "text" }) name: string @Property({ onCreate: () => new Date(), columnType: "timestamptz", defaultRaw: "now()", }) created_at: Date @Property({ onCreate: () => new Date(), onUpdate: () => new Date(), columnType: "timestamptz", defaultRaw: "now()", }) updated_at: Date @Index({ name: "IDX_fulfillment_set_deleted_at" }) @Property({ columnType: "timestamptz", nullable: true }) deleted_at: Date | null = null @BeforeCreate() onCreate() { this.id = generateEntityId(this.id, "fuset") } @OnInit() onInit() { this.id = generateEntityId(this.id, "fuset") } }