"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getScheduleJobDetails = void 0;
const logger_1 = __importDefault(require("../../../logger"));
const scheduleJobsService_1 = require("../../services/scheduleJobsService");
const getScheduleJobDetails = 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;
        }
        const scheduleJob = await scheduleJobsService_1.scheduleJobsService.getScheduleJobById(scheduleJobId, projectId);
        if (!scheduleJob) {
            res.status(404).json({
                success: false,
                message: 'Schedule job not found',
            });
            return;
        }
        res.json({
            success: true,
            data: scheduleJob,
        });
    }
    catch (error) {
        logger_1.default.error(`Error fetching schedule job details: ${error}`);
        res.status(500).json({
            success: false,
            message: 'Failed to fetch schedule job details',
            error: error.message,
        });
    }
};
exports.getScheduleJobDetails = getScheduleJobDetails;
//# sourceMappingURL=get-schedule-job-details.js.map