"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueueResponseDto = exports.QueueStatisticsDto = exports.QueueJobResponseDto = exports.QueueJobSearchDto = exports.QueueDeleteDto = exports.QueueUpdateDto = exports.QueueCommandDto = exports.QueueNameParamDto = exports.QueueStatisticsSchema = void 0;
const openapi = require("@nestjs/swagger");
const nestjs_zod_1 = require("nestjs-zod");
const decorators_1 = require("../decorators");
const enum_1 = require("../enum");
const zod_1 = __importDefault(require("zod"));
const QueueNameParamSchema = zod_1.default
    .object({
    name: enum_1.QueueNameSchema,
})
    .meta({ id: 'QueueNameParamDto' });
const QueueCommandSchemaDto = zod_1.default
    .object({
    command: enum_1.QueueCommandSchema,
    force: zod_1.default.boolean().optional().describe('Force the command execution (if applicable)'),
})
    .meta({ id: 'QueueCommandDto' });
const QueueUpdateSchema = zod_1.default
    .object({
    isPaused: zod_1.default.boolean().optional().describe('Whether to pause the queue'),
})
    .meta({ id: 'QueueUpdateDto' });
const QueueDeleteSchema = zod_1.default
    .object({
    failed: zod_1.default
        .boolean()
        .optional()
        .describe('If true, will also remove failed jobs from the queue.')
        .meta(new decorators_1.HistoryBuilder().added('v2.4.0').alpha('v2.4.0').getExtensions()),
})
    .meta({ id: 'QueueDeleteDto' });
const QueueJobSearchSchema = zod_1.default
    .object({
    status: zod_1.default.array(enum_1.QueueJobStatusSchema).optional().describe('Filter jobs by status'),
})
    .meta({ id: 'QueueJobSearchDto' });
const QueueJobResponseSchema = zod_1.default
    .object({
    id: zod_1.default.string().optional().describe('Job ID'),
    name: enum_1.JobNameSchema,
    data: zod_1.default.record(zod_1.default.string(), zod_1.default.unknown()).describe('Job data payload'),
    timestamp: zod_1.default.int().describe('Job creation timestamp'),
})
    .meta({ id: 'QueueJobResponseDto' });
exports.QueueStatisticsSchema = zod_1.default
    .object({
    active: zod_1.default.int().describe('Number of active jobs'),
    completed: zod_1.default.int().describe('Number of completed jobs'),
    failed: zod_1.default.int().describe('Number of failed jobs'),
    delayed: zod_1.default.int().describe('Number of delayed jobs'),
    waiting: zod_1.default.int().describe('Number of waiting jobs'),
    paused: zod_1.default.int().describe('Number of paused jobs'),
})
    .meta({ id: 'QueueStatisticsDto' });
const QueueResponseSchema = zod_1.default
    .object({
    name: enum_1.QueueNameSchema,
    isPaused: zod_1.default.boolean().describe('Whether the queue is paused'),
    statistics: exports.QueueStatisticsSchema,
})
    .meta({ id: 'QueueResponseDto' });
class QueueNameParamDto extends (0, nestjs_zod_1.createZodDto)(QueueNameParamSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueNameParamDto = QueueNameParamDto;
class QueueCommandDto extends (0, nestjs_zod_1.createZodDto)(QueueCommandSchemaDto) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueCommandDto = QueueCommandDto;
class QueueUpdateDto extends (0, nestjs_zod_1.createZodDto)(QueueUpdateSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueUpdateDto = QueueUpdateDto;
class QueueDeleteDto extends (0, nestjs_zod_1.createZodDto)(QueueDeleteSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueDeleteDto = QueueDeleteDto;
class QueueJobSearchDto extends (0, nestjs_zod_1.createZodDto)(QueueJobSearchSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueJobSearchDto = QueueJobSearchDto;
class QueueJobResponseDto extends (0, nestjs_zod_1.createZodDto)(QueueJobResponseSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueJobResponseDto = QueueJobResponseDto;
class QueueStatisticsDto extends (0, nestjs_zod_1.createZodDto)(exports.QueueStatisticsSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueStatisticsDto = QueueStatisticsDto;
class QueueResponseDto extends (0, nestjs_zod_1.createZodDto)(QueueResponseSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.QueueResponseDto = QueueResponseDto;
//# sourceMappingURL=queue.dto.js.map