"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.ChatterMessageController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const platform_express_1 = require("@nestjs/platform-express");
const swagger_1 = require("@nestjs/swagger");
const chatter_message_service_1 = require("../services/chatter-message.service");
const create_chatter_message_dto_1 = require("../dtos/create-chatter-message.dto");
const post_chatter_message_dto_1 = require("../dtos/post-chatter-message.dto");
const update_chatter_note_message_dto_1 = require("../dtos/update-chatter-note-message.dto");
const public_decorator_1 = require("../decorators/public.decorator");
var ShowSoftDeleted;
(function (ShowSoftDeleted) {
    ShowSoftDeleted["INCLUSIVE"] = "inclusive";
    ShowSoftDeleted["EXCLUSIVE"] = "exclusive";
})(ShowSoftDeleted || (ShowSoftDeleted = {}));
let ChatterMessageController = class ChatterMessageController {
    constructor(service) {
        this.service = service;
    }
    create(createDto, files) {
        return this.service.create(createDto, files);
    }
    async getChatterMessages(entityId, entityName, query) {
        return this.service.getChatterMessages(entityId, entityName, query);
    }
    async findMany(query) {
        return this.service.find(query);
    }
    async findOne(id, query) {
        return this.service.findOne(+id, query);
    }
    async postMessage(postDto, files) {
        return this.service.postMessage(postDto, files);
    }
    async markCompleted(id) {
        return this.service.markCompleted(+id);
    }
    async updateCustomNoteMessage(id, updateDto, files) {
        return this.service.updateCustomNoteMessage(+id, updateDto, files);
    }
};
exports.ChatterMessageController = ChatterMessageController;
__decorate([
    (0, swagger_1.ApiBearerAuth)("jwt"),
    (0, common_1.Post)(),
    (0, common_1.UseInterceptors)((0, platform_express_1.AnyFilesInterceptor)()),
    openapi.ApiResponse({ status: 201, type: require("../entities/chatter-message.entity").ChatterMessage }),
    __param(0, (0, common_1.Body)()),
    __param(1, (0, common_1.UploadedFiles)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [create_chatter_message_dto_1.CreateChatterMessageDto, Array]),
    __metadata("design:returntype", void 0)
], ChatterMessageController.prototype, "create", null);
__decorate([
    (0, public_decorator_1.Public)(),
    (0, common_1.Get)('/getChatterMessages/:entityId/:entityName'),
    (0, swagger_1.ApiQuery)({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted }),
    (0, swagger_1.ApiQuery)({ name: 'limit', required: false, type: Number }),
    (0, swagger_1.ApiQuery)({ name: 'offset', required: false, type: Number }),
    (0, swagger_1.ApiQuery)({ name: 'fields', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'sort', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'groupBy', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'populate', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'populateMedia', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'filters', required: false, type: Array }),
    openapi.ApiResponse({ status: 200 }),
    __param(0, (0, common_1.Param)('entityId')),
    __param(1, (0, common_1.Param)('entityName')),
    __param(2, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, String, Object]),
    __metadata("design:returntype", Promise)
], ChatterMessageController.prototype, "getChatterMessages", null);
__decorate([
    (0, swagger_1.ApiBearerAuth)("jwt"),
    (0, swagger_1.ApiQuery)({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted }),
    (0, swagger_1.ApiQuery)({ name: 'limit', required: false, type: Number }),
    (0, swagger_1.ApiQuery)({ name: 'offset', required: false, type: Number }),
    (0, swagger_1.ApiQuery)({ name: 'fields', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'sort', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'groupBy', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'populate', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'populateMedia', required: false, type: Array }),
    (0, swagger_1.ApiQuery)({ name: 'filters', required: false, type: Array }),
    (0, common_1.Get)(),
    openapi.ApiResponse({ status: 200, type: Object }),
    __param(0, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], ChatterMessageController.prototype, "findMany", null);
__decorate([
    (0, swagger_1.ApiBearerAuth)("jwt"),
    (0, common_1.Get)(':id'),
    openapi.ApiResponse({ status: 200, type: require("../entities/chatter-message.entity").ChatterMessage }),
    __param(0, (0, common_1.Param)('id')),
    __param(1, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Object]),
    __metadata("design:returntype", Promise)
], ChatterMessageController.prototype, "findOne", null);
__decorate([
    (0, swagger_1.ApiBearerAuth)("jwt"),
    (0, common_1.Post)('post'),
    (0, common_1.UseInterceptors)((0, platform_express_1.AnyFilesInterceptor)()),
    openapi.ApiResponse({ status: 201, type: require("../entities/chatter-message.entity").ChatterMessage }),
    __param(0, (0, common_1.Body)()),
    __param(1, (0, common_1.UploadedFiles)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [post_chatter_message_dto_1.PostChatterMessageDto,
        Array]),
    __metadata("design:returntype", Promise)
], ChatterMessageController.prototype, "postMessage", null);
__decorate([
    (0, swagger_1.ApiBearerAuth)("jwt"),
    (0, common_1.Patch)(':id/complete'),
    openapi.ApiResponse({ status: 200, type: require("../entities/chatter-message.entity").ChatterMessage }),
    __param(0, (0, common_1.Param)('id')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", Promise)
], ChatterMessageController.prototype, "markCompleted", null);
__decorate([
    (0, swagger_1.ApiBearerAuth)("jwt"),
    (0, common_1.Patch)(':id/note'),
    (0, common_1.UseInterceptors)((0, platform_express_1.AnyFilesInterceptor)()),
    openapi.ApiResponse({ status: 200, type: require("../entities/chatter-message.entity").ChatterMessage }),
    __param(0, (0, common_1.Param)('id')),
    __param(1, (0, common_1.Body)()),
    __param(2, (0, common_1.UploadedFiles)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, update_chatter_note_message_dto_1.UpdateChatterNoteMessageDto,
        Array]),
    __metadata("design:returntype", Promise)
], ChatterMessageController.prototype, "updateCustomNoteMessage", null);
exports.ChatterMessageController = ChatterMessageController = __decorate([
    (0, swagger_1.ApiTags)('Solid Core'),
    (0, common_1.Controller)('chatter-message'),
    __metadata("design:paramtypes", [chatter_message_service_1.ChatterMessageService])
], ChatterMessageController);
//# sourceMappingURL=chatter-message.controller.js.map