"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.UpdateWebhookActionDTO = exports.CreateWebhookActionDTO = void 0;
const class_transformer_1 = require("class-transformer");
const mapped_types_1 = require("@nestjs/mapped-types");
const class_validator_1 = require("class-validator");
const toNullableInteger = ({ value }) => {
    if (value === undefined || value === null || value === '') {
        return undefined;
    }
    return Number(value);
};
const toOptionalTrimmedString = ({ value }) => {
    if (value === undefined || value === null) {
        return undefined;
    }
    return String(value).trim();
};
class CreateWebhookActionDTO {
}
exports.CreateWebhookActionDTO = CreateWebhookActionDTO;
__decorate([
    (0, class_validator_1.IsIn)(['email', 'whatsapp_evolution']),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "type", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "name", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toNullableInteger),
    (0, class_validator_1.IsInt)(),
    __metadata("design:type", Number)
], CreateWebhookActionDTO.prototype, "order", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsIn)(['active', 'inactive']),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "status", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toNullableInteger),
    (0, class_validator_1.IsInt)(),
    __metadata("design:type", Number)
], CreateWebhookActionDTO.prototype, "mail_profile_id", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toNullableInteger),
    (0, class_validator_1.IsInt)(),
    __metadata("design:type", Number)
], CreateWebhookActionDTO.prototype, "mail_id", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "email_to", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "email_cc", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "email_bcc", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsIn)(['phone', 'group']),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "whatsapp_target_type", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "whatsapp_target", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "whatsapp_template", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "whatsapp_instance", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "whatsapp_base_url", void 0);
__decorate([
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Transform)(toOptionalTrimmedString),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateWebhookActionDTO.prototype, "whatsapp_token", void 0);
class UpdateWebhookActionDTO extends (0, mapped_types_1.PartialType)(CreateWebhookActionDTO) {
}
exports.UpdateWebhookActionDTO = UpdateWebhookActionDTO;
//# sourceMappingURL=webhook-action.dto.js.map