# dataconnect/connector/assignment/queries.gql

query listAssignment @auth(level: USER) {
  assignments {
    id
    assignmentNumber
    orderId
    workforceId
    vendorId
    role
    assignmentStatus
    scheduledStart
  }
}

query getAssignmentById(
  $id: UUID!
) @auth(level: USER) {
  assignment(id: $id) {
    id
    assignmentNumber
    orderId
    workforceId
    vendorId
    role
    assignmentStatus
    scheduledStart
  }
}

query filterAssignment(
  $assignmentNumber: String,
  $orderId: UUID,
  $workforceId: UUID,
  $vendorId: UUID,
  $assignmentStatus: AssignmentStatus
) @auth(level: USER) {
  assignments(
    where: {
      assignmentNumber: { eq: $assignmentNumber }
      orderId: { eq: $orderId }
      workforceId: { eq: $workforceId }
      vendorId: { eq: $vendorId }
      assignmentStatus: { eq: $assignmentStatus }
    }
  ) {
    id
    assignmentNumber
    orderId
    workforceId
    vendorId
    role
    assignmentStatus
    scheduledStart
  }
}
