"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AvailablestatusmasterController = 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 AvailablestatusmasterController = class AvailablestatusmasterController {
    constructor(availableStatusMasterRepository) {
        this.availableStatusMasterRepository = availableStatusMasterRepository;
    }
    async create(availableStatusMaster) {
        return this.availableStatusMasterRepository.create(availableStatusMaster);
    }
    async count(where) {
        return this.availableStatusMasterRepository.count(where);
    }
    async find(filter) {
        return this.availableStatusMasterRepository.find(filter);
    }
    async updateAll(availableStatusMaster, where) {
        return this.availableStatusMasterRepository.updateAll(availableStatusMaster, where);
    }
    async findById(id, filter) {
        return this.availableStatusMasterRepository.findById(id, filter);
    }
    async updateById(id, availableStatusMaster) {
        await this.availableStatusMasterRepository.updateById(id, availableStatusMaster);
    }
    async replaceById(id, availableStatusMaster) {
        await this.availableStatusMasterRepository.replaceById(id, availableStatusMaster);
    }
    async deleteById(id) {
        await this.availableStatusMasterRepository.deleteById(id);
    }
};
exports.AvailablestatusmasterController = AvailablestatusmasterController;
tslib_1.__decorate([
    (0, rest_1.post)('/available-status-masters'),
    (0, rest_1.response)(200, {
        description: 'AvailableStatusMaster model instance',
        content: { 'application/json': { schema: (0, rest_1.getModelSchemaRef)(models_1.AvailableStatusMaster) } },
    }),
    tslib_1.__param(0, (0, rest_1.requestBody)({
        content: {
            'application/json': {
                schema: (0, rest_1.getModelSchemaRef)(models_1.AvailableStatusMaster, {
                    title: 'NewAvailableStatusMaster',
                    exclude: ['availablestatusId'],
                }),
            },
        },
    })),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AvailablestatusmasterController.prototype, "create", null);
tslib_1.__decorate([
    (0, rest_1.get)('/available-status-masters/count'),
    (0, rest_1.response)(200, {
        description: 'AvailableStatusMaster model count',
        content: { 'application/json': { schema: repository_1.CountSchema } },
    }),
    tslib_1.__param(0, rest_1.param.where(models_1.AvailableStatusMaster)),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AvailablestatusmasterController.prototype, "count", null);
tslib_1.__decorate([
    (0, rest_1.get)('/available-status-masters'),
    (0, rest_1.response)(200, {
        description: 'Array of AvailableStatusMaster model instances',
        content: {
            'application/json': {
                schema: {
                    type: 'array',
                    items: (0, rest_1.getModelSchemaRef)(models_1.AvailableStatusMaster, { includeRelations: true }),
                },
            },
        },
    }),
    tslib_1.__param(0, rest_1.param.filter(models_1.AvailableStatusMaster)),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AvailablestatusmasterController.prototype, "find", null);
tslib_1.__decorate([
    (0, rest_1.patch)('/available-status-masters'),
    (0, rest_1.response)(200, {
        description: 'AvailableStatusMaster 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.AvailableStatusMaster, { partial: true }),
            },
        },
    })),
    tslib_1.__param(1, rest_1.param.where(models_1.AvailableStatusMaster)),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [models_1.AvailableStatusMaster, Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AvailablestatusmasterController.prototype, "updateAll", null);
tslib_1.__decorate([
    (0, rest_1.get)('/available-status-masters/{id}'),
    (0, rest_1.response)(200, {
        description: 'AvailableStatusMaster model instance',
        content: {
            'application/json': {
                schema: (0, rest_1.getModelSchemaRef)(models_1.AvailableStatusMaster, { includeRelations: true }),
            },
        },
    }),
    tslib_1.__param(0, rest_1.param.path.number('id')),
    tslib_1.__param(1, rest_1.param.filter(models_1.AvailableStatusMaster, { exclude: 'where' })),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Number, Object]),
    tslib_1.__metadata("design:returntype", Promise)
], AvailablestatusmasterController.prototype, "findById", null);
tslib_1.__decorate([
    (0, rest_1.patch)('/available-status-masters/{id}'),
    (0, rest_1.response)(204, {
        description: 'AvailableStatusMaster 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.AvailableStatusMaster, { partial: true }),
            },
        },
    })),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [Number, models_1.AvailableStatusMaster]),
    tslib_1.__metadata("design:returntype", Promise)
], AvailablestatusmasterController.prototype, "updateById", null);
tslib_1.__decorate([
    (0, rest_1.put)('/available-status-masters/{id}'),
    (0, rest_1.response)(204, {
        description: 'AvailableStatusMaster 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.AvailableStatusMaster]),
    tslib_1.__metadata("design:returntype", Promise)
], AvailablestatusmasterController.prototype, "replaceById", null);
tslib_1.__decorate([
    (0, rest_1.del)('/available-status-masters/{id}'),
    (0, rest_1.response)(204, {
        description: 'AvailableStatusMaster 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)
], AvailablestatusmasterController.prototype, "deleteById", null);
exports.AvailablestatusmasterController = AvailablestatusmasterController = tslib_1.__decorate([
    tslib_1.__param(0, (0, repository_1.repository)(repositories_1.AvailableStatusMasterRepository)),
    tslib_1.__metadata("design:paramtypes", [repositories_1.AvailableStatusMasterRepository])
], AvailablestatusmasterController);
//# sourceMappingURL=availablestatusmaster.controller.js.map