refactor(guild_chat): extract chat-user lookup to viewer repo; fix NEW-direction exclusivity

Add ChatUserProfile record and IViewerRepository.LoadChatProfilesAsync (AsNoTracking,
projects Name/EmblemId/CountryCode/Rank/DegreeId from Viewer+Info nav refs).
GuildChatController.Messages now injects IViewerRepository instead of SVSimDbContext;
calls LoadChatProfilesAsync to populate users[] (removes direct db access from controller).
GuildChatMessageRepository direction=2 (NEW): change >= start to > start (exclusive).
GuildChatPollTests updated to assert the start message is NOT returned by direction=NEW.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-27 14:51:44 -04:00
parent 358f43aa7a
commit a248c167e0
5 changed files with 74 additions and 29 deletions

View File

@@ -102,9 +102,9 @@ public sealed class GuildChatMessageRepository : IGuildChatMessageRepository
.OrderBy(m => m.MessageId)
.ToListAsync(ct);
case 2: // NEW — messages newer than (and including) start
case 2: // NEW: strictly newer than start (exclusive)
return await baseQ
.Where(m => m.MessageId >= start)
.Where(m => m.MessageId > start)
.OrderBy(m => m.MessageId)
.Take(limit)
.ToListAsync(ct);