"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportsController = void 0;
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const reports_service_1 = require("./reports.service");
const report_query_dto_1 = require("./dto/report-query.dto");
const report_response_dto_1 = require("./dto/report-response.dto");
const current_user_decorator_1 = require("../../common/decorators/current-user.decorator");
const group_member_guard_1 = require("../../common/guards/group-member.guard");
let ReportsController = class ReportsController {
    constructor(reportsService) {
        this.reportsService = reportsService;
    }
    getMonthlyReport(user, query) {
        return this.reportsService.getMonthlyReport(user.id, query);
    }
    getCategoryBreakdown(user, query) {
        return this.reportsService.getCategoryBreakdown(user.id, query);
    }
    getGroupReport(groupId, user) {
        return this.reportsService.getGroupReport(groupId, user.id);
    }
};
exports.ReportsController = ReportsController;
__decorate([
    (0, common_1.Get)('reports/monthly'),
    (0, swagger_1.ApiOperation)({ summary: 'Monthly spending over the past N months' }),
    (0, swagger_1.ApiResponse)({ status: 200, type: [report_response_dto_1.MonthlyReportEntryDto] }),
    __param(0, (0, current_user_decorator_1.CurrentUser)()),
    __param(1, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, report_query_dto_1.MonthlyReportQueryDto]),
    __metadata("design:returntype", Promise)
], ReportsController.prototype, "getMonthlyReport", null);
__decorate([
    (0, common_1.Get)('reports/categories'),
    (0, swagger_1.ApiOperation)({ summary: 'Expense breakdown by category' }),
    (0, swagger_1.ApiResponse)({ status: 200, type: [report_response_dto_1.CategoryBreakdownEntryDto] }),
    __param(0, (0, current_user_decorator_1.CurrentUser)()),
    __param(1, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, report_query_dto_1.CategoryReportQueryDto]),
    __metadata("design:returntype", Promise)
], ReportsController.prototype, "getCategoryBreakdown", null);
__decorate([
    (0, common_1.Get)('groups/:id/reports'),
    (0, common_1.UseGuards)(group_member_guard_1.GroupMemberGuard),
    (0, swagger_1.ApiParam)({ name: 'id', description: 'Group ID' }),
    (0, swagger_1.ApiOperation)({ summary: 'Full spending report for a specific group' }),
    (0, swagger_1.ApiResponse)({ status: 200, type: report_response_dto_1.GroupReportDto }),
    __param(0, (0, common_1.Param)('id')),
    __param(1, (0, current_user_decorator_1.CurrentUser)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Object]),
    __metadata("design:returntype", Promise)
], ReportsController.prototype, "getGroupReport", null);
exports.ReportsController = ReportsController = __decorate([
    (0, swagger_1.ApiTags)('Reports'),
    (0, swagger_1.ApiBearerAuth)(),
    (0, common_1.Controller)({ version: '1' }),
    __metadata("design:paramtypes", [reports_service_1.ReportsService])
], ReportsController);
//# sourceMappingURL=reports.controller.js.map