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

Update MemberService.java #55

Closed
wants to merge 2 commits into from

Conversation

Divyansh123bn
Copy link

Implemented logic to check if the member has any outstanding fines or borrowed books and further deleted all related notifications, borrowings and fines.

Implemented logic to check if the member has any outstanding fines or borrowed books and further deleted all related notifications, borrowings and fines.
Copy link

@github-actions github-actions bot left a 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.

Copy link
Owner

@ajaynegi45 ajaynegi45 left a 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);
Copy link
Owner

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);
Copy link
Owner

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);
Copy link
Owner

Choose a reason for hiding this comment

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

Add all relevant imports

@ajaynegi45 ajaynegi45 closed this Oct 3, 2024
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.

2 participants