import { t } from "@tailor-platform/sdk"; import { defineSchema } from "@tailor-platform/sdk/seed"; import { createTailorDBHook, createStandardSchema } from "@tailor-platform/sdk/test"; import { customerBankAccountUsage } from "../../src/modules-db"; const schemaType = t.object({ ...customerBankAccountUsage.pickFields(["id"], { optional: true }), ...customerBankAccountUsage.omitFields(["id"]), }); export const hook = createTailorDBHook(customerBankAccountUsage); export const schema = defineSchema( createStandardSchema(schemaType, hook, customerBankAccountUsage), { foreignKeys: [ {"column":"accountId","references":{"table":"CustomerAccount","column":"id"}}, {"column":"bankAccountId","references":{"table":"PartnerBankAccount","column":"id"}}, ], indexes: [ {"name":"customer_bank_account_usage_unique_idx","columns":["accountId","bankAccountId","purpose"],"unique":true}, ], } );