query GetUpcomingTours {
  upcomingTours {
    id
    operationId
    carName
    driverName
    codriverName
    startDate
    patientName
    patientSurname
    patientStreet
    patientZip
    patientCity
    startInstitution
    startStreet
    startZip
    startCity
    targetInstitution
    targetStreet
    targetZip
    targetCity
    ordinanceType
    createdAt
  }
}

query GetAccountingStateMeta($state: AccountingState!) {
  accountingStateMeta(state: $state) {
    count
    revenueSum
    positiveRevenueDeviation
    negativeRevenueDeviation
  }
}

query GetAccountingTours(
  $state: AccountingState!
  $filters: AccountingFilterArgs
  $cursor: String
  $take: Int
) {
  accountingTours(
    state: $state
    filters: $filters
    cursor: $cursor
    take: $take
  ) {
    prevCursor
    endCursor
    hasNextPage
    totalCount
    nodes {
      id
      done
      direction
      carName
      operationId
      driverName
      codriverName
      patientName
      patientSurname
      patientStreet
      patientZip
      patientCity
      healthInsurance
      category
      transportType
      ordinanceType
      startStreet
      startZip
      startCity
      targetStreet
      targetZip
      targetCity
      startDate
      check
      occupiedKm
      totalKm
      type
      rangeEndDate
      startBegin
      startEnd
      target
      targetBegin
      empty
      billDate
      billNumber
      consumptionCosts
      revenue
      revenueDispoLive
      revenueDeviation
      startInstitution
      targetInstitution
      ticketId
      createdAt

      ticket {
        id
        currentState
        approvalState
        errors
        notes
        isUrgent
        urgency
        createdAt
      }
    }
  }
}

query GetTourCostBreakdown($operationId: String!) {
  tourCostBreakdown(operationId: $operationId) {
    tariffDescription
    tariffValidityPeriod
    servicePositions {
      value
      description
      variant
    }
  }
}
