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

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

const hook = createTailorDBHook(auditEntry);

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