feat(mission): /mission/receive_reward stub (refresh-only, no decomp)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-12 23:33:50 -04:00
parent e54e63a762
commit 025c2a8c56
3 changed files with 60 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ using SVSim.Database.Repositories.Mission;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Mission;
using SVSim.EmulatedEntrypoint.Models.Dtos.Mission;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests.Mission;
using SVSim.EmulatedEntrypoint.Services;
namespace SVSim.EmulatedEntrypoint.Controllers;
@@ -133,6 +134,22 @@ public class MissionController : SVSimController
return Ok(dto);
}
[HttpPost("receive_reward")]
public async Task<IActionResult> ReceiveReward(MissionReceiveRewardRequest _, CancellationToken ct)
{
if (!TryGetViewerId(out long viewerId)) return Unauthorized();
// Spec is INFERRED — no decomp task class. Safe stub: refresh MissionInfoDetail
// so the client sees its current state. Real reward granting deferred until we
// observe a wire call.
var viewer = await LoadViewer(viewerId, ct);
await _state.EnsureCurrentAsync(viewer.Id, ct);
await _db.SaveChangesAsync(ct);
var dto = await _assembler.BuildAsync(viewer, ct);
return Ok(dto);
}
private Task<Viewer> LoadViewer(long viewerId, CancellationToken ct) =>
_db.Viewers
.Include(v => v.MissionData)