Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convo backend fix + Unit Test for Interactor and Controller + minor changes for Convo Frontend #152

Merged
merged 5 commits into from
Aug 13, 2023

Conversation

yiwxng
Copy link
Contributor

@yiwxng yiwxng commented Aug 13, 2023

What:

  • fixed conversation list (CL) controller, DsResponseModel, DsGateway, Input Boundary, Interactor
  • added unittest for CL controller and interactor
  • added some unit test for DBhelperTest
  • made minor changes to CL frontend since backend changed a bit
  • made changes under MatchList so that in backend, when a match is created, a conversation is also created in the database

Why:

  • the changes were made to address issues with the conversation list (CL) controller, DsResponseModel, DsGateway, Input Boundary, and Interactor.
  • unit tests were added to ensure the correctness of the CL controller and interactor.
  • additional unit tests were included for the DBhelperTest.
  • minor adjustments were performed on the CL frontend to accommodate backend modifications.
  • modifications were made within the MatchList to ensure that the creation of a match also results in the creation of a corresponding conversation in the database.

Implementation Detail:

  1. ConversationListController:
  • interface Adapter Layer linking UI to Interactor.
  • receives UI requests and communicates with the Interactor.
  • call the "get active conversation" function in the Interactor.
  1. ConversationListInputBoundary:
  • interface serving as a contract between the controller and use cases.
  • defines methods for controller-use case interaction.
  • includes getAllActiveConversations(String userId) to fetch active conversations for a user.
  • renaming to updateAllConversations for clarity.
  1. ConversationListInteractor:
  • implements methods from ConversationListInputBoundary.
  • links controller to the database gateway.
  • uses ConversationListDsGateway for data interaction.
  • implements getAllActiveConversations(String userId) to retrieve active conversations.
  • utilizes conversationListDsGateway for reading conversation list, last messages, and display names.
  • constructs ConversationResponseModel objects to encapsulate UI display data.
  • returns these models in an ArrayList to the controller.
  1. ConversationResponseModel:
  • represents an entity class for UI conversation display.
  • fields in constructor: userName, lastMessage, lastMessageTime, conversationPartnerId, conversationPartnerName.
  • encapsulates partner, last message, and time data.
  • getter methods grant access to encapsulated info.

@yiwxng yiwxng added the enhancement New feature or request label Aug 13, 2023
@yiwxng yiwxng self-assigned this Aug 13, 2023
@jenniferjinyoungyang
Copy link
Contributor

looks good to me :)

Copy link
Contributor

@kresimirgotovac kresimirgotovac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, needs to be merged ASAP as possible

@jenniferjinyoungyang jenniferjinyoungyang merged commit f34091a into main Aug 13, 2023
@jenniferjinyoungyang jenniferjinyoungyang deleted the convo-backend-fix branch August 13, 2023 17:43
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.

[ Feature 150 ] finishing Conversation Backend Logic
4 participants