"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypeIsDtoToSwagger = void 0;
const core_1 = require("@asapjs/core");
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
const typeGenerator_1 = require("./generators/typeGenerator");
exports.TypeIsDtoToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => {
    if (!options) {
        core_1.logger.error(`@asapjs/sequelize :: @TypeIs.DTO - DTO가 지정되지 않았습니다.`);
        process.exit(1);
    }
    const dtoName = new options.dto().constructor.name;
    return {
        $ref: `#/components/schemas/${dtoName}`,
    };
});
const TypeIsDto = (0, typeGenerator_1.typeGenerator)((options) => ({
    __name: 'dto',
    toSequelize: () => ({ dto: options === null || options === void 0 ? void 0 : options.dto, as: options === null || options === void 0 ? void 0 : options.as }),
    toSwagger: () => (0, exports.TypeIsDtoToSwagger)(options),
}));
exports.default = TypeIsDto;
//# sourceMappingURL=dto.js.map