namespace SpaceGame.Api.Economy.Runtime;

public sealed class MarketOrderRuntime
{
    public required string Id { get; init; }
    public required string FactionId { get; init; }
    public string? StationId { get; init; }
    public string? ConstructionSiteId { get; init; }
    public required string Kind { get; init; }
    public required string ItemId { get; init; }
    public float Amount { get; init; }
    public float RemainingAmount { get; set; }
    public float Valuation { get; set; }
    public float? ReserveThreshold { get; set; }
    public string? PolicySetId { get; set; }
    public string State { get; set; } = MarketOrderStateKinds.Open;
    public string LastDeltaSignature { get; set; } = string.Empty;
}

public sealed class PolicySetRuntime
{
    public required string Id { get; init; }
    public required string OwnerKind { get; init; }
    public required string OwnerId { get; init; }
    public string TradeAccessPolicy { get; set; } = "owner-and-allies";
    public string DockingAccessPolicy { get; set; } = "owner-and-allies";
    public string ConstructionAccessPolicy { get; set; } = "owner-only";
    public string OperationalRangePolicy { get; set; } = "unrestricted";
    public string CombatEngagementPolicy { get; set; } = "defensive";
    public bool AvoidHostileSystems { get; set; } = true;
    public float FleeHullRatio { get; set; } = 0.35f;
    public HashSet<string> BlacklistedSystemIds { get; } = new(StringComparer.Ordinal);
    public string LastDeltaSignature { get; set; } = string.Empty;
}
