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

@@ -12,6 +12,14 @@ public interface IGuildChatMessageRepository
Task<IReadOnlyList<GuildChatMessage>> GetWindowAsync(int guildId, int start, int direction, int limit, CancellationToken ct = default);
Task<int> GetMaxMessageIdAsync(int guildId, CancellationToken ct = default);
/// <summary>
/// Returns the highest message_id for the guild, or null if no messages exist.
/// Adapts <see cref="GetMaxMessageIdAsync"/> (which returns 0 when empty) for callers
/// that need null-vs-present semantics (e.g. GuildNotification.guild_room_message_id).
/// </summary>
Task<long?> GetMaxMessageIdSafelyAsync(int guildId, CancellationToken ct = default);
Task DeleteAllForGuildAsync(int guildId, CancellationToken ct = default);
/// <summary>Fetch a single message by (guildId, messageId). Returns null if not found.</summary>