import { t } from "@tailor-platform/sdk";
import { defineSchema } from "@tailor-platform/sdk/seed";
import { createTailorDBHook, createStandardSchema } from "@tailor-platform/sdk/test";
import { currency } from "../../src/modules-db";

const schemaType = t.object({
  ...currency.pickFields(["id","createdAt"], { optional: true }),
  ...currency.omitFields(["id","createdAt"]),
});

const hook = createTailorDBHook(currency);

export const schema = defineSchema(
  createStandardSchema(schemaType, hook),
  {
    indexes: [
      {"name":"currency_code_unique_idx","columns":["code"],"unique":true},
    ],
  }
);
