refactor(controllers): migrate practice/story/item_purchase to MissionEventKeys

PracticeController.Finish now uses MissionEventKeys.Practice.WinAll — the
counter keys emitted match the catalog's named form (practice_win:elite:arisa
etc.), closing the numeric-vs-named mismatch that had all practice-elite
achievements silently at zero. Also removes the "bridging is a follow-up" TODO.

StoryController.Finish uses MissionEventKeys.Story.ChapterFinishAll for the
same shape. ItemPurchaseController.CounterKey routes through
MissionEventKeys.ItemPurchase so the "item_purchase:" prefix has one owner.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-04 12:59:34 -04:00
parent fa89c32110
commit 652011ea74
2 changed files with 11 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SVSim.Database.Entities.Story;
using SVSim.Database.Services;
using SVSim.EmulatedEntrypoint.Models.Dtos.Story;
using SVSim.EmulatedEntrypoint.Services;
@@ -83,12 +84,8 @@ public class StoryController : SVSimController
};
if (prefix is not null && req.StoryId != 0)
{
await _missionProgress.RecordEventAsync(vid, new[]
{
"story_chapter_finish",
$"story_chapter_finish:{prefix}",
$"story_chapter_finish:{prefix}:{req.StoryId}",
});
await _missionProgress.RecordEventAsync(
vid, MissionEventKeys.Story.ChapterFinishAll(prefix, req.StoryId));
}
return result;