import axiosInstance from "@/apis/axios.config";
import type {AISpeakingAssignmentDTO} from "@/types/dto";

const ASSIGNMENT_PREFIX = "/api/aispeaking"

const aiSpeakingAssignmentApis = {
    createAiSpeakingAssignment(courseId:number, assignmentDTO: AISpeakingAssignmentDTO){
        return axiosInstance.post(ASSIGNMENT_PREFIX, assignmentDTO, {
            params: {
                courseId
            }
        });
    },

    getAiSpeakingAssignmentById(assignmentId: number){
        return axiosInstance.get(`${ASSIGNMENT_PREFIX}/byAssignment/${assignmentId}`)
    },
    
    updateAiSpeakingAssignment(assignmentId:number, assignmentDTO:AISpeakingAssignmentDTO){
        return axiosInstance.post(`${ASSIGNMENT_PREFIX}/update`, assignmentDTO, {
            params: {
                assignmentId
            }
        })
    },
    deleteAiAssignmentById(teacherId:number, assignmentId:number){
        return axiosInstance.delete(`${ASSIGNMENT_PREFIX}`, {
            params: {
                teacherId,
                assignmentId
            }
        })

    }
}

export default aiSpeakingAssignmentApis
