import { ObjectType, Field, Int } from '@nestjs/graphql';
import { ChildType } from './child.type';
import { ActivityGQLType } from './activity.type';
import { FamilyMemberType } from './family.type';

@ObjectType('DailySummary')
export class DailySummaryType {
  @Field(() => Int)
  feedingCount: number;

  @Field(() => Int, { nullable: true })
  totalFeedingAmount?: number;

  @Field(() => Int)
  sleepCount: number;

  @Field(() => Int, { nullable: true })
  totalSleepDuration?: number;

  @Field(() => Int)
  diaperCount: number;

  @Field(() => Int)
  medicationCount: number;

  @Field()
  date: string;
}

@ObjectType('Dashboard')
export class DashboardType {
  @Field(() => [ChildType])
  children: ChildType[];

  @Field(() => ChildType, { nullable: true })
  selectedChild?: ChildType;

  @Field(() => [ActivityGQLType])
  recentActivities: ActivityGQLType[];

  @Field(() => DailySummaryType, { nullable: true })
  todaySummary?: DailySummaryType;

  @Field(() => [FamilyMemberType])
  familyMembers: FamilyMemberType[];

  @Field(() => Int)
  totalChildren: number;

  @Field(() => Int)
  totalActivitiesToday: number;
}
