fix(guild): populate leader_name in search results (matches prod capture)

Add IViewerRepository.LoadDisplayNamesAsync (batch AsNoTracking select),
extend GuildSearchEntry with LeaderName, enrich GuildService.SearchAsync
with a leader-id batch lookup, and thread the name through the controller's
ToDetailDto call. Adds a leader_name assertion to GuildSearchFlowTests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-27 13:08:11 -04:00
parent 3f8f04eb1a
commit c103ab6a87
6 changed files with 26 additions and 4 deletions

View File

@@ -231,5 +231,8 @@ public class GuildSearchFlowTests
Assert.That(entry.TryGetProperty("detail", out _), Is.False, "no 'detail' wrapper on search list entries");
Assert.That(entry.TryGetProperty("guild_name", out var gn), Is.True);
Assert.That(gn.GetString(), Is.EqualTo("SmallFreeGuild"));
// leader_name must be populated from the seeded viewer's DisplayName, not empty string
Assert.That(entry.TryGetProperty("leader_name", out var ln), Is.True, "leader_name field must be present");
Assert.That(ln.GetString(), Is.EqualTo("SearchLeader7"), "leader_name must match the seeded leader's DisplayName");
}
}