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

input AccountingFilterArgs {
  deviation: [String!]
  missing: [String!]
}

enum AccountingState {
  Billable
  Billed
  PreparedForBilling
}

type Anomaly {
  createdAt: DateTime!
  description: String!
  groupDescription: String!
  groupKey: String!
  id: String!
  manuallyResolved: Boolean
  resolvedAt: DateTime
  sleepSince: DateTime
  sleepTimer: Int!
  solution: [SolutionTarget!]!
  type: String!
  workedOnBy: String!
}

type AnomalyGroup {
  anomalies: [Anomaly!]!
  key: String!
}

type ApprovalInfo {
  answeredFrom: String
  isNeeded: Boolean
  location: String
  whoRequested: String
}

input ApprovalInfoArgs {
  answeredFrom: String
  isNeeded: Boolean
  location: String
  whoRequested: String
}

enum ApprovalState {
  APPROVED
  FREE
  REQUESTED
  REQUIRED
  UNKNOWN
}

type AssociatedEntities {
  attendanceRegistration: [AttendanceRegistration!]
  employee: [Employee!]
  plannedTime: [PlannedTime!]
  tour: [Tour!]
  workTime: [WorkTime!]
}

type AttendanceRegistration {
  attendanceRegistrationId: Int!
  dateTime: DateTime!
  employeeId: Int!
  event: String!
  personnelNumber: String!
}

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

type DocumentInfo {
  approval: ApprovalInfo!
  tdLocation: String
}

type Employee {
  id: String!
  name: String!
  occuptationalHealthExamination: DateTime
  personTransportCertificate: DateTime
  personnelNumber: String!
  qualification: String
  surname: String!
}

type HomeDashboardKPIs {
  anomalyCount: Int!
  billableTourCount: Int!
  billableTourRevenueSum: Float!
  billedTourCount: Int!
  billedTourNegativeRevenueDeviation: Float!
  billedTourPositiveRevenueDeviation: Float!
  employeesWithoutTourCount: Int!
  revenueTrend: [RevenueTrend!]!
  toursWithoutApprovalCount: Int!
}

type Interval {
  end: DateTime!
  start: DateTime!
}

type KPI {
  meta: KPIMetadata!
  value: Float!
}

type KPIByCar {
  carName: String!
  kpi: KPI!
}

type KPIMetadata {
  availableTime: Float!
  baseValue: Float!
  breakEven: Float!
  tourAmount: Float!
}

type KpiInfo {
  additional: [Metric!]!
  main: Metric!
  secondary: Metric!
}

type Metric {
  label: String!
  value: Float!
}

type Mutation {
  acceptAnomaly(id: String!): Anomaly!
  setAnomalyToSleep(id: String!): Anomaly!
  setDocumentInfo(approval: ApprovalInfoArgs, tdLocation: String, ticketId: String!): Ticket!
}

type PaginatedAnomaly {
  endCursor: String!
  hasNextPage: Boolean!
  nodes: [Anomaly!]!
  prevCursor: String!
  totalCount: Int!
}

type PaginatedAnomalyGroup {
  endCursor: String!
  hasNextPage: Boolean!
  nodes: [AnomalyGroup!]!
  prevCursor: String!
  totalCount: Int!
}

type PaginatedTicket {
  endCursor: String!
  hasNextPage: Boolean!
  nodes: [Ticket!]!
  prevCursor: String!
  totalCount: Int!
}

type PaginatedTour {
  endCursor: String!
  hasNextPage: Boolean!
  nodes: [Tour!]!
  prevCursor: String!
  totalCount: Int!
}

type PlannedTime {
  department: String!
  duration: Int!
  endDate: DateTime!
  firstname: String!
  id: String!
  note: String
  pause: Int!
  startDate: DateTime!
  surname: String!
  userId: String!
}

type Query {
  accountingStateMeta(state: AccountingState!): TourStateMeta!
  accountingTours(cursor: String, filters: AccountingFilterArgs, state: AccountingState!, take: Int! = 10): PaginatedTour!
  anomalies(cursor: String, take: Int! = 10): PaginatedAnomaly!
  anomaliesProto: [Anomaly!]!
  anomaly(id: String!): Anomaly!
  associatedEntities(id: String!): AssociatedEntities!
  groupedAnomalies(cursor: String, take: Int! = 10): PaginatedAnomalyGroup!
  homeDashboardKpis: HomeDashboardKPIs!
  managerKpi(ordinanceType: String!): KpiInfo!
  searchTickets(query: String!): [Ticket!]!
  ticket(id: String!): Ticket!
  ticketStateKeyFigures(state: TicketValidationState!): TicketStateKeyFigures!
  ticketStateKpi(state: TicketValidationState!): KpiInfo!
  ticketStateMeta(state: TicketValidationState!): TicketStateMeta!
  tickets(cursor: String, filters: TicketFilterArgs, state: TicketValidationState!, take: Int! = 10): PaginatedTicket!
  timePerTourMetricForDay(day: DateTime!, ordinanceType: String!): [TimePerTourMetric!]!
  timePerTourMetricForMonth(day: DateTime!, ordinanceType: String!): [TimePerTourMetric!]!
  tourCostBreakdown(operationId: String!): TourCostBreakdown!
  toursPerTimeKPI(ordinanceTypes: String!): [TimePerTourKPISummary!]!
  upcomingTours: [Tour!]!
}

type RevenueTrend {
  date: DateTime!
  ordinanceType: String!
  revenueSum: Float!
}

type ServicePosition {
  description: String!
  value: Float!
  variant: String!
}

type SolutionTarget {
  anomalyId: String!
  id: String!
  name: String!
  steps: [SolutionTargetStep!]!
}

type SolutionTargetStep {
  description: String!
  id: String!
  solutionTargetId: String!
}

type Subscription {
  ticketsUpdated: TicketsUpdated!
  timePerTourUpdated: TimePerTourUpdate!
}

type Ticket {
  approvalState: ApprovalState
  createdAt: DateTime!
  currentState: TicketValidationState!
  documentInfo: DocumentInfo
  errors: [String!]!
  id: String!
  isUrgent: Boolean!
  notes: [String!]!
  tours: [Tour!]!
  urgency: DateTime!
}

input TicketFilterArgs {
  approvalStates: [ApprovalState!]
  documentInfo: [String!]
  errors: [String!]
}

type TicketStateKeyFigures {
  dwellTime: Int!
}

type TicketStateMeta {
  approvalNotCompanyCount: Int
  approvalRequiredCount: Int
  approvalUnknownCount: Int
  count: Int!
  tdNotCompanyCount: Int
}

enum TicketValidationState {
  ARCHIVED
  CREATED
  DOCUMENTS_MISSING
  TD_UNCERTAIN
  USER_INTERACTION_REQUIRED
}

type TicketsUpdated {
  count: Int!
}

type TimePerTourKPISummary {
  cars: [KPIByCar!]!
  interval: Interval!
  kpi: KPI!
}

type TimePerTourMetric {
  availableTime: Float!
  averageRevenue: Float!
  breakEven: Float!
  categoryAmounts: [TimePerTourMetricCategoryAmount!]!
  consumptionCost: Float!
  forecast: Float!
  forecastRevenue: Float!
  interval: Interval!
  personnelCost: Float!
  revenue: Float!
  tourAmount: Float!
}

type TimePerTourMetricCategoryAmount {
  amount: Int!
  category: String!
}

type TimePerTourUpdate {
  job: String!
}

type Tour {
  billDate: DateTime
  billNumber: String
  carName: String
  category: String
  check: Int!
  codriverId: String
  codriverName: String
  consumptionCosts: Float!
  createdAt: DateTime
  deletedAt: DateTime
  direction: String!
  done: Boolean!
  driverId: String
  driverName: String
  empty: String
  hasInfection: Boolean
  healthInsurance: String
  healthInsuranceNumber: String
  id: String!
  infectionName: String
  occupiedKm: Float!
  operationId: String!
  ordinanceType: String
  patientCity: String
  patientId: String
  patientName: String
  patientStreet: String
  patientSurname: String
  patientZip: String
  rangeEndDate: DateTime
  revenue: Float!
  revenueDeviation: Float!
  revenueDispoLive: Float!
  startBegin: String
  startCity: String
  startDate: DateTime
  startEnd: String
  startInstitution: String
  startStreet: String
  startZip: String
  target: String
  targetBegin: String
  targetCity: String
  targetInstitution: String
  targetStreet: String
  targetZip: String
  ticket: Ticket
  ticketId: String
  totalKm: Float!
  transportType: String
  type: String!
  updatedAt: DateTime
}

type TourCostBreakdown {
  servicePositions: [ServicePosition!]!
  tariffDescription: String!
  tariffValidityPeriod: String!
}

type TourStateMeta {
  count: Int!
  negativeRevenueDeviation: Float
  positiveRevenueDeviation: Float
  revenueSum: Float
}

type WorkTime {
  department: String!
  duration: Int!
  endDate: DateTime!
  firstname: String!
  id: String!
  pause: Int!
  startDate: DateTime!
  surname: String!
  userId: String!
}