feat(guild): MyPage guild_notification + load_index audit

- Replace GuildNotification TODO stub in MyPageController.Index with
  BuildGuildNotificationAsync: populates guild_id, guild_room_message_id,
  is_join_request, is_invited from real DB state.
- Inject IGuildService, IGuildInviteRepository, IGuildJoinRequestRepository,
  IGuildChatMessageRepository into MyPageController.
- Add GetMaxMessageIdSafelyAsync to IGuildChatMessageRepository (returns null
  when no messages exist, vs GetMaxMessageIdAsync which returns 0).
- LoadDetail.cs audit: grep returned no guild fields — no LoadController changes.
- Add GuildCrossSurfaceTests (4 tests): guild member, pending invite, pending
  join request, no-guild viewer all verified green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-27 15:24:46 -04:00
parent eb65c2081c
commit d62f1b7ba7
4 changed files with 244 additions and 2 deletions

View File

@@ -142,6 +142,12 @@ public sealed class GuildChatMessageRepository : IGuildChatMessageRepository
return max ?? 0;
}
public async Task<long?> GetMaxMessageIdSafelyAsync(int guildId, CancellationToken ct = default)
{
var v = await GetMaxMessageIdAsync(guildId, ct);
return v == 0 ? null : (long?)v;
}
public async Task DeleteAllForGuildAsync(int guildId, CancellationToken ct = default)
{
var messages = await _db.GuildChatMessages.Where(m => m.GuildId == guildId).ToListAsync(ct);