"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.AdminSchema = exports.Admin = void 0;
const mongoose_1 = require("@nestjs/mongoose");
const role_enum_1 = require("../../common/roles/role.enum");
const base_entity_1 = require("../../common/entities/base.entity");
const class_transformer_1 = require("class-transformer");
const notification_prefs_schema_1 = require("../../common/schemas/notification-prefs.schema");
let Admin = class Admin extends base_entity_1.BaseEntity {
    uniqueId;
    email;
    password;
    role;
    isDisabled;
    name;
    photoUrl;
    phone;
    notificationPrefs;
};
exports.Admin = Admin;
__decorate([
    (0, mongoose_1.Prop)({ unique: true, trim: true }),
    __metadata("design:type", String)
], Admin.prototype, "uniqueId", void 0);
__decorate([
    (0, mongoose_1.Prop)({ required: true, unique: true, trim: true, lowercase: true }),
    __metadata("design:type", String)
], Admin.prototype, "email", void 0);
__decorate([
    (0, class_transformer_1.Exclude)(),
    (0, mongoose_1.Prop)({ required: true }),
    __metadata("design:type", String)
], Admin.prototype, "password", void 0);
__decorate([
    (0, mongoose_1.Prop)({ default: role_enum_1.Role.ADMIN }),
    __metadata("design:type", String)
], Admin.prototype, "role", void 0);
__decorate([
    (0, mongoose_1.Prop)({ default: false }),
    __metadata("design:type", Boolean)
], Admin.prototype, "isDisabled", void 0);
__decorate([
    (0, mongoose_1.Prop)({ trim: true }),
    __metadata("design:type", String)
], Admin.prototype, "name", void 0);
__decorate([
    (0, mongoose_1.Prop)({ trim: true }),
    __metadata("design:type", String)
], Admin.prototype, "photoUrl", void 0);
__decorate([
    (0, mongoose_1.Prop)({
        unique: true,
        sparse: true,
        trim: true,
    }),
    __metadata("design:type", String)
], Admin.prototype, "phone", void 0);
__decorate([
    (0, mongoose_1.Prop)({ type: notification_prefs_schema_1.NotificationPrefsSchema, default: () => ({ email: true, whatsapp: true }) }),
    __metadata("design:type", notification_prefs_schema_1.NotificationPrefs)
], Admin.prototype, "notificationPrefs", void 0);
exports.Admin = Admin = __decorate([
    (0, mongoose_1.Schema)({ timestamps: true })
], Admin);
exports.AdminSchema = mongoose_1.SchemaFactory.createForClass(Admin);
//# sourceMappingURL=admin.schema.js.map