// src/interfaces/drone-registration.ts
// Copyright (C) 2026 Rob Colbert <rob.colbert@openplatform.us>
// Licensed under the Apache License, Version 2.0

import { HydratedDocument } from "mongoose";

import { IUser } from "./user.ts";
import { GadgetId } from "../lib/gadget-id.ts";

export enum DroneStatus {
  Starting = "starting",
  Available = "available",
  Busy = "busy",
  Offline = "offline",
}

export interface IDroneRegistration {
  _id: GadgetId;
  createdAt: Date;
  updatedAt: Date;
  user: IUser | GadgetId;
  hostname: string;
  workspaceDir: string;
  workspaceId: string;
  status: DroneStatus;
  chatSessionId?: string;
  currentJobId?: string;
}

export type DroneRegistrationDocument = HydratedDocument<IDroneRegistration>;
