# ------------------------------------------------------
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------

type Activity {
  child: Child
  childId: String!
  createdAt: DateTime!
  endedAt: DateTime
  id: ID!
  loggedBy: String!
  logger: User
  metadata: JSON
  notes: String
  startedAt: DateTime!
  type: ActivityType!
  updatedAt: DateTime!
}

enum ActivityType {
  ACTIVITY
  DIAPER
  FEEDING
  GROWTH
  MEDICATION
  MEDICINE
  MILESTONE
  SLEEP
  TEMPERATURE
}

type Child {
  birthDate: DateTime!
  createdAt: DateTime!
  familyId: String!
  gender: String
  id: ID!
  name: String!
  photoUrl: String
  updatedAt: DateTime!
}

input CreateActivityInput {
  childId: String!
  endedAt: DateTime
  metadata: JSON
  notes: String
  startedAt: DateTime!
  type: ActivityType!
}

input CreateChildInput {
  birthDate: DateTime!
  familyId: String!
  gender: Gender
  medicalInfo: JSON
  name: String!
  photoUrl: String
}

type DailySummary {
  date: String!
  diaperCount: Int!
  feedingCount: Int!
  medicationCount: Int!
  sleepCount: Int!
  totalFeedingAmount: Int
  totalSleepDuration: Int
}

type Dashboard {
  child: Child
  children: [Child!]!
  familyMembers: [FamilyMember!]!
  logger: User
  recentActivities: [Activity!]!
  selectedChild: Child
  todaySummary: DailySummary
  totalActivitiesToday: Int!
  totalChildren: Int!
}

"""
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
"""
scalar DateTime

type FamilyMember {
  createdAt: DateTime!
  familyId: String!
  role: FamilyRole!
  user: User
  userId: String!
}

enum FamilyRole {
  CAREGIVER
  PARENT
}

enum Gender {
  FEMALE
  MALE
  OTHER
  PREFER_NOT_TO_SAY
}

"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON

type Mutation {
  createActivity(input: CreateActivityInput!): Activity!
  createChild(input: CreateChildInput!): Child!
  deleteActivity(id: String!): Boolean!
  deleteChild(id: String!): Boolean!
  updateActivity(id: String!, input: UpdateActivityInput!): Activity!
  updateChild(id: String!, input: UpdateChildInput!): Child!
}

type Query {
  dashboard(childId: String): Dashboard!
}

input UpdateActivityInput {
  endedAt: DateTime
  metadata: JSON
  notes: String
  startedAt: DateTime
  type: String
}

input UpdateChildInput {
  birthDate: DateTime
  gender: Gender
  medicalInfo: JSON
  name: String
  photoUrl: String
}

type User {
  createdAt: DateTime!
  email: String!
  families: [FamilyMember!]
  id: ID!
  name: String!
  phone: String
  updatedAt: DateTime!
}