-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ekirjasto 131 selected books #121
Open
natlibfi-kaisa
wants to merge
35
commits into
main
Choose a base branch
from
EKIRJASTO-131-Selected-Books
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Includes the many-tp-many relationship between Patron and Work via the SelectedBook table.
natlibfi-kaisa
commented
Dec 16, 2024
natlibfi-kaisa
commented
Dec 16, 2024
NatLibFi-JoonaKupe
approved these changes
Dec 19, 2024
NatLibFi-JoonaKupe
approved these changes
Dec 19, 2024
Also removed the relationship from work side because there's no use for it
NatLibFi-JoonaKupe
approved these changes
Dec 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Enables a Patron to add and remove books from their list of selected books.
Motivation and Context
This feature was requested for patrons to save books from the collection.
A short summary of the changes:
A new table
selected_books
which is also a classSelectedBook
mapsPatron
andWork
as a many-to-many relationship. If aPatron
is removed, their selected books are also removed.Two new routes for select and unselect requests are added and a new controller that creates responses to them:
/works/<identifier_type>/<path:identifier>/select_book
: A POST request: When a book is selected, a selected-tag with it's creation date is added to the work's OPDS feed:<selected>2024-12-16T07:29:16+00:00</selected>
./works/<identifier_type>/<path:identifier>/unselect_book
: A DELETE request: When the patron removes the book from their selected books, the tag is removed from the feed./selected_books/<identifier_type>/<path:identifier>
: GET and DELETE requests: A selected book's details can be fetched and the book can be deleted from the list.A route
/selected_books
: GET request: Returns an OPDS acquisition feed with all the patron's selected books. This feed also contains loan/hold information atm.The authentication document includes the link for selected books so it can be easily accessed via the apps.
Basically, since loans and hold and now selected books are patron dependent annotations, these are always checked and added to the patron's feed.
How Has This Been Tested?
Locally running the application.
Checklist