"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CalendarHeatmapResponseDto = exports.CalendarHeatmapDto = void 0;
const openapi = require("@nestjs/swagger");
const nestjs_zod_1 = require("nestjs-zod");
const enum_1 = require("../enum");
const validation_1 = require("../validation");
const zod_1 = __importDefault(require("zod"));
const CalendarHeatmapTypeSchema = zod_1.default
    .enum(enum_1.CalendarHeatmapType)
    .describe('Type of calendar heatmap')
    .meta({ id: 'CalendarHeatmapType' });
const CalendarHeatmapSchema = zod_1.default
    .object({
    from: validation_1.isoDateToDate.optional().describe('Start date in UTC'),
    to: validation_1.isoDateToDate.optional().describe('End date in UTC'),
    type: CalendarHeatmapTypeSchema.optional().default(enum_1.CalendarHeatmapType.Upload),
})
    .refine((dto) => !dto.from || !dto.to || dto.from <= dto.to, { message: 'from must be before to', path: ['from'] })
    .meta({ id: 'CalendarHeatmapDto' });
class CalendarHeatmapDto extends (0, nestjs_zod_1.createZodDto)(CalendarHeatmapSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.CalendarHeatmapDto = CalendarHeatmapDto;
const CalendarHeatmapResponseSchema = zod_1.default
    .object({
    from: zod_1.default.string().describe('Start date in UTC').meta({ example: '2024-01-01' }),
    to: zod_1.default.string().describe('End date in UTC').meta({ example: '2024-12-31' }),
    series: zod_1.default.array(zod_1.default.object({
        date: zod_1.default.string().describe('Date in UTC').meta({ example: '2024-01-01' }),
        count: zod_1.default.int().nonnegative().describe('Activity count'),
    })),
    totalCount: zod_1.default.int().nonnegative().describe('Total activity count over the period'),
})
    .meta({ id: 'CalendarHeatmapResponseDto' });
class CalendarHeatmapResponseDto extends (0, nestjs_zod_1.createZodDto)(CalendarHeatmapResponseSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.CalendarHeatmapResponseDto = CalendarHeatmapResponseDto;
//# sourceMappingURL=calendar-heatmap.dto.js.map