import { graphql } from "@/gql";

export const ATTENDANCE_CHECK_MUTATION = graphql(`
  mutation AttendanceCheckMutation(
    $attendanceCourseId: ID!
    $attendanceUserList: [AttendanceUserInputType]!
  ) {
    update_course_session_attendance_course_users(
      id: $attendanceCourseId
      attendance_user_list: $attendanceUserList
    ) {
      course_session_attendance_course {
        id
        attendance_user_list {
          user_id
          first_name
          last_name
          email
          status
        }
      }
    }
  }
`);

export const UPSERT_ASSIGNMENT_COMPLETION_MUTATION = graphql(`
  mutation UpsertAssignmentCompletion(
    $assignmentId: ID!
    $courseSessionId: ID!
    $learningContentId: ID
    $assignmentUserId: UUID
    $completionStatus: AssignmentCompletionStatus!
    $completionDataString: String!
    $evaluationPoints: Float
    $initializeCompletion: Boolean
  ) {
    upsert_assignment_completion(
      assignment_id: $assignmentId
      course_session_id: $courseSessionId
      learning_content_page_id: $learningContentId
      assignment_user_id: $assignmentUserId
      completion_status: $completionStatus
      completion_data_string: $completionDataString
      evaluation_points: $evaluationPoints
      initialize_completion: $initializeCompletion
    ) {
      assignment_completion {
        id
        completion_status
        submitted_at
        evaluation_submitted_at
        evaluation_points
        completion_data
        task_completion_data
      }
    }
  }
`);
