"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.ScreenController = void 0;
const api_pagination_1 = require("@hed-hog/api-pagination");
const common_1 = require("@nestjs/common");
const delete_dto_1 = require("../dto/delete.dto");
const update_ids_dto_1 = require("../dto/update-ids.dto");
const api_locale_1 = require("@hed-hog/api-locale");
const api_1 = require("@hed-hog/api");
const create_dto_1 = require("./dto/create.dto");
const update_dto_1 = require("./dto/update.dto");
const screen_service_1 = require("./screen.service");
let ScreenController = class ScreenController {
    constructor(screenService) {
        this.screenService = screenService;
    }
    async list(paginationParams, locale) {
        return this.screenService.list(locale, paginationParams);
    }
    async listRoles(screenId, paginationParams, locale) {
        return this.screenService.listRoles(locale, screenId, paginationParams);
    }
    async listRoutes(screenId, paginationParams) {
        return this.screenService.listRoutes(screenId, paginationParams);
    }
    async updateRoles(screenId, data) {
        return this.screenService.updateRoles(screenId, data);
    }
    async updateRoutes(screenId, data) {
        return this.screenService.updateRoutes(screenId, data);
    }
    async show(screenId) {
        return this.screenService.get(screenId);
    }
    create(data) {
        return this.screenService.create(data);
    }
    async update(screenId, data) {
        return this.screenService.update({
            id: screenId,
            data,
        });
    }
    async delete(data) {
        return this.screenService.delete(data);
    }
};
exports.ScreenController = ScreenController;
__decorate([
    (0, common_1.Get)(),
    __param(0, (0, api_pagination_1.Pagination)()),
    __param(1, (0, api_locale_1.Locale)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "list", null);
__decorate([
    (0, common_1.Get)(':screenId/role'),
    __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
    __param(1, (0, api_pagination_1.Pagination)()),
    __param(2, (0, api_locale_1.Locale)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, Object, Object]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "listRoles", null);
__decorate([
    (0, common_1.Get)(':screenId/route'),
    __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
    __param(1, (0, api_pagination_1.Pagination)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, Object]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "listRoutes", null);
__decorate([
    (0, common_1.Patch)(':screenId/role'),
    __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, update_ids_dto_1.UpdateIdsDTO]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "updateRoles", null);
__decorate([
    (0, common_1.Patch)(':screenId/route'),
    __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, update_ids_dto_1.UpdateIdsDTO]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "updateRoutes", null);
__decorate([
    (0, common_1.Get)(':screenId'),
    __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "show", null);
__decorate([
    (0, common_1.Post)(),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [create_dto_1.CreateDTO]),
    __metadata("design:returntype", void 0)
], ScreenController.prototype, "create", null);
__decorate([
    (0, common_1.Patch)(':screenId'),
    __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "update", null);
__decorate([
    (0, common_1.Delete)(),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
    __metadata("design:returntype", Promise)
], ScreenController.prototype, "delete", null);
exports.ScreenController = ScreenController = __decorate([
    (0, api_1.Role)(),
    (0, common_1.Controller)('screen'),
    __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => screen_service_1.ScreenService))),
    __metadata("design:paramtypes", [screen_service_1.ScreenService])
], ScreenController);
//# sourceMappingURL=screen.controller.js.map