mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 00:49:42 -06:00
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com> Co-authored-by: Matthias Nannt <mail@matthiasnannt.com> Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com> Co-authored-by: Victor Santos <victor@formbricks.com> Co-authored-by: victorvhs017 <115753265+victorvhs017@users.noreply.github.com>
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import type { ContactAttribute } from "@prisma/client";
|
|
import { z } from "zod";
|
|
import { extendZodWithOpenApi } from "zod-openapi";
|
|
|
|
extendZodWithOpenApi(z);
|
|
|
|
export const ZContactAttribute = z.object({
|
|
id: z.string().cuid2().openapi({
|
|
description: "The ID of the contact attribute",
|
|
}),
|
|
createdAt: z.coerce.date().openapi({
|
|
description: "The date and time the contact attribute was created",
|
|
example: "2021-01-01T00:00:00.000Z",
|
|
}),
|
|
updatedAt: z.coerce.date().openapi({
|
|
description: "The date and time the contact attribute was last updated",
|
|
example: "2021-01-01T00:00:00.000Z",
|
|
}),
|
|
attributeKeyId: z.string().cuid2().openapi({
|
|
description: "The ID of the attribute key",
|
|
}),
|
|
contactId: z.string().cuid2().openapi({
|
|
description: "The ID of the contact",
|
|
}),
|
|
value: z.string().openapi({
|
|
description: "The value of the attribute",
|
|
example: "example@email.com",
|
|
}),
|
|
}) satisfies z.ZodType<ContactAttribute>;
|
|
|
|
ZContactAttribute.openapi({
|
|
ref: "contactAttribute",
|
|
description: "A contact attribute value associated with a contact",
|
|
});
|