const { getAllTickets, addTickets, getTicketsByUserId, viewTicketById, getAllProjectsForTicket, deleteTicket,
     assignedTask, myAssignedTask, myNewtasks, addtaskMembers, addMessage, fetchAllMessages, 
     updateStatusOfTicket, updatePriorityOfTicket, deleteMessage,getTeamData,fetchTicketsFiles,
     addStaffTicketTimelog,fetchClockedInStaffTicketTimelog,updateStaffTicketTimelog, 
     addStickyNote,
     editStickyNote,
     fetchStickyNote,
     updateDevDueDateOfTicket,
     updateStartDateOfTicket,
     editStickyNoteIndividual,
     addStickyNoteIndividual,
     fetchStickyNoteIndividual,
     deleteNotesIndividual,
     fetchAllTeamMembers,
     archiveStickyNoteIndividual,
     fetchArchivedStickyNotes,
     editStickyNotePublicOrShared,
     updateTicketType,
     deleteStickyNoteForUser,
     updateDeliveryDateOfTicket,
     removeTaskMember,
     updateTicketDetails} = require("../controllers/tickets")
const { getUserAssignedTasks } = require("../models/tickets")



const ticketRoutes = [
    {
        method: "POST",
        url: "/webservice/tickets/get-all-tickets",
        handler: getAllTickets
    },
    {
        method:'POST',
        url:'/webservice/tickets/add',
        handler:addTickets
    },
    {
        method:"POST",
        url:'/webservice/tickets/get-by-userid',
        handler:getTicketsByUserId
    },
    {
        method:"POST",
        url:'/webservice/tickets/view-ticket-by-id',
        handler:viewTicketById
    },
    {
        method:"POST",
        url:'/webservice/tickets/get-all-projects',
        handler:getAllProjectsForTicket
    },
    {
        method:'POST',
        url:'/webservice/tickets/delete-ticket',
        handler:deleteTicket,
    },
    {
        method:'POST',
        url:'/webservice/tickets/assign-to-user',
        handler:assignedTask
    },
    {
        method:'POST',
        url:'/webservice/tickets/my-assign',
        handler:myAssignedTask
    },
    {
        method:'POST',
        url:'/webservice/tickets/my-new-tasks',
        handler:myNewtasks
    },
    {
        method:'POST',
        url:'/webservice/tickets/add-members',
        handler:addtaskMembers
    },
    {
        method:'POST',
        url:'/webservice/tickets/remove-member',
        handler:removeTaskMember
    },
    {
        method:'POST',
        url:'/webservice/tickets/send-message',
        handler:addMessage
    },
    {
        method:'POST',
        url:'/webservice/tickets/delete-message',
        handler:deleteMessage
    },
    {
        method:'POST',
        url:'/webservice/tickets/get-messages',
        handler:fetchAllMessages
    },
    {
        method:'POST',
        url:'/webservice/tickets/update-ticket-status',
        handler:updateStatusOfTicket
    },
    {
        method:'POST',
        url:'/webservice/tickets/update-ticket-priority',
        handler:updatePriorityOfTicket
    },
    {
        method:'POST',
        url:'/webservice/tickets/update-ticket-type',
        handler:updateTicketType,
    },
    {
        method:'POST',
        url:'/webservice/tickets/update-dev-due-date',
        handler:updateDevDueDateOfTicket
    },
    {
        method:'POST',
        url:'/webservice/tickets/update-start-date',
        handler:updateStartDateOfTicket
    },
    {
        method:'POST',
        url:'/webservice/tickets/get-team-data',
        handler:getTeamData
    },
    {
        method:'POST',
        url:'/webservice/tickets/get-ticket-files',
        handler:fetchTicketsFiles
    },
    {
        method : "POST",
        url : "/webservice/tickets/add-ticket-timelog",
        handler :addStaffTicketTimelog,
    },
    {
        method : "POST",
        url : "/webservice/tickets/fetch-clockedIn-staff-ticket-timelog",
        handler :fetchClockedInStaffTicketTimelog,
    },
    {
        method : "POST",
        url : "/webservice/tickets/update-staff-ticket-timelog",
        handler :updateStaffTicketTimelog,
    },
    {
        method : "POST",
        url : "/webservice/tickets/add-sticky-note",
        handler :addStickyNote,
    },
    {
        method : "POST",
        url : "/webservice/tickets/edit-sticky-note",
        handler :editStickyNote,
    },
    {
        method : "POST",
        url : "/webservice/tickets/get-sticky-note",
        handler :fetchStickyNote,
    },
    {
        method : "POST",
        url : "/webservice/tickets/add-sticky-note-individual",
        handler :addStickyNoteIndividual,
    },
    {
        method : "POST",
        url : "/webservice/tickets/edit-sticky-note-individual",
        handler :editStickyNoteIndividual,
    },
    {
        method : "POST",
        url : "/webservice/tickets/get-all-sticky-notes-individual",
        handler :fetchStickyNoteIndividual,
    },
    {
        method : "POST",
        url : "/webservice/tickets/delete-sticky-note-individual",
        handler :deleteNotesIndividual,
    },
    {
        method : "POST",
        url : "/webservice/tickets/get-all-team-members-sticky-notes",
        handler :fetchAllTeamMembers,
    },
    {
        method : "POST",
        url : "/webservice/tickets/archive-unarchive-sticky-notes",
        handler :archiveStickyNoteIndividual,
    },
    {
        method : "POST",
        url : "/webservice/tickets/get-archived-sticky-notes",
        handler :fetchArchivedStickyNotes,
    },
    {
        method : "POST",
        url : "/webservice/tickets/shared-save-sticky-notes",
        handler :editStickyNotePublicOrShared,
    },
    {
        method : "POST",
        url : "/webservice/tickets/delete-sticky-for-user",
        handler :deleteStickyNoteForUser,
    },
    {
        method:'POST',
        url:'/webservice/tickets/update-delivery-date',
        handler:updateDeliveryDateOfTicket
    },
    {
        method:"POST",
        url:"/webservice/tickets/update-ticket-details",
        handler:updateTicketDetails
    },
]
module.exports=ticketRoutes