import type { InventoryEntry, Vector3Dto } from "./contractsCommon";

export interface RecipeEntrySnapshot {
  itemId: string;
  amount: number;
}

export interface StationActionProgressSnapshot {
  lane: string;
  label: string;
  progress: number;
  timeRemainingSeconds: number;
  cycleSeconds: number;
  inputs: RecipeEntrySnapshot[];
  outputs: RecipeEntrySnapshot[];
}

export interface StationStorageUsageSnapshot {
  storageClass: string;
  used: number;
  capacity: number;
}

export interface StationSnapshot {
  id: string;
  label: string;
  category: string;
  objective: string;
  systemId: string;
  localPosition: Vector3Dto;
  celestialId?: string | null;
  color: string;
  dockedShips: number;
  dockedShipIds: string[];
  dockingPads: number;
  currentProcesses: StationActionProgressSnapshot[];
  inventory: InventoryEntry[];
  factionId: string;
  commanderId?: string | null;
  policySetId?: string | null;
  population: number;
  populationCapacity: number;
  workforceRequired: number;
  workforceEffectiveRatio: number;
  storageUsage: StationStorageUsageSnapshot[];
  installedModules: string[];
  marketOrderIds: string[];
}

export interface StationDelta extends StationSnapshot { }

export interface ClaimSnapshot {
  id: string;
  factionId: string;
  systemId: string;
  celestialId: string;
  state: string;
  health: number;
  placedAtUtc: string;
  activatesAtUtc: string;
}

export interface ClaimDelta extends ClaimSnapshot { }

export interface ConstructionSiteSnapshot {
  id: string;
  factionId: string;
  systemId: string;
  celestialId: string;
  targetKind: string;
  targetDefinitionId: string;
  blueprintId?: string | null;
  claimId?: string | null;
  stationId?: string | null;
  state: string;
  progress: number;
  inventory: InventoryEntry[];
  requiredItems: InventoryEntry[];
  deliveredItems: InventoryEntry[];
  assignedConstructorShipIds: string[];
  marketOrderIds: string[];
}

export interface ConstructionSiteDelta extends ConstructionSiteSnapshot { }
