bigbuffet-rw/packages/pl-api/lib/entities/group-relationship.ts
marcin mikołajczak 036fa32cd3 Add pl-api to workspace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:43:23 +02:00

14 lines
393 B
TypeScript

import z from 'zod';
import { GroupRoles } from './group-member';
const groupRelationshipSchema = z.object({
id: z.string(),
member: z.boolean().catch(false),
role: z.nativeEnum(GroupRoles).catch(GroupRoles.USER),
requested: z.boolean().catch(false),
});
type GroupRelationship = z.infer<typeof groupRelationshipSchema>;
export { groupRelationshipSchema, type GroupRelationship };