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

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

const hook = createTailorDBHook(productAttribute);

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