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 { Collection } from "@mikro-orm/core";
import { Entity, Index, ManyToOne, OneToMany, PrimaryKey, Property, Unique } from "@mikro-orm/decorators/legacy";
let ResourcesResourceType = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], ResourcesResourceType.prototype, "id", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], ResourcesResourceType.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], ResourcesResourceType.prototype, "organizationId", 2);
__decorateClass([
  Property({ type: "text" })
], ResourcesResourceType.prototype, "name", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], ResourcesResourceType.prototype, "description", 2);
__decorateClass([
  Property({ name: "appearance_icon", type: "text", nullable: true })
], ResourcesResourceType.prototype, "appearanceIcon", 2);
__decorateClass([
  Property({ name: "appearance_color", type: "text", nullable: true })
], ResourcesResourceType.prototype, "appearanceColor", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceType.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceType.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], ResourcesResourceType.prototype, "deletedAt", 2);
ResourcesResourceType = __decorateClass([
  Entity({ tableName: "resources_resource_types" }),
  Index({ name: "resources_resource_types_tenant_org_idx", properties: ["tenantId", "organizationId"] })
], ResourcesResourceType);
let ResourcesResource = class {
  constructor() {
    this.isActive = true;
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], ResourcesResource.prototype, "id", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], ResourcesResource.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], ResourcesResource.prototype, "organizationId", 2);
__decorateClass([
  Property({ type: "text" })
], ResourcesResource.prototype, "name", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], ResourcesResource.prototype, "description", 2);
__decorateClass([
  Property({ name: "resource_type_id", type: "uuid", nullable: true })
], ResourcesResource.prototype, "resourceTypeId", 2);
__decorateClass([
  Property({ type: "int", nullable: true })
], ResourcesResource.prototype, "capacity", 2);
__decorateClass([
  Property({ name: "capacity_unit_value", type: "text", nullable: true })
], ResourcesResource.prototype, "capacityUnitValue", 2);
__decorateClass([
  Property({ name: "capacity_unit_name", type: "text", nullable: true })
], ResourcesResource.prototype, "capacityUnitName", 2);
__decorateClass([
  Property({ name: "capacity_unit_color", type: "text", nullable: true })
], ResourcesResource.prototype, "capacityUnitColor", 2);
__decorateClass([
  Property({ name: "capacity_unit_icon", type: "text", nullable: true })
], ResourcesResource.prototype, "capacityUnitIcon", 2);
__decorateClass([
  Property({ name: "appearance_icon", type: "text", nullable: true })
], ResourcesResource.prototype, "appearanceIcon", 2);
__decorateClass([
  Property({ name: "appearance_color", type: "text", nullable: true })
], ResourcesResource.prototype, "appearanceColor", 2);
__decorateClass([
  Property({ name: "is_active", type: "boolean", default: true })
], ResourcesResource.prototype, "isActive", 2);
__decorateClass([
  Property({ name: "availability_rule_set_id", type: "uuid", nullable: true })
], ResourcesResource.prototype, "availabilityRuleSetId", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], ResourcesResource.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], ResourcesResource.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], ResourcesResource.prototype, "deletedAt", 2);
ResourcesResource = __decorateClass([
  Entity({ tableName: "resources_resources" }),
  Index({ name: "resources_resources_tenant_org_idx", properties: ["tenantId", "organizationId"] })
], ResourcesResource);
let ResourcesResourceComment = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], ResourcesResourceComment.prototype, "id", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], ResourcesResourceComment.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], ResourcesResourceComment.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "body", type: "text" })
], ResourcesResourceComment.prototype, "body", 2);
__decorateClass([
  Property({ name: "author_user_id", type: "uuid", nullable: true })
], ResourcesResourceComment.prototype, "authorUserId", 2);
__decorateClass([
  Property({ name: "appearance_icon", type: "text", nullable: true })
], ResourcesResourceComment.prototype, "appearanceIcon", 2);
__decorateClass([
  Property({ name: "appearance_color", type: "text", nullable: true })
], ResourcesResourceComment.prototype, "appearanceColor", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceComment.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceComment.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], ResourcesResourceComment.prototype, "deletedAt", 2);
__decorateClass([
  ManyToOne(() => ResourcesResource, { fieldName: "resource_id" })
], ResourcesResourceComment.prototype, "resource", 2);
ResourcesResourceComment = __decorateClass([
  Entity({ tableName: "resources_resource_comments" }),
  Index({ name: "resources_resource_comments_resource_idx", properties: ["resource"] }),
  Index({ name: "resources_resource_comments_tenant_org_idx", properties: ["tenantId", "organizationId"] })
], ResourcesResourceComment);
let ResourcesResourceActivity = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], ResourcesResourceActivity.prototype, "id", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], ResourcesResourceActivity.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], ResourcesResourceActivity.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "activity_type", type: "text" })
], ResourcesResourceActivity.prototype, "activityType", 2);
__decorateClass([
  Property({ name: "subject", type: "text", nullable: true })
], ResourcesResourceActivity.prototype, "subject", 2);
__decorateClass([
  Property({ name: "body", type: "text", nullable: true })
], ResourcesResourceActivity.prototype, "body", 2);
__decorateClass([
  Property({ name: "occurred_at", type: Date, nullable: true })
], ResourcesResourceActivity.prototype, "occurredAt", 2);
__decorateClass([
  Property({ name: "author_user_id", type: "uuid", nullable: true })
], ResourcesResourceActivity.prototype, "authorUserId", 2);
__decorateClass([
  Property({ name: "appearance_icon", type: "text", nullable: true })
], ResourcesResourceActivity.prototype, "appearanceIcon", 2);
__decorateClass([
  Property({ name: "appearance_color", type: "text", nullable: true })
], ResourcesResourceActivity.prototype, "appearanceColor", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceActivity.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceActivity.prototype, "updatedAt", 2);
__decorateClass([
  ManyToOne(() => ResourcesResource, { fieldName: "resource_id" })
], ResourcesResourceActivity.prototype, "resource", 2);
ResourcesResourceActivity = __decorateClass([
  Entity({ tableName: "resources_resource_activities" }),
  Index({ name: "resources_resource_activities_resource_idx", properties: ["resource"] }),
  Index({ name: "resources_resource_activities_tenant_org_idx", properties: ["tenantId", "organizationId"] }),
  Index({ name: "resources_resource_activities_resource_occurred_created_idx", properties: ["resource", "occurredAt", "createdAt"] })
], ResourcesResourceActivity);
let ResourcesResourceTag = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
    this.assignments = new Collection(this);
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], ResourcesResourceTag.prototype, "id", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], ResourcesResourceTag.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], ResourcesResourceTag.prototype, "tenantId", 2);
__decorateClass([
  Property({ type: "text" })
], ResourcesResourceTag.prototype, "slug", 2);
__decorateClass([
  Property({ type: "text" })
], ResourcesResourceTag.prototype, "label", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], ResourcesResourceTag.prototype, "color", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], ResourcesResourceTag.prototype, "description", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceTag.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceTag.prototype, "updatedAt", 2);
__decorateClass([
  OneToMany(() => ResourcesResourceTagAssignment, (assignment) => assignment.tag)
], ResourcesResourceTag.prototype, "assignments", 2);
ResourcesResourceTag = __decorateClass([
  Entity({ tableName: "resources_resource_tags" }),
  Index({ name: "resources_resource_tags_scope_idx", properties: ["organizationId", "tenantId"] }),
  Unique({ name: "resources_resource_tags_slug_unique", properties: ["organizationId", "tenantId", "slug"] })
], ResourcesResourceTag);
let ResourcesResourceTagAssignment = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], ResourcesResourceTagAssignment.prototype, "id", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], ResourcesResourceTagAssignment.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], ResourcesResourceTagAssignment.prototype, "tenantId", 2);
__decorateClass([
  ManyToOne(() => ResourcesResourceTag, { fieldName: "tag_id" })
], ResourcesResourceTagAssignment.prototype, "tag", 2);
__decorateClass([
  ManyToOne(() => ResourcesResource, { fieldName: "resource_id" })
], ResourcesResourceTagAssignment.prototype, "resource", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceTagAssignment.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], ResourcesResourceTagAssignment.prototype, "updatedAt", 2);
ResourcesResourceTagAssignment = __decorateClass([
  Entity({ tableName: "resources_resource_tag_assignments" }),
  Index({ name: "resources_resource_tag_assignments_scope_idx", properties: ["organizationId", "tenantId"] }),
  Unique({
    name: "resources_resource_tag_assignments_unique",
    properties: ["tag", "resource"]
  })
], ResourcesResourceTagAssignment);
export {
  ResourcesResource,
  ResourcesResourceActivity,
  ResourcesResourceComment,
  ResourcesResourceTag,
  ResourcesResourceTagAssignment,
  ResourcesResourceType
};
//# sourceMappingURL=entities.js.map
