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