Files
formbricks/packages/database/zod/teams.ts
victorvhs017 c03e60ac0b feat: organization endpoints (#5076)
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
2025-04-05 13:54:21 +02:00

32 lines
846 B
TypeScript

import type { Team } from "@prisma/client";
import { z } from "zod";
import { extendZodWithOpenApi } from "zod-openapi";
extendZodWithOpenApi(z);
export const ZTeam = z.object({
id: z.string().cuid2().openapi({
description: "The ID of the team",
}),
createdAt: z.coerce.date().openapi({
description: "The date and time the team was created",
example: "2021-01-01T00:00:00.000Z",
}),
updatedAt: z.coerce.date().openapi({
description: "The date and time the team was last updated",
example: "2021-01-01T00:00:00.000Z",
}),
name: z.string().openapi({
description: "The name of the team",
example: "My team",
}),
organizationId: z.string().cuid2().openapi({
description: "The ID of the organization",
}),
}) satisfies z.ZodType<Team>;
ZTeam.openapi({
ref: "team",
description: "A team",
});