CHAPTER 2. ANALYSIS AND SYSTEM DESIGN
2.3. Detailed Use Case Description
• Brief description: This use case allows customers to log in to the system.
• Flow of events:
o Basic flow:
1. The use case begins when the customer invokes the login button. First, the customer will be asked to fill in their email and password.
2. The customer types in their email and password and clicks the
“LOGIN” button. The system will verify the customer’s email and password in the USERS table. If they are valid, the system notifies that the login is successful and redirects to the home page. The use case ends.
o Branching flow
1. If at any point of execution of the use case making connection to the database is not possible, the error message is displayed by the system and this will end the use case.
2. Step 2 and 3 of basic flow, specifically when user enters wrong or unused information or record is not found in USERS table. It will show error message and request to re-enter it. User can put Enter, resume or stop the action.
• Special requirements: None.
• Preconditions: None.
• Postconditions: None.
• Extension points: None.
2.3.2. View Product
• Brief description: This use case allows customers to view product information.
• Flow of events:
o Basic flow:
Use Case- The use case begins when the user clicks on a product. Then, SYSTEM will pull the product list (product list, image, description, price,
quantity, reviews, etc.) from the PRODUCTS table and display it on SYSTEM GUI screen.The use case ends.
o Branching flow
If the system is unable to connect to the database at any time during the execution of the use case, the system will present an error message and the use case will terminate.
• Special requirements: None
• Preconditions: None
• Postconditions: None
• Extension points: None 2.3.3. Search Product
• Brief description: This use case allows customers to search for products by keyword which is the product name.
• Event flow:
o Basic flow:
This use case begins when the customer types in the product name in the search textbox and clicks on the search icon adjacent to it. The system should display products, whose names (for simplicity) contain words that user entered, as well as display products information on screen (name, image, price) from the PRODUCTS table. The use case ends.
o Branching flow
1. In terms of full use case execution, if at any stage the system could not establish a connection to the Database, an error message will be displayed on the system.
2. At step 1 in the basic flow, if the system could not find any product which match the entered text, the system will show the result : No product found. The use case ends.
• Special requirements: None.
• Preconditions: None.
• Postconditions: None.
• Extension Points: None.
2.3.4 Update Information
• Brief description: This use case allows the user to change personal information.
• Event flow o Basic flow:
1. This use case begins after the user clicks the “Update information”
button. If successful, the system will go to the PERSONAL INFORMATION screen, extract the customer personal information: Full name, phone number, email, address from the USERS table and show it on screen.
2. Update personal information: User types in what they would like to change, and they hit the "Update personal information" button. System updates changed information into USERS table, and retrieves the personal information about the logged in user and displays on screen.
o Branching flow:
If the connection with the database is not possible at any time to execute the use case, the system will generate an error message. The use case ends.
• Special requirements: None.
• Preconditions: None.
• Postcondition: After the use case finishes successfully, the user's personal information will be updated in the USERS table.
• Extension point: None.
2.3.5 Product Comment
• Brief description: This use case allows customers to rate and comment on products.
• Flow of events:
o Basic flow:
1. This use case starts when the user clicks to view details of a product.
The system will retrieve the product information and display it on the
2. The user clicks on the comment section, enters the comment content and then clicks the “Submit” button. The system will save the review to the PRODUCTCOMMENTS table. The use case ends.
o Branching flow:
1. At any point during the use case, if the connection to the database cannot be established, the system will display an error message.
2. At step 2 in the basic flow, if the user does not enter any content, the error message “Please enter a comment!” is displayed. The use case ends.
• Special Requirements None
• Preconditions None
• Postconditions None
• Extension Points: None 2.3.6 Order
• Brief description: This use case allows customers to order products on the page.
• Event flow:
o Basic flow:
1. This use case starts when the user clicks on the add to cart button in the product details. The system will get the product image, name, price, quantity information and display the message "Added to cart".
2. The user clicks on the "Cart" button on the screen, the system will switch to the product information screen in the cart.
3. The user clicks on the "Payment" button on the screen, the system will switch to the payment screen.
4. The user enters full information: gender, full name, phone number, address and then chooses the payment method, the system will switch to the order information confirmation screen.
5. The user clicks the “Order” button, the system will create a new record in the ORDERS, ORDERDETAILS tables and update the PRODUCT table information, then display “Order successful”.
Use case ends.
o Branching flow
1. At any time during the use case execution, if the connection to the database is not possible, the system will display an error message.
2. At step 4 in the basic flow, if the inventory quantity is less than the order quantity, the error message “Invalid quantity” will be displayed and the use case ends.
• Special requirements: None
• Preconditions: Customers need to provide complete information to be able to place an order.
• Postconditions: When the use case ends successfully, the information will be stored in the ORDERS, ORDERDETAILS tables, and the information will be updated in PRODUCT.
• Extension points: None 2.3.7 Login
• Brief description: This use case allows the administrator to log in to perform system maintenance functions.
• Event flow o Basic flow:
1. This use case starts when the user accesses the administration page.
2. The administrator enters the correct email and password information and then presses the “LOGIN” button. The system will perform a check in the USERS table. If successful, it will move to the administration page screen.
o Branching flow:
1. At any point during the use case execution, if the connection to the database cannot be established, an error message will be displayed.
2. At step 1 in the branching flow, if the administrator enters the wrong email and password information, an error message will be displayed. If the login account does not have administrator rights, the system will move to the
Use case ends.
• Special Requirements: None
• Preconditions: User Not Logged In
• Postconditions: None
• Extension Points: None 2.3.8 Order Management
• Brief description: This use case allows the administrator to view and change the order status.
• Event flow o Basic flow:
1. This use case starts when the user clicks on the “Manage orders” button on the administration menu bar. The system will retrieve the following information from the ORDERS and ORDERDETAILS tables: id, name of the person placing the order, email, address, product name, status, total amount, order date and display it on the screen.
2. Update order status:
a. The administrator clicks on the update icon on a management bar. The system will change the status of the order depending on the previous status.
Use case ends.
o Branching flow:
1. At any point during the use case execution, if the connection to the database cannot be established, the system will display an error message and the use case ends.
• Special requirements: It is necessary to control the permission to execute this use case to ensure safety and security.
• Preconditions: The administrator needs to log in with administrative rights before executing the use case.
• Postconditions: After the use case finishes successfully, save the information to the ORDERS table
• Extension points: None
2.3.9 User Management
• Brief description: This use case allows the administrator to view and update users.
• Event flow o Basic flow:
1. This use case starts when the user clicks on the “Manage users” button on the administration menu bar. The system will retrieve the following information from the USERS table: Full name, phone number, email and display it on the screen.
2. View details
When the user clicks on the “Details” button, the system will display the user information interface including: Full name, email, address, phone number.
3. Update information
When the user clicks on the “Update” button, the system will display the user information interface. The administrator can change the user information and update it in the USERS table.
4. When the user clicks on the “Delete” button, the system will delete the user information from the screen and update it in the USERS table.
Use case ends.
o Branching flow:
1. At any point during the use case execution, if the connection to the database is not possible, the system will display an error message and the use case ends.
• Special requirements: It is necessary to control the permissions to execute this use case to ensure safety and security.
• Preconditions: The administrator must log in with administrative rights before executing the use case.
• Postconditions: After the use case successfully ends, save the information to the USERS table
2.3.10 Product Management
• Brief description: This use case allows the administrator to view, add, edit, delete products.
• Event flow o Basic flow:
1. This use case starts when the user clicks on the “Manage products”
button on the admin menu bar. The system will get the following information from the PRODUCTS, CATEGORIES table: id, product name, category name, image, quantity, price and display it on the screen.
2. Add new product:
a. The administrator clicks on the “Create product” button in the product list screen. The system will display a modal requesting information for the product including product name, quantity, price, description, category name, product image.
b. The administrator enters information for the new product and clicks on the “Create new” button. The system will add a new record to the PRODUCTS table, then get information about the new product list including id, product name, category name, photo, quantity, price and display it on the screen.
3. Edit product:
a. The administrator clicks on the edit icon on a product line. The system displays the product information interface and the user can edit the product information.
b. The administrator will edit the product information then click on the
"Update" button. The system updates the product information to the PRODUCT table, then gets information about the product list including id, product name, category name, photo, quantity, price and displays it on the screen.
4. Delete product:
a. The administrator clicks on the delete icon on a product line. The system will delete the selected product from the PRODUCT table.
Use case ends.
o Branching flow:
1. At any point during the use case execution, if the connection to the database is not possible, the system will display an error message and the use case ends.
2. At step 1 in the basic flow, if there are no records in the PRODUCTS table, the system will display “No Data” and the use case ends.
3. At steps 2b and 3b in the basic flow, when the administrator enters invalid brand information, the system will display an error message asking the administrator to re-enter, the administrator can continue to re-enter or click close modal to end.
• Special requirements: It is necessary to control the permission to execute this use case to ensure safety and security.
• Preconditions: The administrator needs to log in with administrative rights before executing the use case.
• Postconditions: After the use case finishes successfully, save the information to the PRODUCTS table
• Extension points: None 2.3.11 Category Management
• Brief description: This use case allows the administrator to view, add, edit, and delete categories.
• Event flow o Basic flow:
1. This use case starts when the user clicks on the “Manage categories”
button on the administration menu bar. The system will get the information from the CATEGORIES table and display it on the screen.
2. Add a new category:
a. The administrator clicks on the “Create new category” button on the category list screen. The system will display the category name input modal.
b. The administrator enters the new category name and clicks on the
“Create new” button. The system will add a new record to the CATEGORIES table, then get information about the new category list and display it on the screen.
3. View details
When the user clicks on the “Details” button, the system will display the category name information interface.
4. Update category
When the user clicks on the “Update” button, the system will display the category name information interface and edit the category name, then update the category name.
5. Delete category:
When the user clicks on the “Delete” button, the system will delete the category from the screen and update the CATEGORIES table.
Use case ends.
o Branching flow:
1. At any point during the use case execution, if the connection to the database cannot be established, the system will display an error message and the use case ends.
2. At step 1 in the basic flow, if there are no records in the CATEGORIES table, the system will display “No Data” and the use case ends.
• Special requirements: It is necessary to control the permission to execute this use case to ensure safety and security.
• Preconditions: The administrator must log in with administrative rights before executing the use case.
• Postcondition: After the use case finishes successfully, save the information to the CATEGORIES table
• Extension point: None
2.3.12. Report View
• Brief description: This use case allows the administrator to view the revenue statistics report.
• Event flow o Basic flow:
1. This use case starts when the user clicks on the “Revenue statistics”
button on the administration menu bar. The system will get information from the USERS, ORDER, ORDERDETAILS, PRODUCT tables and display it on the screen.
Use case ends.
o Branching flow:
1. At any point during the use case execution, if the connection to the database cannot be established, the system will display an error message and the use case ends.
• Special requirements: It is necessary to control the permissions to execute this use case to ensure safety and security.
• Preconditions: The administrator must log in with administrative rights before executing the use case.
• Postconditions: None
• Extension points: None 2.3.13. Report Customer Review
This use case will allow the administrator to access the report on customer reviews.
Basic Course of Events:
The use case commences when the user selects the command Customer Review Report' under the administration menu bar.
It will read CUSTOMER, REVIEW, and PRODUCT input tables and provide an on-screen report. This use case ends there.
Branch Conditions: The use case will end with the system message in case
Special Requirements: User execution rights for this use case should be kept under safe and secure tracks.
Precondition: The administrator should log in on administrative rights before executing this use case.
Condition after executing: None.
Extensibility head: None.
2.3.14. Report ProductView Statistics
Short description: This is a use case in which the administrator will view the report on the statistics about product view.
Flow of events:
Basic flow:
The use case starts when the user clicks the button "Product Viewed Statistics Report" from the menu bar of administration.
The system will get the data from the respective tables PRODUCT, PRODUCTVIEW, and CUSTOMER to formulate the report and shown on- screen.
The use case ends.
Branch flow:
If it happens that while running the use case, the database cannot be connected, then the error message will show up, and the use case ends.
Special requirements: The execution rights for this use case must be controlled so that safety and security are ensured.
Precondition: The case execution must happen only after the administrator logins with administrative rights.
Post-execution conditions: None.
Extension points: None.