"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.UpdateDashboardQuestionDto = void 0;
const openapi = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const swagger_1 = require("@nestjs/swagger");
const class_transformer_1 = require("class-transformer");
const update_dashboard_question_sql_dataset_config_dto_1 = require("./update-dashboard-question-sql-dataset-config.dto");
class UpdateDashboardQuestionDto {
    static _OPENAPI_METADATA_FACTORY() {
        return { id: { required: true, type: () => Number }, name: { required: true, type: () => String }, sourceType: { required: true, type: () => String }, visualisedAs: { required: true, type: () => String }, providerName: { required: true, type: () => String }, dashboardId: { required: true, type: () => Number }, dashboardUserKey: { required: true, type: () => String }, questionSqlDatasetConfigs: { required: true, type: () => [require("./update-dashboard-question-sql-dataset-config.dto").UpdateDashboardQuestionSqlDatasetConfigDto] }, questionSqlDatasetConfigsIds: { required: true, type: () => [Number] }, questionSqlDatasetConfigsCommand: { required: true, type: () => String }, chartOptions: { required: true, type: () => Object }, labelSql: { required: true, type: () => String }, kpiSql: { required: true, type: () => String }, sequenceNumber: { required: true, type: () => Number } };
    }
}
exports.UpdateDashboardQuestionDto = UpdateDashboardQuestionDto;
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsInt)(),
    __metadata("design:type", Number)
], UpdateDashboardQuestionDto.prototype, "id", void 0);
__decorate([
    (0, class_validator_1.IsNotEmpty)(),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "name", void 0);
__decorate([
    (0, class_validator_1.IsNotEmpty)(),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "sourceType", void 0);
__decorate([
    (0, class_validator_1.IsNotEmpty)(),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "visualisedAs", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)({ description: "This is only applicable when sourceType is set to provider. It allows the user to select any pre-existing Dashboard Question Data provider implementation used to fetch a dynamic dropdown of values to choose from when this question is presented to the user." }),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "providerName", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsInt)(),
    (0, swagger_1.ApiProperty)({ description: "Related Dashboard Model" }),
    __metadata("design:type", Number)
], UpdateDashboardQuestionDto.prototype, "dashboardId", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsOptional)(),
    (0, swagger_1.ApiProperty)({ description: "Related Dashboard Model" }),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "dashboardUserKey", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, swagger_1.ApiProperty)({ description: "Related Question SQL Dataset Config Model" }),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.ValidateNested)({ each: true }),
    (0, class_transformer_1.Type)(() => update_dashboard_question_sql_dataset_config_dto_1.UpdateDashboardQuestionSqlDatasetConfigDto),
    __metadata("design:type", Array)
], UpdateDashboardQuestionDto.prototype, "questionSqlDatasetConfigs", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, swagger_1.ApiProperty)({ description: "Related Question SQL Dataset Config Model" }),
    __metadata("design:type", Array)
], UpdateDashboardQuestionDto.prototype, "questionSqlDatasetConfigsIds", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsOptional)(),
    (0, swagger_1.ApiProperty)({ description: "Related Question SQL Dataset Config Model" }),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "questionSqlDatasetConfigsCommand", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsJSON)(),
    (0, swagger_1.ApiProperty)({ description: "This is a JSON object representing each labels display and color options for the bar chart" }),
    __metadata("design:type", Object)
], UpdateDashboardQuestionDto.prototype, "chartOptions", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)({ description: "This is the SQL query to fetch the label values for the question" }),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "labelSql", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)({ description: "This is the SQL query to fetch the KPI value for the question" }),
    __metadata("design:type", String)
], UpdateDashboardQuestionDto.prototype, "kpiSql", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsInt)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", Number)
], UpdateDashboardQuestionDto.prototype, "sequenceNumber", void 0);
//# sourceMappingURL=update-dashboard-question.dto.js.map