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

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

const hook = createTailorDBHook(role);

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