"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);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DashboardQuestionSqlDatasetConfig = void 0;
const openapi = require("@nestjs/swagger");
const common_entity_1 = require("./common.entity");
const typeorm_1 = require("typeorm");
const dashboard_question_entity_1 = require("./dashboard-question.entity");
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
let DashboardQuestionSqlDatasetConfig = class DashboardQuestionSqlDatasetConfig extends common_entity_1.CommonEntity {
    static _OPENAPI_METADATA_FACTORY() {
        return { datasetName: { required: true, type: () => String }, datasetDisplayName: { required: true, type: () => String }, description: { required: true, type: () => String }, sql: { required: true, type: () => String }, labelColumnName: { required: true, type: () => String }, valueColumnName: { required: true, type: () => String }, question: { required: true, type: () => require("./dashboard-question.entity").DashboardQuestion }, options: { required: true, type: () => Object }, externalId: { required: true, type: () => String } };
    }
};
exports.DashboardQuestionSqlDatasetConfig = DashboardQuestionSqlDatasetConfig;
__decorate([
    (0, typeorm_1.Index)(),
    (0, typeorm_1.Column)({ type: "varchar" }),
    __metadata("design:type", String)
], DashboardQuestionSqlDatasetConfig.prototype, "datasetName", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "varchar" }),
    __metadata("design:type", String)
], DashboardQuestionSqlDatasetConfig.prototype, "datasetDisplayName", void 0);
__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    __metadata("design:type", String)
], DashboardQuestionSqlDatasetConfig.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('longText'), nullable: true }),
    __metadata("design:type", String)
], DashboardQuestionSqlDatasetConfig.prototype, "sql", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "varchar" }),
    __metadata("design:type", String)
], DashboardQuestionSqlDatasetConfig.prototype, "labelColumnName", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "varchar" }),
    __metadata("design:type", String)
], DashboardQuestionSqlDatasetConfig.prototype, "valueColumnName", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => dashboard_question_entity_1.DashboardQuestion, { nullable: false }),
    (0, typeorm_1.JoinColumn)(),
    __metadata("design:type", dashboard_question_entity_1.DashboardQuestion)
], DashboardQuestionSqlDatasetConfig.prototype, "question", void 0);
__decorate([
    (0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('longText') }),
    __metadata("design:type", Object)
], DashboardQuestionSqlDatasetConfig.prototype, "options", void 0);
__decorate([
    (0, typeorm_1.Index)({ unique: true }),
    (0, typeorm_1.Column)({ type: "varchar", nullable: false }),
    __metadata("design:type", String)
], DashboardQuestionSqlDatasetConfig.prototype, "externalId", void 0);
exports.DashboardQuestionSqlDatasetConfig = DashboardQuestionSqlDatasetConfig = __decorate([
    (0, typeorm_1.Entity)("ss_dashboard_question_sql_dataset_config")
], DashboardQuestionSqlDatasetConfig);
//# sourceMappingURL=dashboard-question-sql-dataset-config.entity.js.map