var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
import { Entity, Index, ManyToOne, PrimaryKey, Property, Unique } from "@mikro-orm/decorators/legacy";
let User = class {
  constructor() {
    this.isConfirmed = true;
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], User.prototype, "id", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid", nullable: true })
], User.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid", nullable: true })
], User.prototype, "organizationId", 2);
__decorateClass([
  Property({ type: "text" })
], User.prototype, "email", 2);
__decorateClass([
  Property({ name: "email_hash", type: "text", nullable: true }),
  Index({ name: "users_email_hash_idx" })
], User.prototype, "emailHash", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], User.prototype, "name", 2);
__decorateClass([
  Property({ name: "password_hash", type: "text", nullable: true })
], User.prototype, "passwordHash", 2);
__decorateClass([
  Property({ name: "is_confirmed", type: "boolean", default: true })
], User.prototype, "isConfirmed", 2);
__decorateClass([
  Property({ name: "last_login_at", type: Date, nullable: true })
], User.prototype, "lastLoginAt", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], User.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onCreate: () => /* @__PURE__ */ new Date(), onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], User.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], User.prototype, "deletedAt", 2);
User = __decorateClass([
  Entity({ tableName: "users" })
], User);
let Role = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], Role.prototype, "id", 2);
__decorateClass([
  Property({ type: "text" })
], Role.prototype, "name", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], Role.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], Role.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onCreate: () => /* @__PURE__ */ new Date(), onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], Role.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], Role.prototype, "deletedAt", 2);
Role = __decorateClass([
  Entity({ tableName: "roles" }),
  Unique({ properties: ["tenantId", "name"] })
], Role);
let UserSidebarPreference = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], UserSidebarPreference.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => User)
], UserSidebarPreference.prototype, "user", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid", nullable: true })
], UserSidebarPreference.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid", nullable: true })
], UserSidebarPreference.prototype, "organizationId", 2);
__decorateClass([
  Property({ type: "text" })
], UserSidebarPreference.prototype, "locale", 2);
__decorateClass([
  Property({ name: "settings_json", type: "json", nullable: true })
], UserSidebarPreference.prototype, "settingsJson", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], UserSidebarPreference.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], UserSidebarPreference.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], UserSidebarPreference.prototype, "deletedAt", 2);
UserSidebarPreference = __decorateClass([
  Entity({ tableName: "user_sidebar_preferences" })
], UserSidebarPreference);
let RoleSidebarPreference = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], RoleSidebarPreference.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => Role)
], RoleSidebarPreference.prototype, "role", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid", nullable: true })
], RoleSidebarPreference.prototype, "tenantId", 2);
__decorateClass([
  Property({ type: "text" })
], RoleSidebarPreference.prototype, "locale", 2);
__decorateClass([
  Property({ name: "settings_json", type: "json", nullable: true })
], RoleSidebarPreference.prototype, "settingsJson", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], RoleSidebarPreference.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], RoleSidebarPreference.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], RoleSidebarPreference.prototype, "deletedAt", 2);
RoleSidebarPreference = __decorateClass([
  Entity({ tableName: "role_sidebar_preferences" })
], RoleSidebarPreference);
let SidebarVariant = class {
  constructor() {
    this.isActive = false;
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], SidebarVariant.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => User)
], SidebarVariant.prototype, "user", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid", nullable: true })
], SidebarVariant.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid", nullable: true })
], SidebarVariant.prototype, "organizationId", 2);
__decorateClass([
  Property({ type: "text" })
], SidebarVariant.prototype, "locale", 2);
__decorateClass([
  Property({ type: "text" })
], SidebarVariant.prototype, "name", 2);
__decorateClass([
  Property({ name: "settings_json", type: "json", nullable: true })
], SidebarVariant.prototype, "settingsJson", 2);
__decorateClass([
  Property({ name: "is_active", type: "boolean", default: false })
], SidebarVariant.prototype, "isActive", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], SidebarVariant.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], SidebarVariant.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], SidebarVariant.prototype, "deletedAt", 2);
SidebarVariant = __decorateClass([
  Entity({ tableName: "sidebar_variants" })
], SidebarVariant);
let UserRole = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], UserRole.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => User)
], UserRole.prototype, "user", 2);
__decorateClass([
  ManyToOne(() => Role)
], UserRole.prototype, "role", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], UserRole.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], UserRole.prototype, "deletedAt", 2);
UserRole = __decorateClass([
  Entity({ tableName: "user_roles" }),
  Index({ name: "user_roles_user_id_idx", properties: ["user"] }),
  Index({ name: "user_roles_role_id_idx", properties: ["role"] })
], UserRole);
let Session = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], Session.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => User)
], Session.prototype, "user", 2);
__decorateClass([
  Property({ type: "text", unique: true })
], Session.prototype, "token", 2);
__decorateClass([
  Property({ name: "expires_at", type: Date })
], Session.prototype, "expiresAt", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], Session.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "last_used_at", type: Date, nullable: true })
], Session.prototype, "lastUsedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], Session.prototype, "deletedAt", 2);
Session = __decorateClass([
  Entity({ tableName: "sessions" })
], Session);
let PasswordReset = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], PasswordReset.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => User)
], PasswordReset.prototype, "user", 2);
__decorateClass([
  Property({ type: "text", unique: true })
], PasswordReset.prototype, "token", 2);
__decorateClass([
  Property({ name: "expires_at", type: Date })
], PasswordReset.prototype, "expiresAt", 2);
__decorateClass([
  Property({ name: "used_at", type: Date, nullable: true })
], PasswordReset.prototype, "usedAt", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], PasswordReset.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], PasswordReset.prototype, "deletedAt", 2);
PasswordReset = __decorateClass([
  Entity({ tableName: "password_resets" })
], PasswordReset);
let RoleAcl = class {
  constructor() {
    this.isSuperAdmin = false;
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], RoleAcl.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => Role)
], RoleAcl.prototype, "role", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], RoleAcl.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "features_json", type: "json", nullable: true })
], RoleAcl.prototype, "featuresJson", 2);
__decorateClass([
  Property({ name: "is_super_admin", type: "boolean", default: false })
], RoleAcl.prototype, "isSuperAdmin", 2);
__decorateClass([
  Property({ name: "organizations_json", type: "json", nullable: true })
], RoleAcl.prototype, "organizationsJson", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], RoleAcl.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onCreate: () => /* @__PURE__ */ new Date(), onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], RoleAcl.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], RoleAcl.prototype, "deletedAt", 2);
RoleAcl = __decorateClass([
  Entity({ tableName: "role_acls" })
], RoleAcl);
let UserAcl = class {
  constructor() {
    this.isSuperAdmin = false;
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], UserAcl.prototype, "id", 2);
__decorateClass([
  ManyToOne(() => User)
], UserAcl.prototype, "user", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], UserAcl.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "features_json", type: "json", nullable: true })
], UserAcl.prototype, "featuresJson", 2);
__decorateClass([
  Property({ name: "is_super_admin", type: "boolean", default: false })
], UserAcl.prototype, "isSuperAdmin", 2);
__decorateClass([
  Property({ name: "organizations_json", type: "json", nullable: true })
], UserAcl.prototype, "organizationsJson", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], UserAcl.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onCreate: () => /* @__PURE__ */ new Date(), onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], UserAcl.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], UserAcl.prototype, "deletedAt", 2);
UserAcl = __decorateClass([
  Entity({ tableName: "user_acls" })
], UserAcl);
let UserConsent = class {
  constructor() {
    this.isGranted = false;
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], UserConsent.prototype, "id", 2);
__decorateClass([
  Property({ name: "user_id", type: "uuid" })
], UserConsent.prototype, "userId", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid", nullable: true })
], UserConsent.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid", nullable: true })
], UserConsent.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "consent_type", type: "text" })
], UserConsent.prototype, "consentType", 2);
__decorateClass([
  Property({ name: "is_granted", type: "boolean", default: false })
], UserConsent.prototype, "isGranted", 2);
__decorateClass([
  Property({ name: "granted_at", type: Date, nullable: true })
], UserConsent.prototype, "grantedAt", 2);
__decorateClass([
  Property({ name: "withdrawn_at", type: Date, nullable: true })
], UserConsent.prototype, "withdrawnAt", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], UserConsent.prototype, "source", 2);
__decorateClass([
  Property({ name: "ip_address", type: "text", nullable: true })
], UserConsent.prototype, "ipAddress", 2);
__decorateClass([
  Property({ name: "integrity_hash", type: "text", nullable: true })
], UserConsent.prototype, "integrityHash", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], UserConsent.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date(), nullable: true })
], UserConsent.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], UserConsent.prototype, "deletedAt", 2);
UserConsent = __decorateClass([
  Entity({ tableName: "user_consents" }),
  Unique({ properties: ["userId", "tenantId", "consentType"] })
], UserConsent);
export {
  PasswordReset,
  Role,
  RoleAcl,
  RoleSidebarPreference,
  Session,
  SidebarVariant,
  User,
  UserAcl,
  UserConsent,
  UserRole,
  UserSidebarPreference
};
//# sourceMappingURL=entities.js.map
