Diagram 3.2. Use Case Diagram for User Account UC1: Register Account
❖ Table Describing Use Case
Use Case Name: Register Account Complexity: Simple Use Case Description: The functionality that allows a new user to create a new account on the system.
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The user does not have an account in the system.
Postconditions: A new user account has been successfully created
Main Event Flow Customer System
Accesses the system,
click button
Registration
Displays the registration form Enters the required
information and submits the form
39
Validate information: if invalid, prompt for correction; if valid, create the account, save it, and send a confirmation email.
Table 3.2. Table Describing Use Case: Register Account
❖ Activity Diagram:
Diagram 3.3. Activity Diagram for Register Account UC2: Login Account
❖ Table Describing Use Case Login Account
Use Case Name: Login Account Complexity: Simple
Use Case Description: The feature allows registered users to log into the system by providing their username and password.
Primary Actor: Customer
40 Actor Secondary Actor:
Preconditions: The user already has an account in the system.
Postconditions: The user has successfully logged into the system.
Main Event Flow Customer, Admin, Employee
System
Accesses the system, click button Login
Displays the login form Enters the required
information and submits the form
Validates information: if invalid, prompts re-entry; if valid, authenticates and redirects to the main page.
Table 3.3. Table Describing Use Case: Login Account
❖ Activity Diagram:
Diagram 3.4. Activity Diagram for Login Account
41 UC3: Forgot Password Account
❖ Table Describing Use Case
Use Case Name: Forgot Password Account Complexity: Medium Use Case Description: The feature allows users to recover their password if they forget it.
Actor
Primary Actor: Customer, Employee, Admin Secondary Actor:
Preconditions: The user already has an account in the system.
Postconditions: The user has successfully recovered their new password.
Main Event Flow Customer, Admin, Employee
System
Accesses the system's login page and clicks on the "Forgot Password?"
Displays a form requesting the registered email address.
Enters their email address and submits the form
Checks email: if invalid, prompts re- entry; if valid, sends a recovery link.
Receives the email and clicks on the password recovery link
Display a form requesting the newpassword
Enter the new password and submits the form
Validates the new password and confirms the update.
Table 3.4. Table Describing Use Case: Forgot Password Account
42
❖ Activity Diagram:
Diagram 3.5. Activity Diagram for Forgot Password Account UC4: Log Out Account
❖ Table Describing Use Case
Use Case Name: Log Out Account Complexity: Simple Use Case Description: This feature allows users to log out of the system.
Primary Actor: Customer, Employee, Admin
43 Actor Secondary Actor:
Preconditions: The user already logged into the system.
Postconditions: The user has successfully logged out of the system.
Main Event Flow Customer, Admin, Employee
System
Click the Log Out button on the system
Terminates the user's session and redirects them to the login page.
Table 3.5. Table Describing Use Case: Log Out Account
❖ Activity Diagram:
Diagram 3.6. Activity Diagram for Logout Account 3.2.2.2. Personal Information
Diagram 3.7. Use Case Diagram for Personal Information
44 UC5: View Personal Information
❖ Table Describing Use Case
Use Case Name: View Personal Information Complexity: Simple Use Case Description: The feature allows users to view their personal information, including details like name, email, and phone number,...
Actor
Primary Actor: Customer, Employee, Admin Secondary Actor:
Preconditions: The user is logged into the system.
Postconditions: The system displays the user's personal information
Main Event Flow Customer, Admin, Employee System Selects the three-line menu in the
top right corner of the navigation bar and chooses ‘Account
Information’
Retrieves and displays the user's personal information.
Table 3.6. Table Describing Use Case: View Personal Information
❖ Activity Diagram:
Diagram 3.8. Use Case Diagram for View Personal Information
45 UC6: Edit Personal Information
❖ Table Describing Use Case
Use Case Name: Edit Personal Information Complexity: Simple Use Case Description: The feature allows users to edit their personal information, including details like name, email, and phone number,...
Actor
Primary Actor: Customer, Employee, Admin Secondary Actor:
Preconditions: The user is logged into the system.
Postconditions: The user's personal information has been successfully updated, and a confirmation message is displayed indicating that the information has been updated.
Main Event Flow Customer, Admin, Employee
System
Selects the three-line menu in the top right corner of the navigation bar and chooses
‘Account Information’
Retrieves and displays the user's personal information.
Edit the fields that need to be changed and clicks the
"Save Changes" button
Validates information: if valid, saves changes and shows success; if invalid, prompts correction.
Table 3.7. Table Describing Use Case: Edit Personal Information
46
❖ Activity Diagram:
Diagram 3.9. Activity Diagram for Edit Personal Information 3.2.2.3. Explore Books
Diagram 3.9. Use Case Diagram for Exploring Books
47 UC7: View Book
❖ Table Describing Use Case
Use Case Name: View Book Complexity: Medium
Use Case Description: This feature allows customers to browse and view details of books available in the system, categorized by genre or author.
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The user accesses the system.
Postconditions: The system displays the list of books based on the selected category or author.
Main Event Flow Customer System
Accesses the homepage of the system
Displays a list of all books.
Selects a book category from the navigation
Displays a list of books in that category.
Selects an author
Displays the author's biography and a list of books by that author.
Selects a book to view more details.
Displays the detail page for the selected book.
Table 3.8. Table Describing Use Case: View Book
48
❖ Activity Diagram:
Diagram 3.10. Activity Diagram for View Book UC8: Search Book
❖ Table Describing Use Case
Use Case Name: Search Book Complexity: Simple Use Case Description: The feature allows the user to search for books by entering specific keywords or details such as the title.
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The user has accessed the system.
Postconditions: The system displays the search results based on the user's query.
Main Event Flow Customer System
Accesses the search icon on the navigation bar
49
Displays the keyword input bar.
Enters a search query
Processes search: shows results if matched, or "no results found" if not.
Deletes the search keyword
Displays a list of all books or books by genre
Table 3.9. Table Describing Use Case: Search Book
❖ Activity Diagram:
Diagram 3.11. Activity Diagram for Search Book
50 3.2.2.4. Wishlist
Diagram 3.12. Use Case Diagram for Wishlist UC9: Add To Wishlist
❖ Table Describing Use Case
Use Case Name: Add To Wishlist Complexity: Simple Use Case Description: This feature allows the user to add a selected book to their wishlist for future reference.
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The user is logged into the system.
Postconditions: The selected book is successfully added to the user's wishlist, and the system displays a confirmation notification.
Main Event Flow Customer System
Accesses the homepage of the system
Displays a list of all books.
Click the ‘Add to Wishlist’
icon on the book you want to add
Processes request: notifies if in wishlist, adds and confirms if not.
Table 3.10. Table Describing Use Case: Add To Wishlist
51
❖ Activity Diagram:
Diagram 3.13. Activity Diagram for Add To Wishlist UC10: View Wishlist
❖ Table Describing Use Case
Use Case Name: View Wishlist Complexity: Simple Use Case Description: This feature allows the user to view books currently in their wishlist
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The user is logged into the system.
Post-condition: The user successfully views book from user's wishlist
Main Event Flow Customer System
Accesses the system click to their wishlist
52
Displays all the books currently in the user's wishlist.
Clicks the ‘Delete’ icon on the book that want to remove from their wishlist
Remove the book from the wishlist and return a
confirmation message.
Table 3.11. Table Describing Use Case: View Wishlist
❖ Activity Diagram:
Diagram 3.14. Activity Diagram for View Wishlist 3.2.2.5.Cart
Diagram 3.15. Use Case Diagram for Cart
53 UC11: Add To Cart
❖ Table Describing Use Case
Use Case Name: Add To Cart Complexity: Simple Use Case Description: : The feature allows users to add their selected books to the shopping cart for purchase preparation.
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The user is logged into the system.
Postconditions: The selected book is successfully added to the user's cart, and the system displays a confirmation notification.
Main Event Flow Customer System
Accesses the homepage of the system
Displays a list of available books.
Click the ‘Add to Cart’ icon on the book you want to add
Processes request: increases quantity if in cart, adds with quantity 1 and confirms if not.
Table 3.12. Table Describing Use Case: Add To Cart
54
❖ Activity Diagram:
Diagram 3.16. Activity Diagram for Add To Cart UC12: View Cart
❖ Table Describing Use Case
Use Case Name: View Cart Complexity: Medium
Use Case Description: The feature allows the user to view books from their cart
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The user is logged into the system.
55
Postconditions: The selected book is successfully view the user's cart
Main Event Flow Customer System
Accesses the system and click ‘Cart’ icon in navigation
Displays all the books currently in the user’s cart, including their titles, quantities, prices, and total cost.
Click the ‘+’ button
Checks after decreasing: if valid, updates count and total price; if exceeds stock, shows "Quantity exceeds available stock."
Click the ‘-’ button
Checks after decreasing: if > 0, updates count and total price; if 0, removes book and confirms.
Click the ‘x’ button for a specific book.
Removes the selected book from the cart and displays a
confirmation message.
Table 3.13. Table Describing Use Case: View Cart
56
❖ Activity Diagram:
Diagram 3.17. Activity Diagram for View Cart
57 3.2.2.6. Order
Diagram 3.18. Use Case Diagram for Order UC13: Place Order
❖ Table Describing Use Case
Use Case Name: Place Order Complexity: Medium Use Case Description: The feature allows customers to place an order for the items in their cart.
Actor
Primary Actor: Customer
Secondary Actor: Payment Gateway
Preconditions: The customer is logged into the system and has items in their cart.
Postconditions:. The order is successfully placed, and the system provides an order confirmation.
Main Event Flow Customer System
Accesses the ‘Cart’ icon from the navigation bar.
Displays all the books currently in the user's cart, including their titles, quantities, prices, and total cost.
Reviews the items in the cart and clicks the ‘Place Order’
button.
Displays a summary of the cart, including item details, quantities, and total cost.
58
Transitions to the checkout form where the customer can input delivery and payment
information.
Fills out the checkout form
Validates details: processes order and confirms if code, redirects to VNPAY if selected.
Customer completes payment via VNPAY.
Displays an order confirmation message
Table 3.14. Table Describing Use Case: Place Order
59
❖ Activity Diagram:
Diagram 3.19. Activity Diagram for Place Order
60 UC14: View Orders
❖ Table Describing Use Case
Use Case Name: View Orders Complexity: Medium Use Case Description: This feature allows customers to view a list of their orders
Actor
Primary Actor: Customer Secondary Actor:
Preconditions: The customer is logged into the system.
Postconditions: The system displays a list of the customer's orders.
Main Event Flow Customer System
Accesses the system and clicks the three lines menu on the navigation bar, click My Orders
Displays customer orders with Order Code, status, total amount, and contact info.
Clicks on an ‘Order Code’ to view more details.
Displays detailed information about the selected order,
including items, quantities, and prices.
Clicks the ‘Cancel’ button for an order.
Cancels the order and displays a confirmation message: "Your order has been successfully canceled."
Clicks ‘Download Order’ to save it as a PDF.
Generates order summary as PDF for customer download.
61
Clicks ‘Confirm Receipt’ for a delivered order.
Changes the order status to
"Received" and displays a confirmation message: "Order received successfully."
Table 3.15. Table Describing Use Case: View Orders
❖ Activity Diagram:
Diagram 3.20. Activity Diagram for View Orders
62 3.2.2.7. Book/Author/Category Management
Diagram 3.21. Use Case Diagram for Managing Books, Authors, and Categories
UC15: View Book/Author/Category
❖ Table Describing Use Case
Use Case Name: View Book/Author/Category Complexity: Medium Use Case Description: This function allows admin and employee to view information of all books/authors/categories in the system.
Actor
Primary Actor: Admin, Employee Secondary Actor:
Preconditions: The Admin or Employee is logged into the system.
Postconditions: The system displays a list of books/authors/categories that have been added to the system.
Main Event Flow Admin, Employee System
Accesses the system, click Book/Author/Category Management
Displays a list of all book/author/category Clicks on a
‘Book/Author/Category Code’ to view its details.
Displays the details of the selected book/author/category Enters the
book/author/category title
63 into the search bar and presses Enter or clicks the search icon.
Processes the search query and displays a list of
books/authors/categories that match the search term.
Deletes the search keyword
Displays a list of all books/authors/categories Table 3.16. Table Describing Use Case: View Book/Author/Category
❖ Activity Diagram:
Diagram 3.22. Activity Diagram for View Book/Author/Category
64 UC16: Add Book/Author/Category
❖ Table Describing Use Case
Use Case Name: Add Book/Author/Category Complexity: Medium Use Case Description: This function allows Admin or Employee add a new book to the system.
Actor
Primary Actor: Admin, Employee Secondary Actor:
Preconditions: The Admin or Employee is logged into the system.
Postconditions: Admin or Employee added book/author/category to system successfully
Main Event Flow Admin, Employee System
Accesses the system, click Book/Author/Category Management
Displays a list of all book/author/category Clicks the ‘Add’ button.
Displays a form for entering book/author/category details Fills in the required
information in the form, clicks ‘Add’
Validates data and checks slug:
shows " Book/Author/Category exists" if found, otherwise adds book/author/category and confirms.
Table 3.17. Table Describing Use Case: Add Book/Author/Category
65
❖ Activity Diagram:
Diagram 3.23. Activity Diagram for Add Book/Author/Category UC17: Edit Book/Author/Category
❖ Table Describing Use Case
Use Case Name: Edit Book/Author/Category Complexity: Simple Use Case Description: The Admin or Employee can edit an existing
book/author/category in the system
Actor
Primary Actor: Admin, Employee Secondary Actor:
66
Preconditions: The Admin or Employee is logged into the system.
Postconditions: Admin or Employee edited book/author/category to system successfully
Main Event Flow Admin, Employee System
Accesses the system, click Book/Author/Category Management
Displays a list of all book/author/category Clicks the ‘Edit’ button.
Displays the book details in a form that allows to edit information
Performs editing of
information that needs to be changed, clicks the ‘Save’
button
Validates data and checks slug:
shows " Book/Author/Category exists" if found, otherwise updates and confirms.
Table 3.18. Table Describing Use Case: Edit Book/Author/Category
67
❖ Activity Diagram:
Diagram 3.24. Activity Diagram for Edit Book/Author/Category UC18: Delete Book/Author/Category
❖ Table Describing Use Case
Use Case Name: Delete Book/Author/Category Complexity: Simple
Use Case Description: This function allows Admin or Employee to delete a book from the system.
Actor
Primary Actor: Admin ,Employee Secondary Actor:
68
Preconditions: The Admin or Employee is logged into the system.
Postconditions: Admin or Employee deleted book to system successfully
Main Event Flow Admin, Employee System
Accesses the system, click Book/Author/Category Management
Displays a list of all book/author/category Clicks the ‘Delete’ buton
Displays a success message: "
Book/Author/Category deleted successfully."
Table 3.19. Table Describing Use Case: Delete Book/Author/Category
❖ Activity Diagram:
Diagram 3.25. Activity Diagram for Delete Book/Author/Category
69 3.2.2.8. Warehouse Management
Diagram 3.26. Use Case Diagram for Warehouse Management UC19: View Warehouse
❖ Table Describing Use Case
Use Case Name: View Warehouse Complexity: Medium Use Case Description: This function allows admin and employee to view quantity of all books in the system.
Actor
Primary Actor: Admin, Employee Secondary Actor:
Preconditions: The Admin or Employee is logged into the system.
Postconditions: The system displays a list of books in the system including the quantity imported, sold, and remaining.
Main Event Flow Admin, Employee System
Accesses the system, click Warehouse Management
Displays a list of all book
including the quantity imported, sold, and remaining.
Clicks on a Book Code to view its details.
Displays the details of the selected book
Enters the book title into the search bar and presses Enter or clicks the search icon.
70
Processes the search query and displays a list of books that match the search term.
Deletes the search keyword
Displays a list of all books Table 3.20. Table Describing Use Case: View Warehouse
❖ Activity Diagram:
Diagram 3.27. Activity Diagram for View Warehouse
71 UC20: Add Book Quantity
❖ Table Describing Use Case
Use Case Name: Add Book Quantity Complexity: Simple Use Case Description:
Actor
Primary Actor: Admin, Employee Secondary Actor:
Preconditions: The Admin or Employee is logged into the system.
Postconditions: The quantity of the selected book is updated in the inventory system.
Main Event Flow Admin, Employee System
Accesses the system, click Warehouse Management
Displays a list of all book
including the quantity imported, sold, and remaining.
Clicks the "+" button next to the book they want to
update.
Displays a popup for entering the additional quantity to be added to the inventory
Inputs the desired quantity and clicks the "Add" button.
Validates the input, updates the total quantity of the book by adding the entered value.
Table 3.21. Table Describing Use Case: Add Book Quantity
72
Diagram 3.28. Activity Diagram for Add Book Quantity 3.2.2.9. Order Management
Diagram 3.29. Use Case Diagram for Order Management UC21: View Order
❖ Table Describing Use Case
Use Case Name: View Order Complexity: Medium
Use Case Description: This function allows admin and employee to view information of all order in the system.
Actor
Primary Actor: Admin, Employee Secondary Actor:
73
Preconditions: The Admin or Employee is logged into the system.
Postconditions: The system displays a list of orders that have been added to the system.
Main Event Flow Admin, Employee System
Accesses the system, click Order Management
Displays a list of all orders available in the system.
Clicks on a Order Code to view its details.
Displays the details of the selected order
Enters the order title into the search bar and presses Enter or clicks the search icon.
Processes the search query and displays a list of orders that match the search term.
Deletes the search keyword
Displays a list of all categories Table 3.22. Table Describing Use Case: View Order
74
❖ Activity Diagram:
Diagram 3.30. Activity Diagram for View Order UC22: Create Order
❖ Table Describing Use Case
Use Case Name: Create Order Complexity: Medium Use Case Description: This use case describes the process of creating an order for a customer purchasing books directly at the store.
Actor
Primary Actor: Admin, Employee Secondary Actor:
Preconditions: The Admin or Employee is logged into the system.
Postconditions: The system displays a list of orders that have been added to the system.
Main Event Flow Admin, Employee System