bigbuffet-rw/packages/pl-api/lib/entities/group-member.ts
mkljczk 72523df008 pl-fe: migrate group members
Signed-off-by: mkljczk <git@mkljczk.pl>
2024-12-05 10:49:43 +01:00

30 lines
537 B
TypeScript

import * as v from 'valibot';
import { accountSchema } from './account';
enum GroupRoles {
OWNER = 'owner',
ADMIN = 'admin',
USER = 'user'
}
/**
* @category Entity types
*/
type GroupRole =`${GroupRoles}`;
/**
* @category Schemas
*/
const groupMemberSchema = v.object({
id: v.string(),
account: accountSchema,
role: v.enum(GroupRoles),
});
/**
* @category Entity types
*/
type GroupMember = v.InferOutput<typeof groupMemberSchema>;
export { groupMemberSchema, type GroupMember, type GroupRoles, type GroupRole };