"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteScheduleJob = void 0;
const logger_1 = __importDefault(require("../../../logger"));
const scheduleJobsService_1 = require("../../services/scheduleJobsService");
const deleteScheduleJob = async (req, res) => {
    try {
        const { scheduleJobId } = req.params;
        const { projectId } = req.query;
        if (!scheduleJobId || !projectId) {
            res.status(400).json({
                success: false,
                message: 'Missing required parameters: scheduleJobId, projectId',
            });
            return;
        }
        await scheduleJobsService_1.scheduleJobsService.deleteScheduleJob(scheduleJobId, projectId);
        res.json({
            success: true,
            message: 'Schedule job deleted successfully',
        });
    }
    catch (error) {
        logger_1.default.error(`Error deleting schedule job: ${error}`);
        res.status(500).json({
            success: false,
            message: 'Failed to delete schedule job',
            error: error.message,
        });
    }
};
exports.deleteScheduleJob = deleteScheduleJob;
//# sourceMappingURL=delete-schedule-job.js.map