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 { OptionalProps } from "@mikro-orm/core";
import { Entity, Index, PrimaryKey, Property } from "@mikro-orm/decorators/legacy";
OptionalProps;
let Notification = class {
  constructor() {
    this.severity = "info";
    this.status = "unread";
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], Notification.prototype, "id", 2);
__decorateClass([
  Property({ name: "recipient_user_id", type: "uuid" })
], Notification.prototype, "recipientUserId", 2);
__decorateClass([
  Property({ name: "type", type: "text" })
], Notification.prototype, "type", 2);
__decorateClass([
  Property({ name: "title_key", type: "text", nullable: true })
], Notification.prototype, "titleKey", 2);
__decorateClass([
  Property({ name: "body_key", type: "text", nullable: true })
], Notification.prototype, "bodyKey", 2);
__decorateClass([
  Property({ name: "title_variables", type: "json", nullable: true })
], Notification.prototype, "titleVariables", 2);
__decorateClass([
  Property({ name: "body_variables", type: "json", nullable: true })
], Notification.prototype, "bodyVariables", 2);
__decorateClass([
  Property({ name: "title", type: "text" })
], Notification.prototype, "title", 2);
__decorateClass([
  Property({ name: "body", type: "text", nullable: true })
], Notification.prototype, "body", 2);
__decorateClass([
  Property({ name: "icon", type: "text", nullable: true })
], Notification.prototype, "icon", 2);
__decorateClass([
  Property({ name: "severity", type: "text", default: "info" })
], Notification.prototype, "severity", 2);
__decorateClass([
  Property({ name: "status", type: "text", default: "unread" })
], Notification.prototype, "status", 2);
__decorateClass([
  Property({ name: "action_data", type: "json", nullable: true })
], Notification.prototype, "actionData", 2);
__decorateClass([
  Property({ name: "action_result", type: "json", nullable: true })
], Notification.prototype, "actionResult", 2);
__decorateClass([
  Property({ name: "action_taken", type: "text", nullable: true })
], Notification.prototype, "actionTaken", 2);
__decorateClass([
  Property({ name: "source_module", type: "text", nullable: true })
], Notification.prototype, "sourceModule", 2);
__decorateClass([
  Property({ name: "source_entity_type", type: "text", nullable: true })
], Notification.prototype, "sourceEntityType", 2);
__decorateClass([
  Property({ name: "source_entity_id", type: "uuid", nullable: true })
], Notification.prototype, "sourceEntityId", 2);
__decorateClass([
  Property({ name: "link_href", type: "text", nullable: true })
], Notification.prototype, "linkHref", 2);
__decorateClass([
  Property({ name: "group_key", type: "text", nullable: true })
], Notification.prototype, "groupKey", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], Notification.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "read_at", type: Date, nullable: true })
], Notification.prototype, "readAt", 2);
__decorateClass([
  Property({ name: "actioned_at", type: Date, nullable: true })
], Notification.prototype, "actionedAt", 2);
__decorateClass([
  Property({ name: "dismissed_at", type: Date, nullable: true })
], Notification.prototype, "dismissedAt", 2);
__decorateClass([
  Property({ name: "expires_at", type: Date, nullable: true })
], Notification.prototype, "expiresAt", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], Notification.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid", nullable: true })
], Notification.prototype, "organizationId", 2);
Notification = __decorateClass([
  Entity({ tableName: "notifications" }),
  Index({ name: "notifications_recipient_status_idx", properties: ["recipientUserId", "status", "createdAt"] }),
  Index({ name: "notifications_source_idx", properties: ["sourceEntityType", "sourceEntityId"] }),
  Index({ name: "notifications_tenant_idx", properties: ["tenantId", "organizationId"] }),
  Index({ name: "notifications_expires_idx", properties: ["expiresAt"] }),
  Index({ name: "notifications_group_idx", properties: ["groupKey", "recipientUserId"] })
], Notification);
export {
  Notification
};
//# sourceMappingURL=entities.js.map
