feat: add message history, detail, recipient, and preview query services#109
Merged
kevinrutledge merged 1 commit intodevelopfrom Apr 5, 2026
Merged
feat: add message history, detail, recipient, and preview query services#109kevinrutledge merged 1 commit intodevelopfrom
kevinrutledge merged 1 commit intodevelopfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Developer
Kevin Rutledge
What changed?
Added query services, server actions, and tests for the message history and compose pages.
Four new service functions in message.ts - getAllMessageHistory() lists messages across all groups with optional senderId/channel filters and pagination. getMessageById() returns a single message with group name. getMessageRecipients() returns per-recipient delivery status with member names resolved via member API. previewRecipientCounts() returns email/SMS eligible and ineligible counts for a group before sending.
Three new server actions in contact-group.ts - fetchMessageHistory() shows all messages for admin, filtered to own messages for members. fetchMessageDetail() returns message + recipients with authorization (sender or admin only). fetchRecipientPreview() returns eligible counts with authorization (group owner or admin only).
SMS body length validation - added refine() to BaseMessageSchema that rejects body over 160 characters when sendSms is true. Enforces SMS segment limits at the Zod validation boundary.
New types - MessageHistoryItem, MessageDetail, RecipientStatus, and RecipientCounts exported from message.ts for frontend consumption.
How to test
Checklist