Skip to content

MPT-19028 Add helpdesk chat messages service#234

Open
jentyk wants to merge 1 commit intomainfrom
feat/MPT-19028
Open

MPT-19028 Add helpdesk chat messages service#234
jentyk wants to merge 1 commit intomainfrom
feat/MPT-19028

Conversation

@jentyk
Copy link
Contributor

@jentyk jentyk commented Mar 16, 2026

Summary

  • introduce ChatMessagesService/AsyncChatMessagesService with full CRUD/list mixins and shared config under /public/v1/helpdesk/chats/{chat_id}/messages
  • expose chats().messages(chat_id) on both sync and async chat services and wire new resource into tests
  • add unit coverage for endpoint wiring/method presence plus dedicated helpdesk chat messages e2e suites covering list/create/update/delete and error paths

Testing

  • Not run (not requested)

Closes MPT-19028

  • Add ChatMessagesService and AsyncChatMessagesService with full CRUD and collection capabilities
  • Mount chat messages service at /public/v1/helpdesk/chats/{chat_id}/messages
  • Expose chats().messages(chat_id) factory method on both synchronous and asynchronous chat services
  • Add unit test coverage for endpoint wiring and method presence verification
  • Add comprehensive end-to-end test suites for list, create, update, delete, and error handling operations

@jentyk jentyk requested a review from a team as a code owner March 16, 2026 16:39
@jentyk jentyk requested review from albertsola and alephsur March 16, 2026 16:39
@jentyk jentyk marked this pull request as draft March 16, 2026 16:39
@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

This PR introduces Helpdesk Chat Messages support by adding a new service module with synchronous and asynchronous clients providing CRUD operations. It integrates chat messages into existing chat services via accessor methods and includes comprehensive unit and end-to-end test coverage.

Changes

Cohort / File(s) Summary
Service Implementation
mpt_api_client/resources/helpdesk/chat_messages.py, mpt_api_client/resources/helpdesk/chats.py
New ChatMessage model and ChatMessagesService/AsyncChatMessagesService classes with Create, Update, Delete, and Collection mixins. Integration of messages() accessor methods in ChatsService and AsyncChatsService to route to chat message services with proper endpoint parameters.
Unit Tests
tests/unit/resources/helpdesk/test_chat_messages.py, tests/unit/resources/helpdesk/test_chats.py
Test fixtures and parameterized tests verifying CRUD method presence on both sync and async chat message services. Validation of messages() accessor factory behavior and endpoint parameter configuration.
E2E Tests
tests/e2e/helpdesk/chats/messages/conftest.py, tests/e2e/helpdesk/chats/messages/test_sync_messages.py, tests/e2e/helpdesk/chats/messages/test_async_messages.py
Test fixtures for chat message service instantiation, message creation/deletion context managers, and payload templates. End-to-end tests for list, create, update, delete operations and 404 error handling on both synchronous and asynchronous endpoints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • PR #227: Introduces ChatsService for Helpdesk chats resource, providing the foundation that this PR extends with ChatMessages support and accessor methods.

🔕 Pre-merge checks override applied

The pre-merge checks have been overridden successfully. You can now proceed with the merge.

Overridden by @jentyk via checkbox on 2026-03-16T17:19:14.639Z.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Jira Issue Key In Title ❌ Error [IGNORED] The PR title 'Add helpdesk chat messages service' does not contain a Jira issue key in the format MPT-XXXX. Update the PR title to include the Jira issue key, e.g., 'MPT-19028: Add helpdesk chat messages service'.
✅ Passed checks (2 passed)
Check name Status Explanation
Test Coverage Required ✅ Passed The PR modifies 2 code files in the main codebase and includes 5 test files across both unit and end-to-end test suites.
Single Commit Required ✅ Passed The PR contains exactly one commit (be51463: Implement Helpdesk chat messages) as verified by git history, meeting the requirement for clean git history.
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@jentyk jentyk marked this pull request as ready for review March 16, 2026 17:11
@jentyk jentyk changed the title Add helpdesk chat messages service MPT-19028 Add helpdesk chat messages service Mar 16, 2026
@jentyk
Copy link
Contributor Author

jentyk commented Mar 16, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant