import { t } from "@tailor-platform/sdk"; import { defineSchema } from "@tailor-platform/sdk/seed"; import { createTailorDBHook, createStandardSchema } from "@tailor-platform/sdk/test"; import { customerAccount } from "../../src/modules-db"; const schemaType = t.object({ ...customerAccount.pickFields(["id"], { optional: true }), ...customerAccount.omitFields(["id"]), }); export const hook = createTailorDBHook(customerAccount); export const schema = defineSchema( createStandardSchema(schemaType, hook, customerAccount), { foreignKeys: [ {"column":"partnerId","references":{"table":"BusinessPartner","column":"id"}}, {"column":"companyId","references":{"table":"Company","column":"id"}}, {"column":"preferredCurrencyId","references":{"table":"Currency","column":"id"}}, ], indexes: [ {"name":"customer_account_company_code_unique_idx","columns":["companyId","code"],"unique":true}, ], } );