"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.SettingsController = void 0;
const common_1 = require("@nestjs/common");
const passport_1 = require("@nestjs/passport");
const roles_decorator_1 = require("../auth/decorators/roles.decorator");
const roles_guard_1 = require("../auth/guards/roles.guard");
const bootstrap_table_request_dto_1 = require("../commons/dto/bootstrap-table-request.dto");
const create_detail_dto_1 = require("./dto/create-detail.dto");
const create_header_dto_1 = require("./dto/create-header.dto");
const update_detail_dto_1 = require("./dto/update-detail.dto");
const update_header_dto_1 = require("./dto/update-header.dto");
const settings_service_1 = require("./settings.service");
let SettingsController = class SettingsController {
    constructor(service) {
        this.service = service;
    }
    createHeader(dto) {
        return this.service.createHeader(dto);
    }
    findAllHeaders(query) {
        return this.service.findAllHeaders(query);
    }
    findAllLovLm(query) {
        console.log('Fetching LOV LM with query:', query);
        return this.service.findAllLovLm(query);
    }
    findAllLovJewelry(query) {
        console.log('Fetching LOV Jewelry with query:', query);
        return this.service.findAllLovJewelry(query);
    }
    findAllLovReferralSource(query) {
        console.log('Fetching LOV referral source with query:', query);
        return this.service.findAllLovReferralSource(query);
    }
    findAllLovCancellationReason(query) {
        console.log('Fetching LOV Cancellation Reason with query:', query);
        return this.service.findAllLovCancellationReason(query);
    }
    findOneHeader(id) {
        return this.service.findOneHeader(id);
    }
    updateHeader(id, dto) {
        return this.service.updateHeader(id, dto);
    }
    removeHeader(id) {
        return this.service.removeHeader(id);
    }
    createDetail(dto) {
        return this.service.createDetail(dto);
    }
    findAllDetails(query) {
        return this.service.findAllDetails(query);
    }
    findOneDetail(id) {
        return this.service.findOneDetail(id);
    }
    updateDetail(id, dto) {
        return this.service.updateDetail(id, dto);
    }
    removeDetail(id) {
        return this.service.removeDetail(id);
    }
};
exports.SettingsController = SettingsController;
__decorate([
    (0, common_1.Post)('headers'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [create_header_dto_1.CreateHeaderDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "createHeader", null);
__decorate([
    (0, common_1.Get)('headers'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [bootstrap_table_request_dto_1.BootstrapTableRequestDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findAllHeaders", null);
__decorate([
    (0, common_1.Get)('lov-lm'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [bootstrap_table_request_dto_1.BootstrapTableRequestDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findAllLovLm", null);
__decorate([
    (0, common_1.Get)('lov-jewelry'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [bootstrap_table_request_dto_1.BootstrapTableRequestDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findAllLovJewelry", null);
__decorate([
    (0, common_1.Get)('lov-referral-source'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [bootstrap_table_request_dto_1.BootstrapTableRequestDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findAllLovReferralSource", null);
__decorate([
    (0, common_1.Get)('lov-cancellation-reason'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [bootstrap_table_request_dto_1.BootstrapTableRequestDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findAllLovCancellationReason", null);
__decorate([
    (0, common_1.Get)('headers/:id'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Param)('id')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findOneHeader", null);
__decorate([
    (0, common_1.Patch)('headers/:id'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN'),
    __param(0, (0, common_1.Param)('id')),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, update_header_dto_1.UpdateHeaderDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "updateHeader", null);
__decorate([
    (0, common_1.Delete)('headers/:id'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN'),
    __param(0, (0, common_1.Param)('id')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "removeHeader", null);
__decorate([
    (0, common_1.Post)('details'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [create_detail_dto_1.CreateDetailDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "createDetail", null);
__decorate([
    (0, common_1.Get)('details'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Query)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [bootstrap_table_request_dto_1.BootstrapTableRequestDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findAllDetails", null);
__decorate([
    (0, common_1.Get)('details/:id'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN', 'HEAD_STORE', 'FRONTLINER'),
    __param(0, (0, common_1.Param)('id')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "findOneDetail", null);
__decorate([
    (0, common_1.Patch)('details/:id'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN'),
    __param(0, (0, common_1.Param)('id')),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, update_detail_dto_1.UpdateDetailDto]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "updateDetail", null);
__decorate([
    (0, common_1.Delete)('details/:id'),
    (0, roles_decorator_1.Roles)('SUPER_ADMIN'),
    __param(0, (0, common_1.Param)('id')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], SettingsController.prototype, "removeDetail", null);
exports.SettingsController = SettingsController = __decorate([
    (0, common_1.Controller)('settings'),
    (0, common_1.UseGuards)((0, passport_1.AuthGuard)('jwt'), roles_guard_1.RolesGuard),
    __metadata("design:paramtypes", [settings_service_1.SettingsService])
], SettingsController);
//# sourceMappingURL=settings.controller.js.map