import { ObjectType, Field, ID } from '@nestjs/graphql';
import { FamilyMemberType } from './family.type';

@ObjectType('User')
export class UserType {
  @Field(() => ID)
  id: string;

  @Field()
  email: string;

  @Field()
  name: string;

  @Field({ nullable: true })
  phone?: string;

  @Field(() => [FamilyMemberType], { nullable: true })
  families?: FamilyMemberType[];

  @Field()
  createdAt: Date;

  @Field()
  updatedAt: Date;
}
