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

TRIB-289: adds AttributesApplyPhraseToUser DTO and in review notification #292

Merged

Conversation

mrsbluerose
Copy link
Collaborator

@mrsbluerose mrsbluerose commented Oct 4, 2024

  • Adds AttiributesApplyPhraseToUserDTO
  • Refactors AttributeAPI applyPhraseToUser endpoint to use new DTO
  • Refactors PhraseService applyPhraseToUser to use new DTO
  • Refactors AttributeAPI sendNotification with a third notification type for in review
  • Adds new notification type for in review
  • Updates database with new notification type

Testing:

  • updated tests with new DTO
  • added PhraseService tests for DTO builders (may not be necessary)
  • expected results returned in Postman

NOTE: changes data returned to the frontend!
Old implementation:
returned GenericResponseDTO.BooleanMessage

  • false: phrase was either rejected or put in toBeReviewed
  • true: phrase was applied to user

New implementation:
returns AttributesApplyPhraseToUserDTO with one field set to true and the rest to false.

  • isApproved = true: phrase was applied to user
  • isRejected = true: phrase was rejected
  • isInReivew = true: phrase was placed in toBeReviewed

- refactors PhraseService.applyPhraseToUser to return AttributesApplyPhraseToUserDTO
- refactors with new return type of AttributesApplyPhraseToUserDTO
- note: fixes logic error for testApplyPhraseToUserWhenPhraseDoesNotExistInToBeReviewed which was incorrectly finding a phrase in toBeReviewed repository
- removes context="test" from changelog-202309050841.xml
- reasoning: these are notification constants
- adds constructAttributesApplyPhraseToUserDTO to PhraseService interface to be used by AttributesAPIController
- refactors AttributesAPIController applyPhraseToUser with AttributesApplyPhraseToUserDTO
- refactors sendNotification with in review notification and AttributesApplyPhraseToUserDTO
- refactors applyPhraseToUser tests with AttributeApplyPhraseToUserDTO
- refactors AttributeApplyPhraseToUserDTO isSuccess field to be true when phrase added to toBeReviewed
- fixes tests to reflect this change
- adds testConstructPhraseDTPFromPhraseInformationWhenPhraseHasAllFourWords and testConstructPhraseDTPFromPhraseInformationWhenPhraseOnlyHasVerbAndNoun
- adds testConstructAttributesApplyPhraseToUserDTO
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.22%. Comparing base (1e9754b) to head (916a788).
Report is 1 commits behind head on feature/review-attributes-page.

Files with missing lines Patch % Lines
.../tribeapp/controllers/AttributesAPIController.java 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##             feature/review-attributes-page     #292      +/-   ##
====================================================================
- Coverage                             82.24%   82.22%   -0.02%     
- Complexity                              568      570       +2     
====================================================================
  Files                                    81       82       +1     
  Lines                                  1729     1733       +4     
  Branches                                276      277       +1     
====================================================================
+ Hits                                   1422     1425       +3     
  Misses                                  267      267              
- Partials                                 40       41       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- jacoco report confirms that helper methods are covered in the other tests
@haxwell haxwell merged commit 10ab2c0 into savvato-software:feature/review-attributes-page Oct 25, 2024
2 checks passed
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.

Have AttributesAPI ApplyPhraseToUser return new DTO with success, error, approved, rejected, in review fields
2 participants