Use Cases - cmput301w19t10/BookSwap GitHub Wiki

TYPE DESCRIPTION
ID 1.01.01
Name Owner adds a book
Participating Actors Owner
Goal As a user I want to add a new book, with book information and (optionally) a photo, so that this book can be borrowed by other users.
Trigger Owner selects "Add" button.
Precondition Owner has an account, owner wants to add a book.
Postcondition A new book is created with status "Available"
Basic Flow 1. System prompts owner to enter book information
2. Owner enters book information into prompts
3. Owner selects "save" button
4. System saves book to database. System presents previous screen
Alternative Flow 2.1 Owner selects "cancel" button
2.2 System reverts to previous screen. System doesn't save book information
Exception Flow Essential field exception:
3.1 Owner selects "Save" button without one of the following: Book Title, Book Author.
3.2 System refuses to save, prompts owner to fully fill required fields
Includes Use Case 1.2.1 and Use Case 1.3.1
TYPE DESCRIPTION
ID 1.02.01
Name Scanfill Book Description
participating Actors Owner
Goal As an owner, I want to be able to scan a book's barcode and have it fill in the book, so that others can access to the information of book.
Trigger Owner selects the scanned book option (during add or edit book)
Precondition Barcode is valid, Owner is adding or editing a book
Postcondition Book information is filled in
Basicflow 1. Owner selects scan book option
2. System presents a screen for the owner to scan a barcode with camera
3. Owner hovers over barcode
4. When the system detects barcode, it notifies the owner and fills in book description (minimum ISBN)
Alternative flow 2.1 Owner selects back during barcode scan
2.2 System reverts to the previous screen, with no information filled
Exception flow 3.1 Barcode information hash can't be found in database
3.2 System notifies the user that barcode read was barcode
Includes
TYPE DESCRIPTION
ID 1.03.01
Name Book status
Participating Actors Owner, Borrower
Goal As a user, I want to be able to view the status of a book, so that I can clearly to see my properties.
Trigger User selects a book
Precondition book exists, the user has a valid account
Postcondition
Basicflow 1. User selects for more book information
2. System presents more book information
3. User can read the status of a book
4. The user presses back
5. System reverts to previous screen
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 1.04.01
Name View books
Participating Actors Owner
Goal As an owner, I want to be able to view summarized information of all my books,so that other user and I can clearly know the information of each available book
Trigger Owner selects "view books" panel
Precondition Owner has books, Owner is logged in
Postcondition Summarized information of all owner's books is presented
Basicflow 1. Owner selects view books
2. System presents a list of owned books, with an image (blank), title, author, status, and whose currently borrowing it (empty)
Alternative flow
Exception flow 3.1 Owner has no books
3.2 System notifies user has no books
Includes
TYPE DESCRIPTION
ID 1.05.01
Name View books by status (Available)
Participating Actors Owner
Goal As an owner, I want to be able to view my books that are available, so that I know whether books are available or not
Trigger Owner has books
Precondition Owner has available books
Postcondition List of available books with description are presented
Basicflow 1. Owner selects the available button in his books
2. System presents a list of owner's available books
3. Owner selects back button
4. System reverts to previous screen.
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 1.05.02
Name View books by status (Requested)
Participating Actors Owner
Goal As an owner, I want to be able to view my books that are available
Trigger Owner tap "Requested" icon on the screen
Precondition Owner has requested books
Postcondition List of requested books with description are presented
Basicflow 1. Owner selects the Requested button in their books
2. System presents a list of owner's available books
3. Owner slects back button
4. System reverts to previous screen.
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 1.05.03
Name View books by status (Accepted)
Participating Actors Owner
Goal As an owner, I want to be able to view my books that are accepted, so that I can know which books I accepte the borrowing request.
Trigger Owner tap "accepted" icon on the screen
Precondition Owner has accepted books
Postcondition List of Accepted books with description are presented
Basicflow 1. Owner selects the Accepted button in his books
2. System presents a list of owner's available books
3. Owner selects back button
4. System reverts to previous screen.
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 1.05.04
Name View books by status (Borrowed)
Participating Actors Owner
Goal As an owner, I want to be able to view my books that are borrowed, so that I can know what book are borrowed away
Trigger Owner tap "Borrowed" icon on the screen
Precondition Owner has borrowed books
Postcondition List of borrowed books are presented
Basicflow 1. Owner selects the Borrowed button in his books
2. System presents a list of owner's available books
3. Owner selects back button
4. System reverts to previous screen.
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 1.06.01
Name Edit Book
Participating Actors Owner
Goal As an owner, I want to be able to edit a previously existing book, so that I can change the existed book information
Trigger Book Owner selects the book from the owner’s book list (see 01.03.01, 1.05.xx)
Precondition Book Owner has a book to edit.
Postcondition System saves changes to the owner’s book and returns them to book view page
Basicflow 1. Owner selects edit option after viewing a book
2. System sends owner to a book editor page.
3. Owner fills or edits in fields
4. Book owner selects save changes option.
5. System saves and updates changes and book owner is returned to previous screen.
Alternative flow
Exception flow 1. Owner presses saved with empty essential fields
2. System refuses to save and notifies owner that required fields must be filled.
Includes
TYPE DESCRIPTION
ID 1.07.01
Name Delete Book
Participating Actors Owner
Goal As an owner, I want to be able to delete one of my books, so that other users would no longer see this book
Trigger Owner selects delete book from edit menu (1.06.01)
Precondition Owner owns selected book, owner has a book
Postcondition Book is deleted, all people that requested book are notified
Basicflow 1. Owner selects a book
2. Owner selects delete book
3. system deletes the book
4. System notifies all affected requesting users
5. System returns owner to previous screen
Alternative flow
Exception flow 3.1 Book is "accepted" or "borrowed"
3.2 system notifies owner that book can not be deleted for above reason
3.3 System returns to edit book screen.
Includes
TYPE DESCRIPTION
ID 02.01.01
Name Account creation
Participating Actors User
Goal As a new user, I want to be able to create a new account with a unique username and some information, so that user information is stored and can be retrieved later.
Trigger User opens the app
Precondition User is not already logged in
Postcondition new user now has a viable account
Basicflow 1. User clicks "register new user"
2. System prompts user to fill in information
3. User enters information
4. User presses "register"
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 02.01.02
Name Account Login
Participating Actors User
Goal As an existing user, I want to be able to log into my account. Authorize this user to retrieve and change data for this account.
Trigger User opens the app
Precondition user is not already logged in
Postcondition user is now logged in
Basicflow 1. User enters the username and password.
2. User select “Login” button.
3. User is logged in and the user profile is displayed
Alternative flow:
Alternative flow
Exception flow 3.2 System notifies user to try again
3.3 after repeated failures, system locks out login for a period of time.
Includes:
Includes
TYPE DESCRIPTION
ID 02.02.01
Name View My Profile
Participating Actors User
Goal As a user, I want to be able to view my profile. So user can see the profile.
Trigger User selects “Profile” option(button)
Precondition User have an account and is logged in.
Postcondition The user profile updated
Basicflow 1. User selects “Profile” button.
2. User profile, search bar and edit profile button are displayed.
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 02.02.02
Name Edit Profile
Participating Actors User
Goal As a user, I want to be able to edit and update my profile. So user can change his profile information and store it.
Trigger User selects edit profile button.
Precondition User has a valid account
Postcondition User profile is edited and updated.
Basicflow 1. User selects the edit profile.
2. User edits contact information in the text box.
3. User edits profile picture by selecting profile picture
4. User select “Save” Button to save the edited profile.
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 02.03.01
Name View Any Profile
Participating Actors User, User2
Goal As a user, I want to be able view a profile of a given username. So user can see other's profile information.
Trigger User selects a profile.
Precondition user2 is a valid user
Postcondition ???
Basicflow 1. User selects a profile
2. System presents user with profile information
Alternative flow
Exception flow
Includes Use Case 2.1.1
TYPE DESCRIPTION
ID 02.03.02
Name Search for user
Participating Actors User, User2
Goal User typw in keyword to search other user. So user can search other users.
Trigger As a user, I want to be able to search for a user of a given username
Precondition User selects the search bar in profile screen.
Postcondition user2 is a valid user
Basicflow 1. User selects search bar
2. System prompts user to enter in information
3. User enters in a user Name
4. System shows all profiles matching that database
Alternative flow
Exception flow
Includes
TYPE DESCRIPTION
ID 03.01.01
Name Search Books
participating actor User
Goal Display a list of book titles that contains the keyword. So user can select from this list of books.
Trigger User types in the keyword and hit enter.
Precondition User selected “Borrow Books”.
Postcondition A list title of book that are not currently accepted or borrowed is displayed.
Basicflow 1. User enters the keyword.
2. User hit enter.
3. A list of book titles that their descriptions contain the key words are displayed
Alternative flow None
Exception flow None
Includes Use Case 6.2.1 and Use Case 1.5.1
TYPE DESCRIPTION
ID 03.02.01
Name View Available books as borrower
participating actor Borrower
Goal As a borrower, I want to be able to view all the books are available
Trigger
Precondition Inside Borrower tab
Postcondition A list view of possible books to be borrowed are displayed
Basicflow 1. Borrower taps "available" tab
2. System presents books that are available.
Alternative flow None
Exception flow None
Includes
TYPE DESCRIPTION
ID 03.02.02
Name View requested books as borrower
participating actor Borrower
Goal As a borrower, I want to be able to view all the books that are requested
Trigger
Precondition Inside Borrower tab
Postcondition A list view of possible books to be borrowed are displayed
Basicflow 1. Borrower taps "requested" tab
2. System presents books that are available.
Alternative flow None
Exception flow None
Includes
TYPE DESCRIPTION
ID 04.01.01
Name borrower request a book
Participating Actors Owner , Book , borrower
Goal As a borrower, I want to request a book that is not currently accepted or borrowed, So user could know if he or she could borrow this book.
Trigger click on “books available” to view books available
Precondition This book is available for borrower
a borrower wants to send a request for a book
Postcondition For owner, the book in Owner list has one more request from others.
For borrower, this book will appear in his requested book list and disappear in available list.
For owner, A request from this borrower would appear in a request list of the book
For owner, the notification number in the red button adds one
Basicflow 1. a borrower wants request a book and that book is available
2. Borrower click “available” to view books available in library
3. Click the request button to send a request
Alternative flow
Exception flow Borrower cannot request a book whose status is borrowed or accepted
Includes Use Case 1.5.1 and Use Case 3.2.1
TYPE DESCRIPTION
ID 04.02.01
Name Borrower view requested books
Participating Actors Book , borrower
Goal As a borrower, I want to view a list of books I have requested, each book with its description, and owner username, So borrower could know which books he or she has requested already.
Trigger Borrower click on the requested book button to view the books requested by himself or herself
Precondition A borrower wants to view requested books
Postcondition No change
Basicflow 1. Borrower wants to view that book list includes all books requested by him or herself
2.Borrower click on “requested books” button
3. All the books will appear in the requested list
Alternative flow Borrower could click on swap button in this interface
Exception flow No
Includes Use Case 1.5.1 and Use Case 1.4.1
TYPE DESCRIPTION
ID 04.03.01
Name Owner get notified of request
Participating Actors Borrower, Owner, book
Goal As an owner, I want to be notified of a request, So I could decide to accept this request in time.
Trigger borrower click on button to request a book from books available
Precondition Owner has at least a book in the library which is available
Postcondition For owner, the notification number in the red button adds one
For borrower, The book requested appears in the requested book list
For owner, A request appear in the request list of the book
Basicflow 1. a borrow request a book of a owner
2.owner received a message of this request action
3. click on this notification
4. show all the info of this action
Alternative flow No
Exception flow The notification may not be the notification of request
Includes Use Case 1.3.1 and Use Case 1.5.1
TYPE DESCRIPTION
ID 04.04.01
Name Owner view requests of a book
Participating Actor Owner, book
Goal As an owner, I want to view all the requests on one of my books, So owner could know which request he or she could decide to accept.
Trigger on “available” to view all his or her books
Precondition A Owner wants to view requests of his or her books
Postcondition nothing changes
Basicflow 1. Owner click on “available” button to get the list of all his books first
2. choose one book that he or her concerns
3. click on it to view all the requests
Alternative flow You could decline or accept a request on the interface
Exception flow NO
Includes Use Case 1.3.1
TYPE DESCRIPTION
ID 05.01.01
Name Owner accept a request
Participating Actor Owner, book, borrower
Goal As an owner, I want to accept a request on one of my books. (Any other requests are declined.), So owner could finally decide which borrower he or she is willing to give this book to.
Trigger Owner click on “available” to view all his or her books
Precondition A owner wants to accept a request
There are at least one request for this book
Postcondition For owner, one of requests is accepted.
Basicflow 1. Owner view all his or her books in library

2.Owner click on book image
3.Owner finds there are some requests with all the info
4. choose one request
5.click on “accept” button ace
Alternative flow You could also decline a request on this interface
Exception Flow
Includes Use Case 1.3.1Use Case 1.4.1
TYPE DESCRIPTION
ID 05.02.01
Name Owner decline a request
Participating Actor Owner, book, borrower
Goal As an owner, I want to decline a request on one of my books, so owner could have the right not to give the book to a specific person.
Trigger Owner click on “my books“ to view all his or her books
Precondition A owner wants to decline a request
This book has at least a request
Postcondition For owner, the request disappear
Basicflow 1.Owner click on button “available” to open his books list
2.choose the book he or she wants to view
3.choose one request to decline
Alternative flow You could also decline a request on this interface
Exception Flow
Includes Use Case 1.3.1 and Use Case 1.4.1
TYPE DESCRIPTION
ID 05.03.01
Name borrower gets notified for a accept
Participating Actor Owner, book, borrower
Goal As a borrower, I want to be notified of an accepted request, So borrower could know if he or she could get this book in time.
Trigger Owner accept a request and the borrower get notification of this action
Precondition For borrower, the request is not accepted
For owner, the request is not accepted
Postcondition For borrower, the notification number adds one in the red button
For borrower, the request is accepted
For owner, the request for book is accepted and other requests for this book is declined.
Basicflow 1.Owner click on accept for a request
2.borrower receive one more notification
3.borrower click on this notification and could see the info
Alternative flow No
Exception Flow The notification may due to swap instead of accept
Includes Use Case 1.3.1 and Use Case 4.3.1
TYPE DESCRIPTION
ID 05.04.01
Name Borrower view books of accepted books
Participating Actor book, borrower
Goal As a borrower, I want to view a list of books I have requested that are accepted
each book with its description, and owner username, So borrower could know which books he or she could get.
Trigger borrower view all the requested books
Precondition A borrower wants to view accepted books
Postcondition Nothing changes
Basicflow 1. Borrower click on book requested
2. those with status “accepted” show up
Alternative flow You could click on swap button on this interface
Exception Flow
Includes Use Case 4.2.1
TYPE DESCRIPTION
ID 06.01.01
Name Owner lends book to borrower
Participating Actors Owner, Book, Borrower
Goal As an owner, I want to hand over a book by scanning the book ISBN code and denoting the book
as borrowed. So that the book can be borrowed by borrower.
Trigger Owner initiates trade
Precondition This book accepted
Postcondition Book is labeled "borrowed"
Basicflow 1. Owner initiates swap
2. Owner clicks on scan button in swap menu
3. Owner scans ISBN code for this book
4. System asks for confirmation of code, and swap
5. Owner clicks confirm
6. System waits for confirmation from borrower
7. Book is updated to "borrowed" and given to the borrower.
Alternative flow 1. Owner can clicks cancel during scan
2. System presents previous swap screen.
Exception flow 1. System can't read barcode.
2. System presents previous swap screen.
Includes Use Case 5.1.1
TYPE DESCRIPTION
ID 06.02.01
Name borrower accept book
Participating actor Book, borrower
Goal As a borrower, I want to receive an accepted book by scanning the book ISBN code
to confirm I have borrowed it. So that the book is belong to borrower, and appear in borrower’s borrow list.
Trigger Borrower click the menu in the top right, select scan to borrow.
Precondition Owner has initiated swap, owner has confirmed swap
Postcondition book is now in the possession of borrower, book is now labeled as borrowed
Basicflow 2. Borrower scans the book
3. System presents swap, and asks for confirmation.
4. Borrower confirms the selections
5. Book is now borrowed.
Alternative Flow:
Alternative flow 1. Borrower can clicks cancel during scan
2. System presents previous screen.
Exception flow 1. System can't read barcode.
2. System notifies user, returns to previous screen.
Includes Use Case 5.3.1
TYPE DESCRIPTION
ID 06.03.01
Name View Borrowed Books
Participating actor Book, borrower
Goal As a borrower, I want to be able to view a list of books I am borrowing, each book with its description and owner username.
Trigger Borrower is in borrower tab
Precondition Borrower has borrowed some books
Postcondition the list of borrowing books with information are presented
Basicflow 1. Borrower selects the "borrowed books" button
2. System presents a view of borrowed books
3. The borrower can select any book for more information (see 1.04.01)
Alternative flow
Exception flow
Includes Use Case 1.5.4and Use Case 5.4.1
TYPE DESCRIPTION
ID 07.01.01
Name Borrower hands over book
participating Actor Borrower, book
Goal As a borrower, I want to hand over a book I borrowed by scanning the book ISBN code to denote the book as available.So that the owner can receive the book.
Trigger Borrower can click the menu on the activity top right. And click the Scan to return .Borrower scan the ISBN code for return book .
Precondition This book in borrowing list with status “accepted”
Postcondition For borrower, The book status will be “returning”
Basicflow 1. user click the menu in the top right in activity “borrowing list”
2. click “scan to return”
3. scan the ISBN code for the book
4. The book in borrowing list status will become “returning”
Alternative flow 1. Borrower can click the menu on the activity top right to scan to borrow.
2.Borrower can click the list item in borrowing list to view the detail for the book.
Exception flow 1. Can not hand over book for the status is not “accepted”
Includes Use Case 7.2.1
TYPE DESCRIPTION
ID 07.02.01
Name Owner receives the book
participating Actor Owner, book
Goal As an owner, I want to receive a returned book by scanning the book ISBN code to confirm I have it available .So that other borrower can borrow this book.
Trigger Owner click the menu on the top right, click the choice scan to return
owner scan the ISBN code for get back the book
Precondition This book in borrowing list with status “returning”
Postcondition This book in borrowing list with status “available”
Basicflow 1. Owner find that the book with status “returning”
2. Owner click the menu on the top right
3. Owner click the choice “scan to return”
4. Owner scan the book ISBN code
5. The status for the book become “available”
Alternative flow Owner can click the menu on the top right to choose scan to borrow.
Exception flow Owner cannot receive the book for the status is not “returning”
Includes
TYPE DESCRIPTION
ID 8.01.01
Name Offering_attach_photo
participating Actor Owner
Goal As an owner, I want to attach a photo to a book so that another person can view a picture of the book
Trigger User taps on a photo in a book they own
Precondition Owner has an account, owner owns specific book
Postcondition Owner adds a photo to their book
Basicflow 1. Owner selects their photoframe
2. Owner taps “add photo” button
3. System presents owner with android gallery
4. Owner taps one photo to select
5. Owner taps “Save”
6. Owner taps “Save” again
7. System notifies that photo has been successfully updated
Alternative flow 2.1 Owner selects “cancel”
2.2 System escapes photo saving activity, photo is unchanged
Exception flow Use Case 1.6.1
Includes
TYPE DESCRIPTION
ID 8.02.01
Name Offering_delete_photo
participating Actor Owner
Goal As an owner, I want to delete a photo from a book I own because I want to be able to replace it, or remove a bad photo
Trigger User taps on a photo in a book they own
Precondition Owner has an account, owner owns specific book, book has a photo attached
Postcondition Book’s photo is deleted
Basicflow 1. Owner selects his photoframe
2. Owner selects “delete photo”
3. Photo is deleted from system
Alternative flow 2.1 Owner selects “cancel”
2.2 System escapes photo saving activity, photo is unchanged
Exception flow
Includes Use Case 1.6.1
TYPE DESCRIPTION
ID 8.03.01
Name Phone_View Photo
participating Actor Owner /Borrower
Goal As an owner or as a borrower, I want to be able to view the full image of a book in order to have a high resolution view for small details
Trigger User taps the photo from a book.
Precondition User taps the photo from a book.
Postcondition
Basicflow 1. User taps on the photoframe
2. User taps on the photo in the photo activity
3. System presents full size image view
Alternative flow 2.1 User selects “cancel”
2.2 System escapes photo activity
Exception flow
Includes Use Case 1.6.1
TYPE DESCRIPTION
ID 9.01.01
Name Specify_Location
participating Actor Owner
Goal As an owner, I want to attach the GPS location to show where to meet up for a book swap because I want there to be less time wasted looking for the other person
Trigger Owner taps “set location”
Precondition Owner has an account, owner owns specific book, specific book has been requested by a borrower, owner accepts the swap request.
Postcondition Owner adds a gps tag to their booking.
Basicflow 1. Owner accepts the swap request
2. Owner taps on the map
3. System presents owner with google maps using api
4. Owner uses google maps to specifiy a location
5. Owner (optionally) adds taps on comment box
6. Android presents keyboard
7. Owner types in any comments
8. Owner presses save
Alternative flow 2.1 Owner selects “cancel”
2.2 System escapes gps tag. No gps tag is saved for the swap request
Exception flow None
Includes
TYPE DESCRIPTION
ID 9.02.01
Name View_location
participating Actor Borrower
Goal As a borrower, I want to view the gps location specified by the owner for the swap location in order to quickly find them without confusion.
Trigger Borrower taps on a swap request that has been accepted
Precondition Owner and borrower has an account, owner has accept swap request, owner has created a gps tag.
Postcondition Borrower views a detailed map
Basicflow 1. Borrower taps on an accepted swap request
2. Borrower taps on location details
3. System presents borrower with a map and comments
4. Borrower taps on map
5. System presents google maps with tagged location
6. Borrower taps back
7. System presents main location details screen
8. Borrower taps back
9. System shows swap details screen
Alternative flow
Exception flow None
Includes Use Case 1.6.1
TYPE DESCRIPTION
ID 10.01.01
Name User Review
participating actor User
Goal As a user, I want to be able to view another user's reviews, so that I can access their trustworthiness.
Trigger User selects “Review” option(button).
Precondition Owner and borrower confirms a book is returned
Postcondition The user review is displayed.
Basicflow 1. User selects “View review” button.
2. User review is displayed.
Alternative flow None
Exception flow None
Includes
TYPE DESCRIPTION
ID 10.02.01
Name Owner Reviews Borrower
participating actor Owner
Goal Owner reviews and comments a borrower who borrows a book. So the borrower can be reviewed for others to consider.
Trigger Owner confirms returning a book from a borrower.
Precondition Borrower returns a book.
Postcondition A review is saved.
Basicflow 1. Owner confirms receiving a book.
2. Owner rates the borrower by selecting the score.
3. Owner comments on the borrower.
4.User select “save” button to save the review.
Alternative flow Owner select “Cancel” to cancel the rating.
Exception flow Owner did not select a rating
Owner did not leave a comment
Includes
TYPE DESCRIPTION
ID 10.03.01
Name Borrower Reviews Owner
participating actor Borrower
Goal Borrower reviews and comments a owner that lends a book. So the owner can be reviewed for other to consider.
Trigger Owner confirms returning a book from a borrower.
Precondition Borrower returns a book.
Postcondition A review is saved.
Basicflow 1. Owner confirms receiving a book.
2. Borrower rates the owner by selecting the score.
3.Borrower comments on the owner
4.User select “save” button to save the review.
Alternative flow Borrower select “Cancel” to cancel the rating.
Exception flow Borrower did not select a rating
Borrower did not leave a comment
Includes
⚠️ **GitHub.com Fallback** ⚠️