-
Notifications
You must be signed in to change notification settings - Fork 51
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
Update MemberService.java #55
Conversation
Implemented logic to check if the member has any outstanding fines or borrowed books and further deleted all related notifications, borrowings and fines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thank you @Divyansh123bn for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Divyansh123bn,
Thank you for your prompt work on this issue. I appreciate your dedication to the project.
I have reviewed your work, and I need some changes.
- Mention all proper Imports
- Read all code comments
Once again, thank you for your contribution! ❤️
// TODO: Implement logic to check if the member has any outstanding fines or borrowed books. | ||
// If there are no pending obligations, delete all related notifications, borrowings, and fines. | ||
// Check for outstanding fines | ||
List<Fine> outstandingFines = fineRepository.findByMemberIdAndIsPaidFalse(memberId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is fine here. It's Fines
|
||
// Check for borrowed books | ||
List<Borrowings> borrowedBooks = borrowingRepository.getAllBorrowingsOfAMember(memberId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import for Borrowings
} | ||
|
||
// Delete related notifications | ||
notificationRepository.deleteByMemberId(memberId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add all relevant imports
Implemented logic to check if the member has any outstanding fines or borrowed books and further deleted all related notifications, borrowings and fines.