export interface SystemRouteLinkSnapshot {
  id: string;
  sourceSystemId: string;
  destinationSystemId: string;
  distance: number;
  isPrimaryLane: boolean;
}

export interface DiplomaticRelationSnapshot {
  id: string;
  factionAId: string;
  factionBId: string;
  status: string;
  posture: string;
  trustScore: number;
  tensionScore: number;
  grievanceScore: number;
  tradeAccessPolicy: string;
  militaryAccessPolicy: string;
  warStateId?: string | null;
  ceasefireUntilUtc?: string | null;
  updatedAtUtc: string;
  activeTreatyIds: string[];
  activeIncidentIds: string[];
}

export interface TreatySnapshot {
  id: string;
  kind: string;
  status: string;
  tradeAccessPolicy: string;
  militaryAccessPolicy: string;
  summary?: string | null;
  createdAtUtc: string;
  updatedAtUtc: string;
  factionIds: string[];
}

export interface DiplomaticIncidentSnapshot {
  id: string;
  kind: string;
  status: string;
  sourceFactionId: string;
  targetFactionId: string;
  systemId?: string | null;
  borderEdgeId?: string | null;
  summary: string;
  severity: number;
  escalationScore: number;
  createdAtUtc: string;
  lastObservedAtUtc: string;
}

export interface BorderTensionSnapshot {
  id: string;
  relationId: string;
  borderEdgeId: string;
  factionAId: string;
  factionBId: string;
  status: string;
  tensionScore: number;
  incidentScore: number;
  militaryPressure: number;
  accessFriction: number;
  updatedAtUtc: string;
  systemIds: string[];
}

export interface WarStateSnapshot {
  id: string;
  relationId: string;
  factionAId: string;
  factionBId: string;
  status: string;
  warGoal: string;
  escalationScore: number;
  startedAtUtc: string;
  ceasefireUntilUtc?: string | null;
  updatedAtUtc: string;
  activeFrontLineIds: string[];
}

export interface DiplomaticStateSnapshot {
  relations: DiplomaticRelationSnapshot[];
  treaties: TreatySnapshot[];
  incidents: DiplomaticIncidentSnapshot[];
  borderTensions: BorderTensionSnapshot[];
  wars: WarStateSnapshot[];
}

export interface TerritoryClaimSnapshot {
  id: string;
  sourceClaimId?: string | null;
  factionId: string;
  systemId: string;
  celestialId?: string | null;
  status: string;
  claimKind: string;
  claimStrength: number;
  updatedAtUtc: string;
}

export interface TerritoryInfluenceSnapshot {
  id: string;
  systemId: string;
  factionId: string;
  claimStrength: number;
  assetStrength: number;
  logisticsStrength: number;
  totalInfluence: number;
  isContesting: boolean;
  updatedAtUtc: string;
}

export interface TerritoryControlStateSnapshot {
  systemId: string;
  controllerFactionId?: string | null;
  primaryClaimantFactionId?: string | null;
  controlKind: string;
  isContested: boolean;
  controlScore: number;
  strategicValue: number;
  updatedAtUtc: string;
  claimantFactionIds: string[];
  influencingFactionIds: string[];
}

export interface SectorStrategicProfileSnapshot {
  systemId: string;
  controllerFactionId?: string | null;
  zoneKind: string;
  isContested: boolean;
  strategicValue: number;
  securityRating: number;
  territorialPressure: number;
  logisticsValue: number;
  updatedAtUtc: string;
  economicRegionId?: string | null;
  frontLineId?: string | null;
}

export interface BorderEdgeSnapshot {
  id: string;
  sourceSystemId: string;
  destinationSystemId: string;
  sourceFactionId?: string | null;
  destinationFactionId?: string | null;
  isContested: boolean;
  relationId?: string | null;
  tensionScore: number;
  corridorImportance: number;
  updatedAtUtc: string;
}

export interface FrontLineSnapshot {
  id: string;
  kind: string;
  status: string;
  anchorSystemId?: string | null;
  pressureScore: number;
  supplyRisk: number;
  updatedAtUtc: string;
  factionIds: string[];
  systemIds: string[];
  borderEdgeIds: string[];
}

export interface TerritoryZoneSnapshot {
  id: string;
  systemId: string;
  factionId?: string | null;
  kind: string;
  status: string;
  reason?: string | null;
  updatedAtUtc: string;
}

export interface TerritoryPressureSnapshot {
  id: string;
  systemId: string;
  factionId?: string | null;
  kind: string;
  pressureScore: number;
  securityScore: number;
  hostileInfluence: number;
  corridorRisk: number;
  updatedAtUtc: string;
}

export interface TerritoryStateSnapshot {
  claims: TerritoryClaimSnapshot[];
  influences: TerritoryInfluenceSnapshot[];
  controlStates: TerritoryControlStateSnapshot[];
  strategicProfiles: SectorStrategicProfileSnapshot[];
  borderEdges: BorderEdgeSnapshot[];
  frontLines: FrontLineSnapshot[];
  zones: TerritoryZoneSnapshot[];
  pressures: TerritoryPressureSnapshot[];
}

export interface EconomicRegionSnapshot {
  id: string;
  factionId?: string | null;
  label: string;
  kind: string;
  status: string;
  coreSystemId: string;
  updatedAtUtc: string;
  systemIds: string[];
  stationIds: string[];
  frontLineIds: string[];
  corridorIds: string[];
}

export interface SupplyNetworkSnapshot {
  id: string;
  regionId: string;
  throughputScore: number;
  riskScore: number;
  updatedAtUtc: string;
  stationIds: string[];
  producerItemIds: string[];
  consumerItemIds: string[];
  constructionItemIds: string[];
}

export interface LogisticsCorridorSnapshot {
  id: string;
  factionId?: string | null;
  kind: string;
  status: string;
  riskScore: number;
  throughputScore: number;
  accessState: string;
  updatedAtUtc: string;
  systemPathIds: string[];
  regionIds: string[];
  borderEdgeIds: string[];
}

export interface RegionalProductionProfileSnapshot {
  regionId: string;
  primaryIndustry: string;
  shipyardCount: number;
  stationCount: number;
  updatedAtUtc: string;
  producedItemIds: string[];
  scarceItemIds: string[];
}

export interface RegionalTradeBalanceSnapshot {
  regionId: string;
  importsRequiredCount: number;
  exportsSurplusCount: number;
  criticalShortageCount: number;
  netTradeScore: number;
  updatedAtUtc: string;
}

export interface RegionalBottleneckSnapshot {
  id: string;
  regionId: string;
  itemId: string;
  cause: string;
  status: string;
  severity: number;
  updatedAtUtc: string;
}

export interface RegionalSecurityAssessmentSnapshot {
  regionId: string;
  supplyRisk: number;
  borderPressure: number;
  activeWarCount: number;
  hostileRelationCount: number;
  accessFriction: number;
  updatedAtUtc: string;
}

export interface RegionalEconomicAssessmentSnapshot {
  regionId: string;
  sustainmentScore: number;
  productionDepth: number;
  constructionPressure: number;
  corridorDependency: number;
  updatedAtUtc: string;
}

export interface EconomyRegionStateSnapshot {
  regions: EconomicRegionSnapshot[];
  supplyNetworks: SupplyNetworkSnapshot[];
  corridors: LogisticsCorridorSnapshot[];
  productionProfiles: RegionalProductionProfileSnapshot[];
  tradeBalances: RegionalTradeBalanceSnapshot[];
  bottlenecks: RegionalBottleneckSnapshot[];
  securityAssessments: RegionalSecurityAssessmentSnapshot[];
  economicAssessments: RegionalEconomicAssessmentSnapshot[];
}

export interface GeopoliticalStateSnapshot {
  cycle: number;
  updatedAtUtc: string;
  routes: SystemRouteLinkSnapshot[];
  diplomacy: DiplomaticStateSnapshot;
  territory: TerritoryStateSnapshot;
  economyRegions: EconomyRegionStateSnapshot;
}
