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, Enum, Index, PrimaryKey, Property } from "@mikro-orm/decorators/legacy";
let PlannerAvailabilityRuleSet = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], PlannerAvailabilityRuleSet.prototype, "id", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], PlannerAvailabilityRuleSet.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], PlannerAvailabilityRuleSet.prototype, "organizationId", 2);
__decorateClass([
  Property({ type: "text" })
], PlannerAvailabilityRuleSet.prototype, "name", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], PlannerAvailabilityRuleSet.prototype, "description", 2);
__decorateClass([
  Property({ type: "text" })
], PlannerAvailabilityRuleSet.prototype, "timezone", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], PlannerAvailabilityRuleSet.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], PlannerAvailabilityRuleSet.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], PlannerAvailabilityRuleSet.prototype, "deletedAt", 2);
PlannerAvailabilityRuleSet = __decorateClass([
  Entity({ tableName: "planner_availability_rule_sets" }),
  Index({ name: "planner_availability_rule_sets_tenant_org_idx", properties: ["tenantId", "organizationId"] })
], PlannerAvailabilityRuleSet);
let PlannerAvailabilityRule = class {
  constructor() {
    this.exdates = [];
    this.kind = "availability";
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], PlannerAvailabilityRule.prototype, "id", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], PlannerAvailabilityRule.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], PlannerAvailabilityRule.prototype, "organizationId", 2);
__decorateClass([
  Enum({ items: ["member", "resource", "ruleset"], type: "text", name: "subject_type" })
], PlannerAvailabilityRule.prototype, "subjectType", 2);
__decorateClass([
  Property({ name: "subject_id", type: "uuid" })
], PlannerAvailabilityRule.prototype, "subjectId", 2);
__decorateClass([
  Property({ type: "text" })
], PlannerAvailabilityRule.prototype, "timezone", 2);
__decorateClass([
  Property({ type: "text" })
], PlannerAvailabilityRule.prototype, "rrule", 2);
__decorateClass([
  Property({ type: "jsonb", default: [] })
], PlannerAvailabilityRule.prototype, "exdates", 2);
__decorateClass([
  Enum({ items: ["availability", "unavailability"], type: "text", name: "kind" })
], PlannerAvailabilityRule.prototype, "kind", 2);
__decorateClass([
  Property({ type: "text", nullable: true })
], PlannerAvailabilityRule.prototype, "note", 2);
__decorateClass([
  Property({ name: "unavailability_reason_entry_id", type: "uuid", nullable: true })
], PlannerAvailabilityRule.prototype, "unavailabilityReasonEntryId", 2);
__decorateClass([
  Property({ name: "unavailability_reason_value", type: "text", nullable: true })
], PlannerAvailabilityRule.prototype, "unavailabilityReasonValue", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], PlannerAvailabilityRule.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], PlannerAvailabilityRule.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], PlannerAvailabilityRule.prototype, "deletedAt", 2);
PlannerAvailabilityRule = __decorateClass([
  Entity({ tableName: "planner_availability_rules" }),
  Index({ name: "planner_availability_rules_tenant_org_idx", properties: ["tenantId", "organizationId"] }),
  Index({ name: "planner_availability_rules_subject_idx", properties: ["subjectType", "subjectId", "tenantId", "organizationId"] })
], PlannerAvailabilityRule);
export {
  PlannerAvailabilityRule,
  PlannerAvailabilityRuleSet
};
//# sourceMappingURL=entities.js.map
