"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.CreateAnnouncementDto = void 0;
const swagger_1 = require("@nestjs/swagger");
const client_1 = require("@prisma/client");
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
const swagger_docs_1 = require("../../common/swagger-docs");
class CreateAnnouncementDto {
    estateId;
    title;
    body;
    category;
    priority;
    targetRoles;
    targetUserIds;
    deliveryChannels;
    expiresAt;
    metadata;
}
exports.CreateAnnouncementDto = CreateAnnouncementDto;
__decorate([
    (0, swagger_1.ApiProperty)({ example: swagger_docs_1.ESTATE_ID_EXAMPLE, description: 'Estate that receives the announcement.' }),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateAnnouncementDto.prototype, "estateId", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'Main gate maintenance', description: 'Announcement title, capped at 80 characters.' }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.MinLength)(3),
    (0, class_validator_1.MaxLength)(80),
    __metadata("design:type", String)
], CreateAnnouncementDto.prototype, "title", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'The main gate scanner will be serviced on Saturday morning.', description: 'Announcement body.' }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.MinLength)(5),
    (0, class_validator_1.MaxLength)(700),
    __metadata("design:type", String)
], CreateAnnouncementDto.prototype, "body", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ enum: client_1.AnnouncementCategory, example: client_1.AnnouncementCategory.MAINTENANCE }),
    (0, class_validator_1.IsEnum)(client_1.AnnouncementCategory),
    __metadata("design:type", String)
], CreateAnnouncementDto.prototype, "category", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ enum: client_1.AnnouncementPriority, example: client_1.AnnouncementPriority.NORMAL }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsEnum)(client_1.AnnouncementPriority),
    __metadata("design:type", String)
], CreateAnnouncementDto.prototype, "priority", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ enum: client_1.UserRole, isArray: true, example: [client_1.UserRole.RESIDENT], description: 'Optional target roles. Defaults to residents.' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.ArrayUnique)(),
    (0, class_validator_1.IsEnum)(client_1.UserRole, { each: true }),
    __metadata("design:type", Array)
], CreateAnnouncementDto.prototype, "targetRoles", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ example: ['user-uuid'], description: 'Optional exact target user IDs.' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.ArrayUnique)(),
    (0, class_validator_1.IsString)({ each: true }),
    __metadata("design:type", Array)
], CreateAnnouncementDto.prototype, "targetUserIds", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ enum: client_1.NotificationChannel, isArray: true, example: [client_1.NotificationChannel.IN_APP, client_1.NotificationChannel.PUSH] }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.ArrayUnique)(),
    (0, class_validator_1.IsEnum)(client_1.NotificationChannel, { each: true }),
    __metadata("design:type", Array)
], CreateAnnouncementDto.prototype, "deliveryChannels", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ example: '2026-05-31T18:00:00.000Z', description: 'Optional expiry date.' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_transformer_1.Type)(() => Date),
    (0, class_validator_1.IsDate)(),
    __metadata("design:type", Date)
], CreateAnnouncementDto.prototype, "expiresAt", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ example: { requiresApproval: false }, description: 'Optional metadata.' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsObject)(),
    __metadata("design:type", Object)
], CreateAnnouncementDto.prototype, "metadata", void 0);
//# sourceMappingURL=announcement.dto.js.map