"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AreameasurmentmasterController = void 0;
const tslib_1 = require("tslib");
const repository_1 = require("@loopback/repository");
const rest_1 = require("@loopback/rest");
const models_1 = require("../models");
const repositories_1 = require("../repositories");
let AreameasurmentmasterController = class AreameasurmentmasterController {
    constructor(areaMeasurementMasterRepository) {
        this.areaMeasurementMasterRepository = areaMeasurementMasterRepository;
    }
    async create(areaMeasurementMaster) {
        return this.areaMeasurementMasterRepository.create(areaMeasurementMaster);
    }
    async count(where) {
        return this.areaMeasurementMasterRepository.count(where);
    }
    async find(filter) {
        return this.areaMeasurementMasterRepository.find(filter);
    }
    async updateAll(areaMeasurementMaster, where) {
        return this.areaMeasurementMasterRepository.updateAll(areaMeasurementMaster, where);
    }
    async findById(id, filter) {
        return this.areaMeasurementMasterRepository.findById(id, filter);
    }
    async updateById(id, areaMeasurementMaster) {
        await this.areaMeasurementMasterRepository.updateById(id, areaMeasurementMaster);
    }
    async replaceById(id, areaMeasurementMaster) {
        await this.areaMeasurementMasterRepository.replaceById(id, areaMeasurementMaster);
    }
    async deleteById(id) {
        await this.areaMeasurementMasterRepository.deleteById(id);
    }
};
exports.AreameasurmentmasterController = AreameasurmentmasterController;
tslib_1.__decorate([
    (0, rest_1.post)('/area-measurement-masters'),
    (0, rest_1.response)(200, {
        description: 'AreaMeasurementMaster model instance',
        content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.AreaMeasurementMaster) } },
    }),
    tslib_1.__param(0, (0, rest_1.requestBody)({
        content: {
            'application/json': {
                schema: (0, rest_1.getModelSchemaRef)(models_1.AreaMeasurementMaster, {
                    title: 'NewAreaMeasurementMaster',
                    exclude: ['areaMeasurementId'],
                }),
            },
        },
    })),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "create", null);
tslib_1.__decorate([
    (0, rest_1.get)('/area-measurement-masters/count'),
    (0, rest_1.response)(200, {
        description: 'AreaMeasurementMaster model count',
        content: { 'application/json': { schema: repository_1.CountSchema } },
    }),
    tslib_1.__param(0, rest_1.param.where(models_1.AreaMeasurementMaster)),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "count", null);
tslib_1.__decorate([
    (0, rest_1.get)('/area-measurement-masters'),
    (0, rest_1.response)(200, {
        description: 'Array of AreaMeasurementMaster model instances',
        content: {
            'application/json': {
                schema: {
                    type: 'array',
                    items: (0, rest_1.getModelSchemaRef)(models_1.AreaMeasurementMaster, { includeRelations: true }),
                },
            },
        },
    }),
    tslib_1.__param(0, rest_1.param.filter(models_1.AreaMeasurementMaster)),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "find", null);
tslib_1.__decorate([
    (0, rest_1.patch)('/area-measurement-masters'),
    (0, rest_1.response)(200, {
        description: 'AreaMeasurementMaster PATCH success count',
        content: { 'application/json': { schema: repository_1.CountSchema } },
    }),
    tslib_1.__param(0, (0, rest_1.requestBody)({
        content: {
            'application/json': {
                schema: (0, rest_1.getModelSchemaRef)(models_1.AreaMeasurementMaster, { partial: true }),
            },
        },
    })),
    tslib_1.__param(1, rest_1.param.where(models_1.AreaMeasurementMaster)),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [models_1.AreaMeasurementMaster, Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "updateAll", null);
tslib_1.__decorate([
    (0, rest_1.get)('/area-measurement-masters/{id}'),
    (0, rest_1.response)(200, {
        description: 'AreaMeasurementMaster model instance',
        content: {
            'application/json': {
                schema: (0, rest_1.getModelSchemaRef)(models_1.AreaMeasurementMaster, { includeRelations: true }),
            },
        },
    }),
    tslib_1.__param(0, rest_1.param.path.number('id')),
    tslib_1.__param(1, rest_1.param.filter(models_1.AreaMeasurementMaster, { exclude: 'where' })),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Number, Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "findById", null);
tslib_1.__decorate([
    (0, rest_1.patch)('/area-measurement-masters/{id}'),
    (0, rest_1.response)(204, {
        description: 'AreaMeasurementMaster PATCH success',
    }),
    tslib_1.__param(0, rest_1.param.path.number('id')),
    tslib_1.__param(1, (0, rest_1.requestBody)({
        content: {
            'application/json': {
                schema: (0, rest_1.getModelSchemaRef)(models_1.AreaMeasurementMaster, { partial: true }),
            },
        },
    })),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Number, models_1.AreaMeasurementMaster]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "updateById", null);
tslib_1.__decorate([
    (0, rest_1.put)('/area-measurement-masters/{id}'),
    (0, rest_1.response)(204, {
        description: 'AreaMeasurementMaster PUT success',
    }),
    tslib_1.__param(0, rest_1.param.path.number('id')),
    tslib_1.__param(1, (0, rest_1.requestBody)()),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Number, models_1.AreaMeasurementMaster]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "replaceById", null);
tslib_1.__decorate([
    (0, rest_1.del)('/area-measurement-masters/{id}'),
    (0, rest_1.response)(204, {
        description: 'AreaMeasurementMaster DELETE success',
    }),
    tslib_1.__param(0, rest_1.param.path.number('id')),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Number]),
    tslib_1.__metadata("design:returntype", Promise)
], AreameasurmentmasterController.prototype, "deleteById", null);
exports.AreameasurmentmasterController = AreameasurmentmasterController = tslib_1.__decorate([
    tslib_1.__param(0, (0, repository_1.repository)(repositories_1.AreaMeasurementMasterRepository)),
    tslib_1.__metadata("design:paramtypes", [repositories_1.AreaMeasurementMasterRepository])
], AreameasurmentmasterController);
//# sourceMappingURL=areameasurmentmaster.controller.js.map