"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.PricingDetailController = void 0;
const common_1 = require("@nestjs/common");
const pricing_detail_service_1 = require("./pricing-detail.service");
const pricing_detail_dto_1 = require("./dto/pricing-detail.dto");
const bootstrap_table_request_dto_1 = require("../commons/dto/bootstrap-table-request.dto");
let PricingDetailController = class PricingDetailController {
    constructor(service) {
        this.service = service;
    }
    findAll(pagination, headerId, itemTypeId) {
        return this.service.findAll(pagination, headerId, itemTypeId);
    }
    findOne(id) {
        return this.service.findOne(id);
    }
    findActive(headerId) {
        return this.service.findActiveByHeader(headerId);
    }
    create(dto) {
        return this.service.create(dto);
    }
    update(id, dto) {
        return this.service.update(id, dto);
    }
    updatePrice(headerId, dto) {
        return this.service.updatePrice(headerId, dto);
    }
    remove(id) {
        return this.service.remove(id);
    }
};
exports.PricingDetailController = PricingDetailController;
__decorate([
    (0, common_1.Get)(),
    __param(0, (0, common_1.Query)()),
    __param(1, (0, common_1.Query)('headerId')),
    __param(2, (0, common_1.Query)('itemTypeId')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [bootstrap_table_request_dto_1.BootstrapTableRequestDto, String, String]),
    __metadata("design:returntype", void 0)
], PricingDetailController.prototype, "findAll", null);
__decorate([
    (0, common_1.Get)(':id'),
    __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], PricingDetailController.prototype, "findOne", null);
__decorate([
    (0, common_1.Get)('active/:headerId'),
    __param(0, (0, common_1.Param)('headerId', common_1.ParseUUIDPipe)),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], PricingDetailController.prototype, "findActive", null);
__decorate([
    (0, common_1.Post)(),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [pricing_detail_dto_1.CreatePricingDetailDto]),
    __metadata("design:returntype", void 0)
], PricingDetailController.prototype, "create", null);
__decorate([
    (0, common_1.Put)(':id'),
    __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, pricing_detail_dto_1.UpdatePricingDetailDto]),
    __metadata("design:returntype", void 0)
], PricingDetailController.prototype, "update", null);
__decorate([
    (0, common_1.Patch)(':headerId/update-price'),
    __param(0, (0, common_1.Param)('headerId', common_1.ParseUUIDPipe)),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, pricing_detail_dto_1.UpdatePriceDto]),
    __metadata("design:returntype", void 0)
], PricingDetailController.prototype, "updatePrice", null);
__decorate([
    (0, common_1.Delete)(':id'),
    (0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
    __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", void 0)
], PricingDetailController.prototype, "remove", null);
exports.PricingDetailController = PricingDetailController = __decorate([
    (0, common_1.Controller)('settings/pricing-details'),
    __metadata("design:paramtypes", [pricing_detail_service_1.PricingDetailService])
], PricingDetailController);
//# sourceMappingURL=pricing-detail.controller.js.map