Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@amalcaraz
Copy link
Collaborator

Summary

This PR implements message status filtering functionality for the messages API, allowing users to filter messages by their processing status (PROCESSED, REMOVING, REMOVED).

Changes Made

Database Layer

  • Added MessageStatusDb model to track message processing status and reception time
  • Enhanced MessageDb model with one-to-one relationship to MessageStatusDb
  • Optimized query performance using contains_eager with explicit joins for efficient status filtering

API Layer

  • Added message_statuses query parameter (msgStatuses) to messages endpoints
  • Updated default filtering to include PROCESSED and REMOVING statuses by default
  • Enhanced message serialization to include status information in API responses

API Usage

GET /api/v0/messages?msgStatuses=PROCESSED,REMOVING
GET /api/v0/messages?msgStatuses=REMOVED

Testing

  • Verify filtering works with single and multiple statuses
  • Test API response includes correct status information
  • Confirm query performance with large datasets

Breaking Changes

None - this is a backwards-compatible enhancement.

@amalcaraz amalcaraz requested a review from nesitor June 11, 2025 13:54
@amalcaraz amalcaraz self-assigned this Jun 11, 2025
@amalcaraz amalcaraz added the enhancement New feature or request label Jun 11, 2025
@nesitor nesitor merged commit 7d5583c into main Jun 11, 2025
5 checks passed
@nesitor nesitor deleted the angel-feature_filter_messages_by_status branch June 11, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants