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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user