"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.NotificationController = void 0;
const api_1 = require("@hed-hog/api");
const api_pagination_1 = require("@hed-hog/api-pagination");
const common_1 = require("@nestjs/common");
const create_notification_dto_1 = require("./dto/create-notification.dto");
const update_progress_dto_1 = require("./dto/update-progress.dto");
const notification_service_1 = require("./notification.service");
let NotificationController = class NotificationController {
    constructor(notificationService) {
        this.notificationService = notificationService;
    }
    async list({ id }, paginationParams) {
        return this.notificationService.list(id, paginationParams);
    }
    async stream({ id }, req, res) {
        return this.notificationService.stream(id, req, res);
    }
    async unreadCount({ id }) {
        return this.notificationService.unreadCount(id);
    }
    async markAllRead({ id }) {
        return this.notificationService.markAllRead(id);
    }
    async markRead({ id: userId }, id) {
        return this.notificationService.markRead(userId, id);
    }
    async updateProgress({ id: userId }, id, dto) {
        return this.notificationService.updateProgress(userId, id, dto);
    }
    async deleteAll({ id }) {
        return this.notificationService.deleteAll(id);
    }
    async delete({ id: userId }, id) {
        return this.notificationService.delete(userId, id);
    }
    async create(data) {
        return this.notificationService.create(data);
    }
};
exports.NotificationController = NotificationController;
__decorate([
    (0, common_1.Get)(),
    __param(0, (0, api_1.User)()),
    __param(1, (0, api_pagination_1.Pagination)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "list", null);
__decorate([
    (0, common_1.Get)('stream'),
    __param(0, (0, api_1.User)()),
    __param(1, (0, common_1.Req)()),
    __param(2, (0, common_1.Res)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object, Object]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "stream", null);
__decorate([
    (0, common_1.Get)('unread-count'),
    __param(0, (0, api_1.User)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "unreadCount", null);
__decorate([
    (0, common_1.Patch)('read-all'),
    __param(0, (0, api_1.User)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "markAllRead", null);
__decorate([
    (0, common_1.Patch)(':id/read'),
    __param(0, (0, api_1.User)()),
    __param(1, (0, common_1.Param)('id', common_1.ParseIntPipe)),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Number]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "markRead", null);
__decorate([
    (0, common_1.Patch)(':id/progress'),
    __param(0, (0, api_1.User)()),
    __param(1, (0, common_1.Param)('id', common_1.ParseIntPipe)),
    __param(2, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Number, update_progress_dto_1.UpdateProgressDto]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "updateProgress", null);
__decorate([
    (0, common_1.Delete)(),
    __param(0, (0, api_1.User)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "deleteAll", null);
__decorate([
    (0, common_1.Delete)(':id'),
    __param(0, (0, api_1.User)()),
    __param(1, (0, common_1.Param)('id', common_1.ParseIntPipe)),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Number]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "delete", null);
__decorate([
    (0, common_1.Post)(),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [create_notification_dto_1.CreateNotificationDto]),
    __metadata("design:returntype", Promise)
], NotificationController.prototype, "create", null);
exports.NotificationController = NotificationController = __decorate([
    (0, api_1.Role)(),
    (0, common_1.Controller)('notification'),
    __metadata("design:paramtypes", [notification_service_1.NotificationService])
], NotificationController);
//# sourceMappingURL=notification.controller.js.map