const { addJobCost, fetchAllJobCostByProjectId, fetchDataForPayOut, fetchAllProjectTaskById, addPayOut, fetchAllPayOut, getPayOutById, updatePayOut, updateMaterialInJobcost, viewAddedMaterialInTask, updateProductInJobcost, updateJobCostStatusController, addStickyNote, editStickyNote, fetchStickyNote, fetchJobCostLogsController,fetchAllFutureInstallations } = require("../controllers/jobCost");
const { startStopwatch, stopStopwatch, clearStopwatch, fetchStopwatchData, updateStopwatchEntry } = require("../controllers/stopwatchFunctions");
const {
    addProject,
    getAllProjects,
    getAllProjectsCount,
    getProjectFilterData,
    getAllProjectsProgress,
    getProjectById,
    getDataForAddProject,
    getAllProjectCategories, getAllProjectTypes, addProjectType, getProjectTypeById, updateProject, viewProjectTask, addProjectMember, viewAllProjectSubTask, deleteProject, addProjectCategory, getProjectCategoryById, editProjectCategory, deleteProjectCategory, editProjectType,deleteProjectType, addProjectPost, LikeProjectPost, starredPost, deleteProjectPost, addprojectPostComments, getprojectPostByid, editProjectPost, likeProjectPostComments, deletProjectPostComment, viewAllPostComments, addProjectPostAttachments, updateProjectCompletion,
    fetchProjectByClientId,
    fetchprojectsByTeamId,
    updateProjectTaskCompletion,
    updateProjectSubTaskCompletion,
    saveJobCardOrder,
    addNoChargeType,
    editNoChargeType,
    getAllNoChargeTypes,
    deleteNoChargeType,
    getAllDesignOrderJobs,
    getAllDesignOrderJobsCalendar,
    getDesignOrderProjectById,
    viewAllDesignOrderProjectSubTask,
    addDesignOrderJobMember,
    getDesignOrderProjectTaskById,
    getAllDesignOrderJobsCount,
    fetchAllDesignsFromTask,
    getAllJobsTabCount,
    reduceJobsTabCount,getProjectStatusById,
    fetchServiceByTask,
    fetchAllUsersByTask,
    fetchAllUsersByTimeAndMaterial,
    deleteStaffTaskTimelogsByServiceId,
    getTeamMembersByServiceId,
    assignNewMembersToSubtasksBySkill,
    getAllTeamMembersForEmail,
    getAllEstimateJobs,
    getAllEstimateJobsCount,
    getAllEstimateProjects,
    getAllEstimateProjectsCount,
    getSpecificDataForAddProject,
    getAllProjectsCommunityCount,
}
= require("../controllers/project");
const { updatateProjectStatus, addProjectTask, updatateProjectTaskStatus,updateProjectTask, addProjectSubTask, 
    viewSubTask, updateProjectSubTask, deleteProjectTask, deleteProjectSubTask, deleteProjectTaskMember, 
    updatateProjectSubTaskStatus, addProjectTaskAttachments, deleteProjectTaskAttachments, 
    fetchProjectAttachments, fetchProjectTaskAttachments, addProjectAttachments, deleteProjectAttachments, 
    addStaffTaskTimelog, fetchStaffTaskTimelog, updateStaffTaskTimelog, fetchClockedInStaffTaskTimelog, 
    fetchAllStaffTaskTimelog, addTimesheet, updatateJobHoldStatus, addManualStaffTaskTimelog, approveManualStaffTaskTimelog,
    deleteManualStaffTaskTimelog, deleteDesignOrderProjectTask, deleteDesignOrderProjectSubTask, 
    deleteDesignOrderProjectTaskMember, addDesignOrderAttachments, fetchDesignOrderAttachments, deleteDesignOrderAttachments, viewDesignOrderSubTask, updatateDesignOrderProjectSubTaskStatus, updatateDesignOrderJobHoldStatus,addDesignOrderStaffTaskTimelog,fetchClockedInDesignOrderStaffTaskTimelog,
    updateDesignOrderStaffTaskTimelog,uploadReceiptToQuickbook, 
    fetchAllProjectAttachments,
    updateTaskWorkflowByOrderProduct,
    checkReadyForInstallationStatus,addStaffTaskTimelogDriverAndInstaller,updateStaffTaskTimelogDriverAndInstaller,
    checkAllProjectTasksCompletedStatus,
    handleDesignOrderTimelogPayout,
    deleteManualStaffDesignTaskTimelog,addInstallerTaskTimelog,updateInstallerTaskTimelog,
    approveDesignManualStaffTaskTimelog} = require("../controllers/projectTask");
const { projectStatistics, projectStatisticsOptimized, UpcomingprojectStatistics} = require("../controllers/settings");
const { fetchAllTeamMembers, fetchAllAttachments } = require("../models/Projects");





const projectRoutes = [
    {
        method : "POST",
        url : "/webservice/project/add-project",
        handler : addProject
    },
    {
        method : "POST",
        url : "/webservice/project/get-project-by-id",
        handler : getProjectById
    },
    {
        method : "POST",
        url : "/webservice/project/update-project",
        handler : updateProject
    },
    {
        method : "POST",
        url : "/webservice/project/delete-project",
        handler : deleteProject
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-projects",
        handler : getAllProjects
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-projects-community-count",
        handler : getAllProjectsCommunityCount
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-projects-count",
        handler : getAllProjectsCount
    },
        {
        method : "POST",
        url : "/webservice/project/get-all-estimate-projects",
        handler : getAllEstimateProjects
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-estimate-projects-count",
        handler : getAllEstimateProjectsCount
    },
    {
        method : "POST",
        url : "/webservice/project/get-project-filter-data",
        handler : getProjectFilterData
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-projects-progress",
        handler : getAllProjectsProgress
    },
    {
        method : "POST",
        url : "/webservice/project/get-data-for-add-project",
        handler : getDataForAddProject
    },
    {
        method : "POST",
        url : "/webservice/project/get-specific-data-for-add-project",
        handler : getSpecificDataForAddProject
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-project-categories",
        handler : getAllProjectCategories
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-no-charge-type",
        handler : getAllNoChargeTypes
    },
    {
        method : "POST",
        url : "/webservice/project/add-project-type",
        handler : addProjectType
    },
    {
        method : "POST",
        url : "/webservice/project/get-project-type-by-id",
        handler : getProjectTypeById
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-type",
        handler : editProjectType
    },
    {
        method : "POST",
        url : "/webservice/project/add-project-category",
        handler : addProjectCategory
    },
    {
        method : "POST",
        url : "/webservice/project/add-no-charge-type",
        handler : addNoChargeType
    },
    {
        method : "POST",
        url : "/webservice/project/get-project-category-by-id",
        handler : getProjectCategoryById
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-category",
        handler : editProjectCategory
    },
    {
        method : "POST",
        url : "/webservice/project/update-no-charge-type",
        handler : editNoChargeType
    },
    {
        method : "POST",
        url : "/webservice/project/delete-project-category",
        handler : deleteProjectCategory
    },
    {
        method : "POST",
        url : "/webservice/project/delete-no-charge-type",
        handler : deleteNoChargeType
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-status",
        handler : updatateProjectStatus
    },
    {
        method : "POST",
        url : "/webservice/project/update-job-hold-status",
        handler : updatateJobHoldStatus
    },
    {
        method : "POST",
        url : "/webservice/project/update-design-order-job-hold-status",
        handler : updatateDesignOrderJobHoldStatus
    },
    {
        method : "POST",
        url : "/webservice/project/add-project-task",
        handler :addProjectTask
    },  {
        method : "POST",
        url : "/webservice/project/view-project-task",
        handler :viewProjectTask
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-task",
        handler :updateProjectTask
    },
    {
        method : "POST",
        url : "/webservice/project/update-task-workflow",
        handler :updateTaskWorkflowByOrderProduct
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-task-status",
        handler :updatateProjectTaskStatus
    },
    {
        method : "POST",
        url : "/webservice/project/check-project-completed",
        handler :checkAllProjectTasksCompletedStatus
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-sub-task-status",
        handler :updatateProjectSubTaskStatus
    },
    {
        method : "POST",
        url : "/webservice/project/check-ready-for-installation",
        handler :checkReadyForInstallationStatus
    },
    {
        method : "POST",
        url : "/webservice/project/add-project-member",
        handler :addProjectMember
    },
    {
        method : "POST",
        url : "/webservice/project/assign-new-members-to-subtasks-by-skill",
        handler :assignNewMembersToSubtasksBySkill
    },
    {
        method : "POST",
        url : "/webservice/design-order-job/add-member",
        handler :addDesignOrderJobMember
    },
    {
        method : "POST",
        url : "/webservice/project/add-project-sub-task",
        handler :addProjectSubTask
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-all-project-sub-task",
        handler :viewAllProjectSubTask
    },
    {
        method : "POST",
        url : "/webservice/project/view-project-sub-task",
        handler :viewSubTask
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-sub-task",
        handler :updateProjectSubTask
    },
    {
        method : "POST",
        url : "/webservice/project/delete-project-type",
        handler : deleteProjectType
    },
    {
        method : "POST",
        url : "/webservice/project/delete-project-task",
        handler : deleteProjectTask
    },
    {
        method : "POST",
        url : "/webservice/project/delete-project-sub-task",
        handler : deleteProjectSubTask
    },
    {
        method : "POST",
        url : "/webservice/project/delete-project-team-member",
        handler : deleteProjectTaskMember
    },
    {
        method : "POST",
        url : "/webservice/design-order-job/delete-task",
        handler : deleteDesignOrderProjectTask
    },
    {
        method : "POST",
        url : "/webservice/design-order-job/delete-sub-task",
        handler : deleteDesignOrderProjectSubTask
    },
    {
        method : "POST",
        url : "/webservice/design-order-job/delete-team-member",
        handler : deleteDesignOrderProjectTaskMember
    },
    {
        method : "POST",
        url : "/webservice/project/add-job-cost",
        handler : addJobCost
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-all-job-cost",
        handler : fetchAllJobCostByProjectId
    },
    {
        method : "POST",
        url : "/webservice/project/view-added-material-in-task",
        handler : viewAddedMaterialInTask
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-data-for-pay-out",
        handler : fetchDataForPayOut
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-all-project-task-by-id",
        handler : fetchAllProjectTaskById
    },
   
    {
        method : "POST",
        url : "/webservice/project/add-pay-out",
        handler : addPayOut
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-all-pay-out",
        handler : fetchAllPayOut
    },
    {
        method : "POST",
        url : "/webservice/project/get-pay-out-by-id",
        handler : getPayOutById
    },
    {
        method : "POST",
        url : "/webservice/project/update-pay-out",
        handler : updatePayOut
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-new-post",
        handler : addProjectPost
    },
    {
        method : "POST",
        url : "/webservice/project-task/post-like",
        handler : LikeProjectPost
    },
    {
        method : "POST",
        url : "/webservice/project-task/post-starred",
        handler : starredPost
    },
    {
        method : "POST",
        url : "/webservice/project-task/delete-post",
        handler : deleteProjectPost
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-comments",
        handler : addprojectPostComments
    },
    {
        method : "POST",
        url : "/webservice/project-task/post-by-id",
        handler : getprojectPostByid
    },
    {
        method : "POST",
        url : "/webservice/project-task/edit-post",
        handler : editProjectPost
    },
    {
        method : "POST",
        url : "/webservice/project-task/post-comment-like",
        handler : likeProjectPostComments
    },
    {
        method : "POST",
        url : "/webservice/project-task/post-comment-delete",
        handler : deletProjectPostComment
    },
    {
        method : "POST",
        url : "/webservice/project-task/view-comments",
        handler : viewAllPostComments
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-attachment",
        handler : addProjectTaskAttachments
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-all-attachment",
        handler : fetchProjectTaskAttachments
    },
    {
        method : "POST",
        url : "/webservice/project-task/delete-attachment",
        handler : deleteProjectTaskAttachments
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-project-attachment",
        handler : addProjectAttachments
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-all-project-attachment",
        handler : fetchProjectAttachments
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-project-attachments",
        handler : fetchAllProjectAttachments
    },
    {
        method : "POST",
        url : "/webservice/project-task/delete-project-attachment",
        handler : deleteProjectAttachments
    },
    {
        method : "POST",
        url : "/webservice/project/add-attachment",
        handler : addProjectPostAttachments,
    },
    {
        method : "POST",
        url : "/webservice/settings/project-statistics",
        handler :projectStatistics,
    },
    {
        method : "POST",
        url : "/webservice/settings/project-statistics-optimized",
        handler :projectStatisticsOptimized,
    },
    {
        method : "POST",
        url : "/webservice/settings/project-upcoming",
        handler :UpcomingprojectStatistics,
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-progress",
        handler :updateProjectCompletion,
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-task-progress",
        handler :updateProjectTaskCompletion,
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-sub-task-progress",
        handler :updateProjectSubTaskCompletion,
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-by-client-id",
        handler :fetchProjectByClientId,
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-by-team-id",
        handler :fetchprojectsByTeamId,
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-staff-task-timelog",
        handler :addStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-installer-task-timelog",
        handler :addInstallerTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-staff-task-timelog-driver-and-installer",
        handler :addStaffTaskTimelogDriverAndInstaller,
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-manual-staff-task-timelog",
        handler :addManualStaffTaskTimelog
    },
    {
        method : "POST",
        url : "/webservice/design-task/add-manual-staff-task-timelog",
        handler :handleDesignOrderTimelogPayout
    },
    {
        method : "POST",
        url : "/webservice/project-task/delete-manual-staff-task-timelog",
        handler :deleteManualStaffTaskTimelog
    },
    {
        method : "POST",
        url : "/webservice/design-task/delete-manual-staff-task-timelog",
        handler :deleteManualStaffDesignTaskTimelog
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-time-sheet",
        handler :addTimesheet,
    },
    {
        method : "POST",
        url : "/webservice/project-task/update-staff-task-timelog",
        handler :updateStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/update-installer-task-timelog",
        handler :updateInstallerTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/update-staff-task-timelog-driver-and-installer",
        handler :updateStaffTaskTimelogDriverAndInstaller,
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-staff-task-timelog",
        handler :fetchStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-all-staff-task-timelog",
        handler :fetchAllStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-clockedIn-staff-task-timelog",
        handler :fetchClockedInStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project/save-job-card-order",
        handler :saveJobCardOrder,
    },
    {
        method : "POST",
        url : "/webservice/project/update-material-in-jobcost",
        handler :updateMaterialInJobcost,
    },
    {
        method : "POST",
        url : "/webservice/project/update-product-in-jobcost",
        handler :updateProductInJobcost,
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-design-order-jobs",
        handler :getAllDesignOrderJobs,
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-design-order-jobs-calendar",
        handler :getAllDesignOrderJobsCalendar,
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-design-order-jobs-count",
        handler :getAllDesignOrderJobsCount,
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-estimate-jobs",
        handler :getAllEstimateJobs,
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-estimate-jobs-count",
        handler :getAllEstimateJobsCount,
    },
    {
        method : "POST",
        url : "/webservice/project/get-deisgn-order-project-by-id",
        handler : getDesignOrderProjectById
    },
    {
        method : "POST",
        url : "/webservice/project/get-design-order-project-task-by-id",
        handler : getDesignOrderProjectTaskById
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-all-design-order-project-sub-task",
        handler :viewAllDesignOrderProjectSubTask
    },
    {
        method : "POST",
        url : "/webservice/project/view-project-design-order-sub-task",
        handler :viewDesignOrderSubTask
    },
    {
        method : "POST",
        url : "/webservice/design-order-job/add-attachment",
        handler : addDesignOrderAttachments
    },
    {
        method : "POST",
        url : "/webservice/design-order-job/fetch-all-attachment",
        handler : fetchDesignOrderAttachments
    },
    {
        method : "POST",
        url : "/webservice/design-order-job/delete-attachment",
        handler : deleteDesignOrderAttachments
    },
    {
        method : "POST",
        url : "/webservice/project/update-project-design-order-sub-task-status",
        handler :updatateDesignOrderProjectSubTaskStatus
    },
    {
        method : "POST",
        url : "/webservice/project-task/add-design-order-staff-task-timelog",
        handler :addDesignOrderStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-clockedIn-design-order-staff-task-timelog",
        handler :fetchClockedInDesignOrderStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/update-design-order-staff-task-timelog",
        handler :updateDesignOrderStaffTaskTimelog,
    },
    {
        method : "POST",
        url : "/webservice/project-task/approve-manual-staff-task-timelog",
        handler :approveManualStaffTaskTimelog
    },
    {
        method : "POST",
        url : "/webservice/design-task/approve-manual-staff-task-timelog",
        handler :approveDesignManualStaffTaskTimelog
    },
    {
        method : "POST",
        url : "/webservice/project-task/upload-receipt",
        handler :uploadReceiptToQuickbook
    },
    {
        method : "POST",
        url : "/webservice/project-task/fetch-all-designs-from-task",
        handler :fetchAllDesignsFromTask
    },
    {
    method: 'POST',
    url: '/webservice/jobs/jobs-tabs-count',
    handler: getAllJobsTabCount,
    },
    {
    method: 'POST',
    url: '/webservice/jobs/reduce-tabs-count',
    handler: reduceJobsTabCount,
    },
    {
    method: 'POST',
    url: '/webservice/jobs/get-project-details-by-id',
    handler: getProjectStatusById,
    },
    {
    method: 'POST',
    url: '/webservice/project/fetch-all-service-by-task',
    handler: fetchServiceByTask,
    },
    {
    method: 'POST',
    url: '/webservice/project/job-cost-delete-item',
    handler: updateJobCostStatusController,
    },
        {
        method : "POST",
        url : "/webservice/project/add-sticky-note",
        handler :addStickyNote,
    },
    {
        method : "POST",
        url : "/webservice/project/edit-sticky-note",
        handler :editStickyNote,
    },
    {
        method : "POST",
        url : "/webservice/project/get-sticky-note",
        handler :fetchStickyNote,
    },
    {
        method : "POST",
        url : "/webservice/project/get-job-cost-logs",
        handler :fetchJobCostLogsController,
    },
        {
        method : "POST",
        url : "/webservice/project/get-all-users-by-tasks",
        handler :fetchAllUsersByTask,
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-users-by-time-and-material",
        handler :fetchAllUsersByTimeAndMaterial,
    },
    {
        method : "POST",
        url : "/webservice/project/delete-staff-task-timelogs-by-service",
        handler : deleteStaffTaskTimelogsByServiceId
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-users-by-service",
        handler :getTeamMembersByServiceId
    },
    {
        method : "POST",
        url : "/webservice/project/get-all-team-members-for-email",
        handler :getAllTeamMembersForEmail
    },
    {
        method : "POST",
        url : "/webservice/stopwatch/start",
        handler : startStopwatch
    },
    {
        method : "POST",
        url : "/webservice/stopwatch/stop",
        handler : stopStopwatch
    },
    {
        method : "POST",
        url : "/webservice/stopwatch/clear",
        handler : clearStopwatch
    },
    {
        method : "POST",
        url : "/webservice/stopwatch/fetch",
        handler : fetchStopwatchData
    },
    {
        method : "POST",
        url : "/webservice/stopwatch/update",
        handler : updateStopwatchEntry
    },
    {
        method : "POST",
        url : "/webservice/project/fetch-all-future-installations",
        handler : fetchAllFutureInstallations
    },
];
module.exports = projectRoutes;