bigbuffet-rw/packages/pl-api/lib/entities/group-member.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

21 lines
426 B
TypeScript

import z from 'zod';
import { accountSchema } from './account';
enum GroupRoles {
OWNER = 'owner',
ADMIN = 'admin',
USER = 'user'
}
type GroupRole =`${GroupRoles}`;
const groupMemberSchema = z.object({
id: z.string(),
account: accountSchema,
role: z.nativeEnum(GroupRoles),
});
type GroupMember = z.infer<typeof groupMemberSchema>;
export { groupMemberSchema, type GroupMember, GroupRoles, type GroupRole };