neon-sprawl/server/NeonSprawl.Server/Game/Contracts/IContractOutcomeStore.cs

17 lines
864 B
C#

namespace NeonSprawl.Server.Game.Contracts;
/// <summary>Append-only contract completion outcome audit log (NEO-146).</summary>
public interface IContractOutcomeStore
{
/// <summary>First append with a given row <c>Id</c> or <c>IdempotencyKey</c> returns <c>true</c>; duplicates return <c>false</c>.</summary>
bool TryAppend(ContractOutcomeRow row);
bool TryGetByIdempotencyKey(string idempotencyKey, out ContractOutcomeRow row);
/// <summary>Audit rows for one instance ordered by <see cref="ContractOutcomeRow.RecordedAt"/> then <c>Id</c> ascending.</summary>
IReadOnlyList<ContractOutcomeRow> GetOutcomesForInstance(string contractInstanceId, int? limit = null);
/// <summary>Dev fixture only — removes outcome rows for one instance; idempotent when none match.</summary>
bool TryClearForInstance(string contractInstanceId);
}