Skip to content

Fix: Resolve Incorrect Configuration and Implement CRUD Features for NewsletterRepository#688

Merged
Am0du merged 10 commits intohngprojects:devfrom
tachtwitch:add-tachtwitch
Mar 2, 2025
Merged

Fix: Resolve Incorrect Configuration and Implement CRUD Features for NewsletterRepository#688
Am0du merged 10 commits intohngprojects:devfrom
tachtwitch:add-tachtwitch

Conversation

@tachtwitch
Copy link
Contributor

@tachtwitch tachtwitch commented Feb 28, 2025

PR Description

This PR resolves the incorrect configuration of the NewsletterRepository interface and implements CRUD features, including retrieving newsletters by user ID, retrieving newsletters created after a specified date, and deleting newsletters by user ID.

Bug fixes:

*Resolved incorrect configuration of NewsletterRepository interface

##New features:

  • Implemented CRUD features for NewsletterRepository interface
  • Added content and title fields to @Entity newsletter
  • Added unit tests for NewsletterRepository methods

Expected Behavior

The NewsletterRepository should correctly perform CRUD operations using the defined @Query annotations.

getNewslettersByUserId Endpoint

postman

getNewslettersAfterDate Endpoint

posttman2

Testing

Test 1: Retrieve newsletters by user ID

  • Unit test: passed

Test 2: Retrieve newsletters created after a specified date

  • Unit test: passed

Test 3: Delete newsletter by user ID

  • Unit test: passed

Copy link
Contributor

@Am0du Am0du left a comment

Choose a reason for hiding this comment

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

Based on your issue, you need to create User and Newsletter relationship with One-to-Many (creator) and Many-to-Many (subscriptions) relationships.
Implement service methods to subscribe(subscription is already in the codebase)/unsubscribe users and repository methods for database operations.

Also no endpoints for implemented service

@tachtwitch tachtwitch requested a review from Am0du March 1, 2025 15:37
@tachtwitch tachtwitch requested a review from billmal071 March 2, 2025 12:42
@billmal071
Copy link
Contributor

@Am0du can you please reviews this?

@Am0du Am0du merged commit 4b95f55 into hngprojects:dev Mar 2, 2025
1 check failed
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.

3 participants