Refactor backend into domain-first slices

This commit is contained in:
2026-03-19 18:15:44 -04:00
parent 07a3142316
commit 9a5040cf1f
53 changed files with 94 additions and 140 deletions

View File

@@ -0,0 +1,47 @@
namespace SpaceGame.Api.Economy.Contracts;
public sealed record MarketOrderSnapshot(
string Id,
string FactionId,
string? StationId,
string? ConstructionSiteId,
string Kind,
string ItemId,
float Amount,
float RemainingAmount,
float Valuation,
float? ReserveThreshold,
string? PolicySetId,
string State);
public sealed record MarketOrderDelta(
string Id,
string FactionId,
string? StationId,
string? ConstructionSiteId,
string Kind,
string ItemId,
float Amount,
float RemainingAmount,
float Valuation,
float? ReserveThreshold,
string? PolicySetId,
string State);
public sealed record PolicySetSnapshot(
string Id,
string OwnerKind,
string OwnerId,
string TradeAccessPolicy,
string DockingAccessPolicy,
string ConstructionAccessPolicy,
string OperationalRangePolicy);
public sealed record PolicySetDelta(
string Id,
string OwnerKind,
string OwnerId,
string TradeAccessPolicy,
string DockingAccessPolicy,
string ConstructionAccessPolicy,
string OperationalRangePolicy);

View File

@@ -0,0 +1,30 @@
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 LastDeltaSignature { get; set; } = string.Empty;
}