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

feat(QR-Code): Loan/Return books with qr code #34

Closed
7 tasks done
wxiaoyun opened this issue Dec 30, 2023 · 0 comments · Fixed by #56
Closed
7 tasks done

feat(QR-Code): Loan/Return books with qr code #34

wxiaoyun opened this issue Dec 30, 2023 · 0 comments · Fixed by #56
Assignees
Labels
feat New feature or request

Comments

@wxiaoyun
Copy link
Owner

wxiaoyun commented Dec 30, 2023

  • QR code scanner helper function
    • takes in a zod schema for qr code parsing
    • onSuccess handler, onError handler
    • returns the parsed item
  • Implementation: on success
    • use the info from scanned qr code to optimistically update fetching the book copy
    // Optimistically update to the new value
    queryClient.setQueryData(['todos'], (old) => [...old, newTodo])
  • Generic Scanner page:

    • Takes in a onSubmit func that will be called
    • Takes in a qrcode scanner
    • Have local state to check whether user wish to receive confirmation
    • Option 1: manual key in book copy id, autocomplete command, on select triggers the confirmation dialog
    • Option 2: gigantic camera icon, click to turn on camera to detect qrcode
    • On scan success/key in book copy id, show confirmation dialog that renders the details of the book
  • Scan QR code to loan book (all logged in user)

    • A page that allows librarians to manually key in bookcopy id to loan book or
    • Turns on the camera and scans only qr that matches the expected format, then loans the book on detection. (2 modes, ask for confirmation/disable confirmation)
  • Scan QR code to return book (librarian only)

    • A page that allows librarians to manually key in bookcopy id to return book or
    • Turns on the camera and scans only qr that matches the expected format, then returns the book on detection. (2 modes, ask for confirmation/disable confirmation)
  • Search ISBN code to auto populated create book info

  • Disallow loaning from catalogue and my reservation page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant