import { t } from "@tailor-platform/sdk"; import { defineSchema } from "@tailor-platform/sdk/seed"; import { createTailorDBHook, createStandardSchema } from "@tailor-platform/sdk/test"; import { costLayer } from "../../src/modules-db"; const schemaType = t.object({ ...costLayer.pickFields(["id"], { optional: true }), ...costLayer.omitFields(["id"]), }); export const hook = createTailorDBHook(costLayer); export const schema = defineSchema( createStandardSchema(schemaType, hook, costLayer), { foreignKeys: [ {"column":"itemId","references":{"table":"Item","column":"id"}}, {"column":"companyId","references":{"table":"Company","column":"id"}}, {"column":"ledgerEntryId","references":{"table":"InventoryLedger","column":"id"}}, ], indexes: [ {"name":"cost_layer_item_company_effective_idx","columns":["itemId","companyId","effectiveDate"]}, ], } );