import { ObjectType, Field, ID, registerEnumType } from '@nestjs/graphql';
import { UserType } from './user.type';

export enum FamilyRole {
  PARENT = 'parent',
  CAREGIVER = 'caregiver',
}

registerEnumType(FamilyRole, {
  name: 'FamilyRole',
});

@ObjectType('FamilyMember')
export class FamilyMemberType {
  @Field()
  familyId: string;

  @Field()
  userId: string;

  @Field(() => FamilyRole)
  role: FamilyRole;

  @Field(() => UserType, { nullable: true })
  user?: UserType;

  @Field()
  createdAt: Date;
}
