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

Fix optimizing db calls (#24) #63

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

TalupulaSahithi
Copy link
Contributor

@TalupulaSahithi TalupulaSahithi commented Oct 5, 2024

Fixed issue #24

  1. In NotificationService , there is a function "sendNotification".sendNotification function checks whether the member exists in db or not(if not throws exception) and sends mail.
  • sendNotification is used by other functionalities like member created/updated/deleted,book borrowed/return/finePayed , book return remainder.
  • In most of these functionalities , member existence already checked before calling sendNotification function(which making member existence check in sendNotification as redundancy)
  • Updated remaing few functionalities also to check member existence and removed checking member existence in sendNotification , so that member existence is checked only once before calling sendNotification.

2.In borrowing service there is a function updateBookCopies , which checks book exists or not (if not throws exception) and update the bookCopies count(if exist).
-updateBookCopies is used by borrow/return functionalities in which borrow function already checks book exists or not (which making book existence check in updateBookCopies as redundancy).
-updated return functionality to check book exists or not.
-removed book check in updateBookCopies and updated parameter of int bookId to Optional book .

3.Corrected borrowing-api , "Pay Fine" endpoint as "/borrowings/{id}/pay"
(Encountered this while testing , as it is a small correction, updated it)

Tested after updating code.
borrowings
finePaid
members

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 @TalupulaSahithi 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.

@ajaynegi45
Copy link
Owner

Fixed issue #24

  1. In NotificationService , there is a function "sendNotification".sendNotification function checks whether the member exists in db or not(if not throws exception) and sends mail.
  • sendNotification is used by other functionalities like member created/updated/deleted,book borrowed/return/finePayed , book return remainder.
  • In most of these functionalities , member existence already checked before calling sendNotification function(which making member existence check in sendNotification as redundancy)
  • Updated remaing few functionalities also to check member existence and removed checking member existence in sendNotification , so that member existence is checked only once before calling sendNotification.

2.In borrowing service there is a function updateBookCopies , which checks book exists or not (if not throws exception) and update the bookCopies count(if exist). -updateBookCopies is used by borrow/return functionalities in which borrow function already checks book exists or not (which making book existence check in updateBookCopies as redundancy). -updated return functionality to check book exists or not. -removed book check in updateBookCopies and updated parameter of int bookId to Optional book .

3.Corrected borrowing-api , "Pay Fine" endpoint as "/borrowings/{id}/pay" (Encountered this while testing , as it is a small correction, updated it)

Tested after updating code. borrowings finePaid members

Resolve the conflict

@ajaynegi45 ajaynegi45 added hacktoberfest-accepted hacktoberfest status: ready for dev You can asked for this issue to be assigned (if not already assigned) gssoc GirlScript Summer Of Code gssoc-ext level3 GirlScript Summer Of Code - 35 points labels Oct 7, 2024
@TalupulaSahithi
Copy link
Contributor Author

Resolved the merge conflicts.

@ajaynegi45 ajaynegi45 merged commit 3c0fd82 into ajaynegi45:main Oct 7, 2024
1 check passed
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 @TalupulaSahithi,

Thank you for your prompt work on this issue. I appreciate your dedication to the project.

I have reviewed your work, and I'm pleased to inform you that I have merged your pull request. Your changes looks fantastic, and it aligns perfectly with the project's design and usability goals. Great job!

If you have any more contributions or if there's anything else you'd like to work on in the future, please don't hesitate to let us know. Your efforts are valuable to the project's success.

Once again, thank you for your contribution! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc GirlScript Summer Of Code gssoc-ext hacktoberfest hacktoberfest-accepted level3 GirlScript Summer Of Code - 35 points status: ready for dev You can asked for this issue to be assigned (if not already assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants