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

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

const hook = createTailorDBHook(uomCategory);

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