"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.User = void 0;
const typeorm_1 = require("typeorm");
const base_entity_1 = require("./base.entity");
const notification_preferences_entity_1 = require("./notification-preferences.entity");
const group_member_entity_1 = require("./group-member.entity");
const group_entity_1 = require("./group.entity");
const expense_entity_1 = require("./expense.entity");
const expense_split_entity_1 = require("./expense-split.entity");
const settlement_entity_1 = require("./settlement.entity");
const activity_log_entity_1 = require("./activity-log.entity");
const notification_entity_1 = require("./notification.entity");
const password_reset_token_entity_1 = require("./password-reset-token.entity");
const email_verification_token_entity_1 = require("./email-verification-token.entity");
const group_invite_entity_1 = require("./group-invite.entity");
const admin_audit_log_entity_1 = require("./admin-audit-log.entity");
let User = class User extends base_entity_1.BaseEntity {
};
exports.User = User;
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true }),
    __metadata("design:type", String)
], User.prototype, "email", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'password_hash', type: 'varchar', length: 255, nullable: true }),
    __metadata("design:type", Object)
], User.prototype, "passwordHash", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'google_id', type: 'varchar', length: 255, unique: true, nullable: true }),
    __metadata("design:type", Object)
], User.prototype, "googleId", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
    __metadata("design:type", String)
], User.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'avatar_url', type: 'varchar', length: 500, nullable: true }),
    __metadata("design:type", Object)
], User.prototype, "avatarUrl", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'char', length: 3, default: 'USD' }),
    __metadata("design:type", String)
], User.prototype, "currency", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'UTC' }),
    __metadata("design:type", String)
], User.prototype, "timezone", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'dark_mode', type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], User.prototype, "darkMode", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'is_email_verified', type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], User.prototype, "isEmailVerified", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'is_platform_admin', type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], User.prototype, "isPlatformAdmin", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'is_active', type: 'boolean', default: true }),
    __metadata("design:type", Boolean)
], User.prototype, "isActive", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'refresh_token_hash', type: 'varchar', length: 255, nullable: true }),
    __metadata("design:type", Object)
], User.prototype, "refreshTokenHash", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'datetime', precision: 3 }),
    __metadata("design:type", Date)
], User.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'datetime', precision: 3 }),
    __metadata("design:type", Date)
], User.prototype, "updatedAt", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => notification_preferences_entity_1.NotificationPreferences, (p) => p.user),
    __metadata("design:type", notification_preferences_entity_1.NotificationPreferences)
], User.prototype, "notificationPreferences", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => group_member_entity_1.GroupMember, (m) => m.user),
    __metadata("design:type", Array)
], User.prototype, "groupMemberships", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => group_entity_1.Group, (g) => g.createdBy),
    __metadata("design:type", Array)
], User.prototype, "createdGroups", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => expense_entity_1.Expense, (e) => e.paidBy),
    __metadata("design:type", Array)
], User.prototype, "paidExpenses", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => expense_entity_1.Expense, (e) => e.createdBy),
    __metadata("design:type", Array)
], User.prototype, "createdExpenses", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => expense_split_entity_1.ExpenseSplit, (s) => s.user),
    __metadata("design:type", Array)
], User.prototype, "expenseSplits", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => settlement_entity_1.Settlement, (s) => s.payer),
    __metadata("design:type", Array)
], User.prototype, "sentSettlements", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => settlement_entity_1.Settlement, (s) => s.payee),
    __metadata("design:type", Array)
], User.prototype, "receivedSettlements", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => activity_log_entity_1.ActivityLog, (a) => a.actor),
    __metadata("design:type", Array)
], User.prototype, "activityLogs", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => notification_entity_1.Notification, (n) => n.user),
    __metadata("design:type", Array)
], User.prototype, "notifications", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => password_reset_token_entity_1.PasswordResetToken, (t) => t.user),
    __metadata("design:type", Array)
], User.prototype, "passwordResetTokens", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => email_verification_token_entity_1.EmailVerificationToken, (t) => t.user),
    __metadata("design:type", Array)
], User.prototype, "emailVerificationTokens", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => group_invite_entity_1.GroupInvite, (i) => i.invitedBy),
    __metadata("design:type", Array)
], User.prototype, "sentInvites", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => admin_audit_log_entity_1.AdminAuditLog, (l) => l.actor),
    __metadata("design:type", Array)
], User.prototype, "adminAuditLogs", void 0);
exports.User = User = __decorate([
    (0, typeorm_1.Entity)('users')
], User);
//# sourceMappingURL=user.entity.js.map