"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getScheduleJobEvaluations = void 0;
const logger_1 = __importDefault(require("../../../logger"));
const scheduleJobsService_1 = require("../../services/scheduleJobsService");
const getScheduleJobEvaluations = async (req, res) => {
    try {
        const { scheduleJobId } = req.params;
        const { page = 1, limit = 10 } = req.query;
        if (!scheduleJobId) {
            res.status(400).json({
                success: false,
                message: 'Missing required parameter: scheduleJobId',
            });
            return;
        }
        const result = await scheduleJobsService_1.scheduleJobsService.getScheduleJobEvaluations(scheduleJobId, Number(page), Number(limit));
        res.json({
            success: true,
            data: result.data,
            pagination: result.pagination,
        });
    }
    catch (error) {
        logger_1.default.error(`Error fetching schedule job evaluations: ${error}`);
        res.status(500).json({
            success: false,
            message: 'Failed to fetch schedule job evaluations',
            error: error.message,
        });
    }
};
exports.getScheduleJobEvaluations = getScheduleJobEvaluations;
//# sourceMappingURL=get-schedule-job-evaluations.js.map