import gql from 'graphql-tag' ; export const HAS_CHILD_LOCATION = gql `
  query data($parentId: String!) {
    hasChildLocation(parentId: $parentId) {
      id
      type
      identifier {
        system
        value
      }
    }
  }
` ; export const FETCH_MONTH_WISE_EVENT_ESTIMATIONS = gql `
  query data(
    $timeStart: String!
    $timeEnd: String!
    $locationId: String!
    $event: String!
  ) {
    fetchMonthWiseEventMetrics(
      timeStart: $timeStart
      timeEnd: $timeEnd
      locationId: $locationId
      event: $event
    ) {
      details {
        actualTotalRegistration
        actual45DayRegistration
        estimatedRegistration
        estimated45DayPercentage
        month
        year
        startOfMonth
      }
      total {
        actualTotalRegistration
        actual45DayRegistration
        estimatedRegistration
        estimated45DayPercentage
      }
    }
  }
` ; export const FETCH_LOCATION_WISE_EVENT_ESTIMATIONS = gql `
  query data(
    $timeStart: String!
    $timeEnd: String!
    $locationId: String!
    $event: String!
  ) {
    fetchLocationWiseEventMetrics(
      timeStart: $timeStart
      timeEnd: $timeEnd
      locationId: $locationId
      event: $event
    ) {
      details {
        actualTotalRegistration
        actual45DayRegistration
        estimatedRegistration
        estimated45DayPercentage
        locationId
        locationName
      }
      total {
        actualTotalRegistration
        actual45DayRegistration
        estimatedRegistration
        estimated45DayPercentage
      }
    }
  }
` ; export const FETCH_STATUS_WISE_REGISTRATION_COUNT = gql `
  query data($locationId: String!, $status: [String]!) {
    fetchRegistrationCountByStatus(locationId: $locationId, status: $status) {
      results {
        status
        count
      }
      total
    }
  }
` ; export const FETCH_EVENTS_WITH_PROGRESS = gql `
  query data(
    $locationId: String!
    $count: Int
    $skip: Int
    $status: [String]
    $type: [String]
  ) {
    getEventsWithProgress(
      count: $count
      skip: $skip
      locationId: $locationId
      status: $status
      type: $type
    ) {
      totalItems
      results {
        id
        type
        name {
          use
          firstNames
          familyName
        }
        dateOfEvent
        registration {
          status
          contactNumber
          contactRelationship
          dateOfApplication
          trackingId
          registrationNumber
          createdAt
          modifiedAt
        }
        startedBy {
          name {
            use
            firstNames
            familyName
          }
          role
        }
        startedByFacility
        startedAt
        progressReport {
          timeInProgress
          timeInReadyForReview
          timeInRequiresUpdates
          timeInWaitingForApproval
          timeInWaitingForBRIS
          timeInReadyToPrint
        }
      }
    }
  }
` ; export const FETCH_FIELD_AGENTS_WITH_PERFORMANCE_DATA = gql `
  query data(
    $locationId: String
    $primaryOfficeId: String
    $timeStart: String!
    $timeEnd: String!
    $event: String
    $status: String
    $language: String
    $count: Int
    $skip: Int
    $sort: String
  ) {
    searchFieldAgents(
      timeStart: $timeStart
      timeEnd: $timeEnd
      locationId: $locationId
      primaryOfficeId: $primaryOfficeId
      event: $event
      status: $status
      language: $language
      count: $count
      skip: $skip
      sort: $sort
    ) {
      results {
        practitionerId
        fullName
        type
        status
        primaryOfficeId
        creationDate
        totalNumberOfApplicationStarted
        totalNumberOfInProgressAppStarted
        totalNumberOfRejectedApplications
        averageTimeForDeclaredApplications
      }
      totalItems
    }
  }
` ;