19 lines
671 B
C#
19 lines
671 B
C#
namespace NeonSprawl.Server.Game.Contracts;
|
|
|
|
/// <summary>Id normalization and idempotency keys for contract outcome audit rows (NEO-146).</summary>
|
|
public static class ContractOutcomeIds
|
|
{
|
|
/// <summary>Stable idempotency key for contract completion delivery.</summary>
|
|
public static string MakeIdempotencyKey(string? playerId, string? contractInstanceId)
|
|
{
|
|
var p = ContractInstanceIds.NormalizePlayerId(playerId);
|
|
var i = ContractInstanceIds.NormalizeContractInstanceId(contractInstanceId);
|
|
if (p.Length == 0 || i.Length == 0)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
return $"{p}:contract_complete:{i}";
|
|
}
|
|
}
|