"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GuestNotificationPreferenceSchema = exports.GuestNotificationPreference = exports.GuestSchema = exports.Guest = void 0;
const core_1 = require("@mikro-orm/core");
const uuid_1 = require("uuid");
const base_entity_1 = require("../../core/entities/base.entity");
class Guest extends base_entity_1.BaseEntity {
    constructor() {
        super(...arguments);
        this.rsvp = false;
    }
}
exports.Guest = Guest;
exports.GuestSchema = new core_1.EntitySchema({
    class: Guest,
    tableName: 'guests',
    properties: {
        id: {
            type: 'uuid',
            primary: true,
            default: (0, uuid_1.v4)(),
        },
        tenantId: {
            type: 'string',
        },
        metadata: {
            type: 'json',
            nullable: true,
        },
        createdAt: {
            type: 'date',
            default: new Date(),
        },
        updatedAt: {
            type: 'date',
            default: new Date(),
        },
        name: {
            type: 'string',
        },
        email: {
            type: 'string',
            nullable: true,
        },
        phone: {
            type: 'string',
            nullable: true,
        },
        rsvp: {
            type: 'boolean',
            default: false,
        },
        tableId: {
            type: 'uuid',
            nullable: true,
        },
    },
});
class GuestNotificationPreference extends base_entity_1.BaseEntity {
    constructor() {
        super(...arguments);
        this.email = true;
        this.whatsapp = false;
    }
}
exports.GuestNotificationPreference = GuestNotificationPreference;
exports.GuestNotificationPreferenceSchema = new core_1.EntitySchema({
    class: GuestNotificationPreference,
    tableName: 'guest_notification_preferences',
    properties: {
        id: {
            type: 'uuid',
            primary: true,
            default: (0, uuid_1.v4)(),
        },
        tenantId: {
            type: 'string',
        },
        metadata: {
            type: 'json',
            nullable: true,
        },
        createdAt: {
            type: 'date',
            default: new Date(),
        },
        updatedAt: {
            type: 'date',
            default: new Date(),
        },
        guestId: {
            type: 'uuid',
        },
        email: {
            type: 'boolean',
            default: true,
        },
        whatsapp: {
            type: 'boolean',
            default: false,
        },
    },
});
