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 ProgressJob = class {
  constructor() {
    this.status = "pending";
    this.progressPercent = 0;
    this.processedCount = 0;
    this.cancellable = false;
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], ProgressJob.prototype, "id", 2);
__decorateClass([
  Property({ name: "job_type", type: "text" })
], ProgressJob.prototype, "jobType", 2);
__decorateClass([
  Property({ name: "name", type: "text" })
], ProgressJob.prototype, "name", 2);
__decorateClass([
  Property({ name: "description", type: "text", nullable: true })
], ProgressJob.prototype, "description", 2);
__decorateClass([
  Property({ name: "status", type: "text" })
], ProgressJob.prototype, "status", 2);
__decorateClass([
  Property({ name: "progress_percent", type: "smallint" })
], ProgressJob.prototype, "progressPercent", 2);
__decorateClass([
  Property({ name: "processed_count", type: "int" })
], ProgressJob.prototype, "processedCount", 2);
__decorateClass([
  Property({ name: "total_count", type: "int", nullable: true })
], ProgressJob.prototype, "totalCount", 2);
__decorateClass([
  Property({ name: "eta_seconds", type: "int", nullable: true })
], ProgressJob.prototype, "etaSeconds", 2);
__decorateClass([
  Property({ name: "started_by_user_id", type: "uuid", nullable: true })
], ProgressJob.prototype, "startedByUserId", 2);
__decorateClass([
  Property({ name: "started_at", type: Date, nullable: true })
], ProgressJob.prototype, "startedAt", 2);
__decorateClass([
  Property({ name: "heartbeat_at", type: Date, nullable: true })
], ProgressJob.prototype, "heartbeatAt", 2);
__decorateClass([
  Property({ name: "finished_at", type: Date, nullable: true })
], ProgressJob.prototype, "finishedAt", 2);
__decorateClass([
  Property({ name: "result_summary", type: "json", nullable: true })
], ProgressJob.prototype, "resultSummary", 2);
__decorateClass([
  Property({ name: "error_message", type: "text", nullable: true })
], ProgressJob.prototype, "errorMessage", 2);
__decorateClass([
  Property({ name: "error_stack", type: "text", nullable: true })
], ProgressJob.prototype, "errorStack", 2);
__decorateClass([
  Property({ name: "meta", type: "json", nullable: true })
], ProgressJob.prototype, "meta", 2);
__decorateClass([
  Property({ name: "cancellable", type: "boolean" })
], ProgressJob.prototype, "cancellable", 2);
__decorateClass([
  Property({ name: "cancelled_by_user_id", type: "uuid", nullable: true })
], ProgressJob.prototype, "cancelledByUserId", 2);
__decorateClass([
  Property({ name: "cancel_requested_at", type: Date, nullable: true })
], ProgressJob.prototype, "cancelRequestedAt", 2);
__decorateClass([
  Property({ name: "parent_job_id", type: "uuid", nullable: true })
], ProgressJob.prototype, "parentJobId", 2);
__decorateClass([
  Property({ name: "partition_index", type: "int", nullable: true })
], ProgressJob.prototype, "partitionIndex", 2);
__decorateClass([
  Property({ name: "partition_count", type: "int", nullable: true })
], ProgressJob.prototype, "partitionCount", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], ProgressJob.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid", nullable: true })
], ProgressJob.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], ProgressJob.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], ProgressJob.prototype, "updatedAt", 2);
ProgressJob = __decorateClass([
  Entity({ tableName: "progress_jobs" }),
  Index({ name: "progress_jobs_status_tenant_idx", properties: ["status", "tenantId"] }),
  Index({ name: "progress_jobs_type_tenant_idx", properties: ["jobType", "tenantId"] }),
  Index({ name: "progress_jobs_parent_idx", properties: ["parentJobId"] })
], ProgressJob);
export {
  ProgressJob
};
//# sourceMappingURL=entities.js.map
