namespace NeonSprawl.Server.Game.Quests;
///
/// Persisted per-player quest progress keyed by (playerId, questId) (NEO-116).
/// Missing row ⇒ not_started. QuestStateOperations (NEO-117) and HTTP (E7M1-08) consume this interface.
///
public interface IPlayerQuestStateStore
{
/// True when mutations for are allowed (dev bucket or Postgres player_position row).
bool CanWritePlayer(string playerId);
/// Missing row ⇒ false (callers treat as not_started).
bool TryGetProgress(string playerId, string questId, out QuestStepState snapshot);
/// Creates an active row at step 0 with empty counters. Returns false when already active/completed or player cannot be written.
bool TryActivate(string playerId, string questId, out QuestStepState snapshot);
/// Requires an active row; sets step index and clears objective counters. Denies when completed or is not greater than current.
bool TryAdvanceStep(string playerId, string questId, int newStepIndex, out QuestStepState snapshot);
/// Requires an active row; sets one objective counter (non-negative). Denies when completed.
bool TryUpdateObjectiveCounter(
string playerId,
string questId,
string objectiveId,
int newCount,
out QuestStepState snapshot);
/// First completion returns true; replays return false without changing .
bool TryMarkComplete(string playerId, string questId, DateTimeOffset completedAt, out QuestStepState snapshot);
}