{ list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well }
Refer to the guide Setting up and getting started.
The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main
(consisting of classes Main
and MainApp
) is in charge of the app launch and shut down.
The bulk of the app's work is done by the following four components:
UI
: The UI of the App.Logic
: The command executor.Model
: Holds the data of the App in memory.Storage
: Reads data from, and writes data to, the hard disk.Commons
represents a collection of classes used by multiple other components.
How the architecture components interact with each other
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command customerdelete 1
.
NOTE: The sequence diagram shows a simplified execution of the
DeleteCustomerCommand
.
Each of the four main components (also shown in the diagram above),
interface
with the same name as the Component.{Component Name}Manager
class (which follows the corresponding API interface
mentioned in the previous point.For example, the Logic
component defines its API in the Logic.java
interface and implements its functionality using the LogicManager.java
class which follows the Logic
interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
The sections below give more details of each component.
The API of this component is specified in Ui.java
The UI consists of a MainWindow
that is made up of parts e.g. CommandBox
, ResultDisplay
, CustomerListPanel
, StaffListPanel
, DrinkListPanel
, StatusBarFooter
etc. All these, including the MainWindow
, inherit from the abstract UiPart
class which captures the commonalities between classes that represent parts of the visible GUI.
The UI component uses the JavaFx UI framework. The layout of these UI parts are defined in matching .fxml
files that are in the src/main/resources/view
folder. For example, the layout of the MainWindow
is specified in MainWindow.fxml
The UI component:
Logic
component.Model
data so that the UI can be updated with the modified data.Logic
component, because the UI
relies on the Logic
to execute commands.Model
component, as it displays Customer
, Staff
, and Drink
objects residing in the Model
.The HelpWindow
component is shown when you execute a help command. It contains a link to the detailed user and developer guide on this CafeConnect documentation website.
API : Logic.java
Here's a (partial) class diagram of the Logic
component:
The sequence diagram below illustrates the interactions within the Logic
component, taking execute("customerdelete 1")
API call as an example.
NOTE: The lifeline for
DeleteCustomerCommandParser
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
How the Logic
component works:
Logic
is called upon to execute a command, it is passed to an AddressBookParser
object which in turn creates a parser that matches the command (e.g., DeleteCustomerCommandParser
) and uses it to parse the command.Command
object (more precisely, an object of one of its subclasses e.g., DeleteCustomerCommand
) which is executed by the LogicManager
.Model
when it is executed (e.g. to delete a staff).Model
) to achieve.CommandResult
object which is returned back from Logic
.Here are the other classes in Logic
(omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
AddressBookParser
class creates an XYZCommandParser
(XYZ
is a placeholder for the specific command name e.g., AddCommandParser
) which uses the other classes shown above to parse the user command and create a XYZCommand
object (e.g., AddCommand
) which the AddressBookParser
returns back as a Command
object.XYZCommandParser
classes (e.g., AddCommandParser
, DeleteCustomerCommandParser
, ...) inherit from the Parser
interface so that they can be treated similarly where possible e.g, during testing.API : Model.java
The Model
component,
Person
, Staff
, Customer
and Drink
objects (which are contained in a UniquePersonList
, UniqueStaffList
, UniqueCustomerList
and UniqueDrinkList
objects).Person
, Staff
, Customer
or DrinkList
objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Person>
, ObservableList<Staff>
, ObservableList<Customer>
and ObservableList<Drink>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.UserPref
object that represents the user’s preferences. This is exposed to the outside as a ReadOnlyUserPref
objects.Model
represents data entities of the domain, they should make sense on their own without depending on other components)NOTE: An alternative (arguably, a more OOP) model is given below. It has a
Tag
list in theAddressBook
, whichPerson
references. This allowsAddressBook
to only require oneTag
object per unique tag, instead of eachPerson
needing their ownTag
objects.
API : Storage.java
The Storage
component,
AddressBookStorage
and UserPrefStorage
, which means it can be treated as either one (if only the functionality of only one is needed).Model
component (because the Storage
component's job is to save/retrieve objects that belong to the Model
)Classes used by multiple components are in the seedu.address.commons
package.
This section describes some noteworthy details on how certain features are implemented.
AddressBookParser
creates an instance of AddStaffCommandParser
to parse the user input string.
AddStaffCommandParser
first extracts values corresponding to the prefixes sid/
, n/
, p/
, e/
, a/
, role/
, shift/
, hours/
, rating/
, and t/
.
It ensures that:
sid/
must contain a valid staff ID.p/
must contain a valid phone number.e/
must contain a valid email address.a/
must contain a non-blank address.role/
must contain a non-empty role.shift/
must contain a non-empty shift.hours/
must contain a non-negative integer.rating/
must contain a valid positive decimal value.t/
, if provided, must contain one or more non-empty tags.If any of these constraints are violated, AddStaffCommandParser
throws a ParseException
. Otherwise, it creates a new instance of AddStaffCommand
based on the user input.
AddStaffCommand
stores the staff to be added, represented as a Staff
instance.
Upon execution, AddStaffCommand
first checks the model for duplicate staff. If no existing staff member with a matching (case-insensitive) name is found, it adds the new staff member to the catalog.
NOTE: CafeConnect identifies a staff member as a duplicate if their
NAME
matches (case-insensitive) with an existing staff member in the catalog. Attempting to add a duplicate will result in an error.
The delete staff feature allows users to remove staff from the catalog by specifying the staff's index in the displayed list.
The implementation follows the command pattern where AddressBookParser
identifies the command type and delegates to DeleteStaffCommandParser
to create the appropriate command object.
AddressBookParser
creates DeleteStaffCommandParser
to parse user input string.
DeleteStaffCommandParser
extracts the index from the command arguments and ensures:
ParseException
is thrown.If the index is valid, DeleteStaffCommandParser
creates a new instance of DeleteStaffCommand
with the specified index.
Upon execution, DeleteStaffCommand
first checks if the index is within the bounds of the filtered staff list. If the index is out of bounds, a CommandException
is thrown.
If the index is valid, DeleteStaffCommand
:
model.deleteStaff(staffToDelete)
to remove the staff from the catalog.CommandResult
with a success message.NOTE: CafeConnect only allows deleting staff by index. Once a staff member is deleted, they cannot be recovered unless added again manually.
AddressBookParser
creates an instance of AddCustomerCommandParser
to parse the user input string.
AddCustomerCommandParser
first extracts values corresponding to the prefixes cid/
, n/
, p/
, e/
, a/
, rp/
, vc/
, fi/
, ts/
, and t/
.
It ensures that:
cid/
must start with a "C" followed by digits (e.g., C1001
).n/
must contain only alphanumeric characters and spaces, and it cannot be blank.p/
must contain only digits and be at least 3 digits long.e/
must contain a valid email address.a/
can take any value, but it cannot be blank.rp/
must contain only digits.vc/
must contain only digits.fi/
can take any value, but it cannot be blank.ts/
must contain only digits representing the amount in dollars.t/
, if provided, must contain one or more non-empty tags.If any of these constraints are violated, AddCustomerCommandParser
throws a ParseException
. Otherwise, it creates a new instance of AddCustomerCommand
based on the user input.
AddCustomerCommand
stores the customer to be added, represented as a Customer
instance.
Upon execution, AddCustomerCommand
first checks the model for duplicate customers. If no existing customer with a matching (case-insensitive) name is found, it adds the new customer to the customer list.
NOTE: CafeConnect identifies a customer as a duplicate if their
NAME
matches (case-insensitive) with an existing customer in the list. Attempting to add a duplicate will result in an error.
The delete customer feature allows users to remove customers from the catalog by specifying the customer's index in the displayed list.
The implementation follows the command pattern where AddressBookParser
identifies the command type and delegates to DeleteCustomerCommandParser
to create the appropriate command object.
AddressBookParser
creates DeleteCustomerCommandParser
to parse user input string.
DeleteCustomerCommandParser
extracts the index from the command arguments and ensures:
ParseException
is thrown.If the index is valid, DeleteCustomerCommandParser
creates a new instance of DeleteCustomerCommand
with the specified index.
Upon execution, DeleteCustomerCommand
first checks if the index is within the bounds of the filtered customer list. If the index is out of bounds, a CommandException
is thrown.
If the index is valid, DeleteCustomerCommand
:
model.deleteCustomer(customerToDelete)
to remove the customer from the catalog.CommandResult
with a success message.NOTE: CafeConnect only allows deleting customers by index. Once a customer is deleted, they cannot be recovered unless added again manually.
The implementation of the drink management system follows the convention of normal commands, where AddressBookParser
is responsible for parsing user input strings into executable commands.
AddressBookParser
creates AddDrinkCommandParser
to parse user input string.
AddDrinkCommandParser
first obtains the values corresponding to the prefixes n/
, p/
, and c/
.
AddDrinkCommandParser
ensures that:
n/
must contain a valid drink name.p/
must contain a valid positive decimal value.c/
must contain a non-empty category name.If any of the above constraints are violated, AddDrinkCommandParser
throws a ParseException
. Otherwise, it creates a new instance of AddDrinkCommand
that corresponds to the user input.
AddDrinkCommand
comprises of the drink to be added, which is an instance of Drink
.
Upon execution, AddDrinkCommand
first queries the supplied model if it contains a duplicate drink. If no duplicate drink exists (based on case-insensitive name matching), then AddDrinkCommand
adds the drink into the drink catalog.
NOTE: CafeConnect identifies a drink as a duplicate if its
NAME
matches (case-insensitive) with an existing drink in the catalog. Attempting to add a duplicate will result in an error.
The delete drink feature allows users to remove drinks from the catalog by specifying the index of the drink in the displayed list.
The implementation follows the command pattern where AddressBookParser
identifies the command type and delegates to DeleteDrinkCommandParser
to create the appropriate command object.
AddressBookParser
creates DeleteDrinkCommandParser
to parse user input string.
DeleteDrinkCommandParser
extracts the index from the command arguments and ensures:
ParseException
is thrown.If the index is valid, DeleteDrinkCommandParser
creates a new instance of DeleteDrinkCommand
with the specified index.
Upon execution, DeleteDrinkCommand
first checks if the index is within the bounds of the filtered drink list. If the index is out of bounds, a CommandException
is thrown.
If the index is valid, DeleteDrinkCommand
:
model.deleteDrink(drinkToDelete)
to remove the drink from the catalogCommandResult
with a success messageNOTE: CafeConnect only allows deleting drinks by index. Once a drink is deleted, it cannot be recovered unless added again manually.
The implementation of the purchase command follows the convention of normal commands, where AddressBookParser
is responsible for parsing user input strings into executable commands.
AddressBookParser
creates PurchaseCommandParser
to parse user input string.
PurchaseCommandParser
obtains:
n/
redeem/
PurchaseCommandParser
ensures that:
If any of the above constraints are violated, PurchaseCommandParser
throws a ParseException
. Otherwise, it creates a new instance of PurchaseCommand
with the customer index, drink name, and redemption status.
Upon execution, PurchaseCommand
performs the following steps:
NOTE: The points calculation follows a fixed rate of 10 points per dollar spent. Redemption follows a rate of 100 points equivalent to $1 in drink value.
The implementation of shortcut commands (c
for customers and s
for staff) provides an efficient way to add new entries with minimal typing.
AddressBookParser
detects single-letter commands and routes them to the appropriate handler:
c
routes to the customer shortcut handlers
routes to the staff shortcut handlerThe shortcut format follows a pattern of ID:NAME:PHONE
with colon separators.
Upon receiving a shortcut command, the parser:
NOTE: Shortcut commands only accept three parameters (ID, name, and phone). Other fields are set to default values and can be updated later using the edit commands.
The implementation of the hours tracking system allows café owners to record staff working hours.
AddressBookParser
creates HoursAddCommandParser
to parse user input string.
HoursAddCommandParser
obtains:
ind/
h/
HoursAddCommandParser
ensures that:
Upon execution, HoursAddCommand
:
NOTE: The hours tracking system is cumulative, with each
hoursadd
command adding to the staff member's existing hours rather than replacing them.
CaféConnect uses JSON-based storage to persist data across application restarts. The storage implementation separates different entity types into distinct files:
addressbook.json
: Stores staff and customer datadrinkcatalog.json
: Stores drink catalog datapreferences.json
: Stores user preferences like window size and positionWhen saving data, the following sequence occurs:
On application startup, the reverse process occurs:
NOTE: CaféConnect implements data backup and recovery mechanisms. If a data file is corrupted, the application attempts to back it up before creating a new empty data structure.
Target user profile:
Value proposition: manage customers, staff, suppliers, and maintenance faster and more efficiently than a typical mouse/GUI-driven app, all in one centralized system tailored for a fast-paced café environment.
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
* * * | café owner | add a staff member's phone number | contact them when needed. |
* * * | café owner | delete a staff member's phone number | keep my contact list updated. |
* * * | café owner | view a list of all staff phone numbers | quickly find and reach them. |
* * * | café owner | search for a staff member by name to retrieve their phone number | quickly find the right contact. |
* * * | café owner | view a list of supplier emails | map stock requests to specific emails. |
* * | café owner | set up autofill fields for frequently entered data | avoid repetitive typing. |
* * | café owner | enable autofill for supplier names | avoid having to type them repeatedly when creating orders. |
* * | café owner | enable autofill for supplier email addresses | quickly send stock requests without re-entering details. |
* * | café owner | enable autofill for supplier phone numbers | contact them without needing to look up their details every time. |
* * | café owner | enable autofill for commonly ordered stock items | quickly add them to an order form. |
* * | café owner | enable autofill for standard pricing of stock items | avoid manually entering expected costs. |
* * | café owner | enable autofill for my café's business details | avoid having to repeatedly enter them when placing orders. |
* * | café owner | edit or update saved autofill fields | ensure information remains accurate. |
* | café owner | disable autofill fields | enter information manually when necessary. |
* * | café owner | view a list of all autofill fields I have set up | manage them easily. |
* * | café owner | delete autofill entries for outdated suppliers or items | prevent storing unnecessary data. |
* | café owner | categorize autofill fields | organize frequently entered data more efficiently. |
* * | café owner | enable autofill suggestions when entering data | choose from previously used values instead of typing them manually. |
* * * | café owner | add new customers | track their purchase history. |
* * * | café owner | record a drink ordered by a customer in their account | record the history the customer has with us. |
* * * | café owner | track the data on the types of drinks the customer orders | tell when a customer has a favourite drink. |
* * * | café owner | add to a list of supplier emails | keep track of each supplier contact. |
* * * | café owner | delete from list of supplier emails | keep the list updated. |
{More to be added}
(For all use cases below, the System is the Café Management System and the Actor is the café owner, unless specified otherwise)
Use case: Add a Staff Member
MSS
Extensions
4a. Provided name format is invalid.
4a1. System shows an error message.
4a2. Use case resumes at step 2.
4b. Provided phone number is invalid.
4b1. System shows an error message.
4b2. Use case resumes at step 2.
4c. Role description exceeds character limit.
4c1. System shows an error message.
4c2. Use case resumes at step 2.
4d. Staff member with the same name and phone number already exists.
4d1. System shows a duplication error message.
Use case ends.
4e. Staff member with the same name but different phone number exists.
4e1. System prompts to confirm if phone number should be updated.
4e2. Café owner chooses not to update.
Use case ends.
4e3. Café owner chooses to update.
System updates phone number.
System confirms update.
Use case ends.
Use case: Delete a Staff Member
MSS
Café owner requests to delete a staff member.
System prompts for the staff member's name.
Café owner provides the staff member’s name.
System checks if the staff member exists.
System deletes the staff member.
System confirms the deletion.
Use case ends.
Extensions
4a. No staff member with the given name is found.
4a1. System shows an error message.
Use case ends.
4b. Multiple staff members with the same name are found.
4b1. System prompts for the phone number.
4b2. Café owner provides the phone number.
4b3. System validates and deletes the correct entry.
4b4. System confirms the deletion.
Use case ends.
Use case: View Staff List
MSS
Café owner requests to view the staff list.
System retrieves and displays the list of staff members.
Use case ends.
Extensions
2a. The staff list is empty.
2a1. System shows a message indicating no staff members are found.
Use case ends.
Use case: Search Staff by Name
MSS
Café owner requests to search for a staff member by name.
System prompts for the staff member’s name.
Café owner provides the staff member’s name.
System searches for matching staff members.
System displays matching staff members.
Use case ends.
Extensions
4a. No staff members with the given name are found.
4a1. System shows a message indicating no matches.
Use case ends.
4b. Multiple staff members with the same name are found.
4b1. System displays all matching entries.
Use case ends.
Use case: Define a Reward
MSS
Café owner requests to define a new reward.
System prompts for reward details: reward name and points required.
Café owner provides the required details.
System validates the input.
System adds the new reward.
System confirms the addition.
Use case ends.
Extensions
4a. Provided reward name format is invalid.
4a1. System shows an error message.
4a2. Use case resumes at step 2.
4b. Provided points value is invalid.
4b1. System shows an error message.
4b2. Use case resumes at step 2.
4c. Reward with the same name already exists.
4c1. System shows a duplication error message.
Use case ends
Use case: Edit a Reward
MSS
Café owner requests to edit an existing reward.
System prompts for reward name and new points required.
Café owner provides the reward name and updated points.
System checks if the reward exists.
System updates the reward.
System confirms the update.
Use case ends.
Extensions
4a. Reward not found.
4a1. System shows an error message.
Use case ends.
4b. Provided points value is invalid.
4b1. System shows an error message.
4b2. Use case resumes at step 2.
Use case: Track Customer Points
MSS
Café owner requests to update customer points.
System prompts for customer name and points to add or deduct.
Café owner provides the customer name and points.
System validates the input.
System updates the customer’s points balance.
System confirms the update.
Use case ends.
Extensions
4a. Provided customer name format is invalid.
4a1. System shows an error message.
4a2. Use case resumes at step 2.
4b. Provided points value is invalid.
4b1. System shows an error message.
4b2. Use case resumes at step 2.
4c. Customer not found.
4c1. System shows an error message.
Use case ends.
4d. Multiple customers with the same name are found.
4d1. System prompts for a unique identifier (e.g., phone number).
4d2. Café owner provides the identifier.
4d3. System validates and updates the correct entry.
4d4. System confirms the update.
Use case ends.
Use case: Redeem a Reward
MSS
Café owner requests to redeem a reward for a customer.
System prompts for customer name and reward name.
Café owner provides the required details.
System checks if the customer and reward exist.
System verifies if the customer has enough points.
System deducts the required points and confirms the redemption.
Use case ends.
Extensions
4a. Customer not found.
4a1. System shows an error message.
Use case ends.
4b. Reward not found.
4b1. System shows an error message.
Use case ends.
5a. Customer does not have enough points.
5a1. System shows an insufficient points message.
Use case ends.
Use case: View Customer Visit History
MSS
Café owner requests to view a customer’s visit history.
System prompts for the customer’s name.
Café owner provides the customer’s name.
System retrieves and displays the customer’s visit history.
Use case ends.
Extensions
4a. Customer not found.
4a1. System shows an error message.
Use case ends.
4b. Customer has no recorded visits.
4b1. System shows a message indicating no visit history.
Use case ends.
Use case: Generate Daily Sales Summary
MSS
Café owner requests a daily sales summary for a specific date.
System validates the date format.
System retrieves sales data for the given date.
System compiles the sales summary, including total revenue, transaction count, and most popular item.
System displays the daily sales summary.
Use case ends.
Extensions
2a. Provided date format is invalid.
2a1. System shows an error message.
Use case ends.
3a. No sales data found for the given date.
3a1. System shows a message indicating no recorded transactions.
Use case ends.
Use case: Generate Customer Insights Report
MSS
Café owner requests customer insights by providing a customer name or choosing a predefined report type (e.g., top spenders, popular items).
System validates the input.
System retrieves and compiles the requested insights.
System displays the customer insights report.
Use case ends.
Extensions
2a. Provided customer name format is invalid.
2a1. System shows an error message.
Use case ends.
2b. No data available for the requested report.
2b1. System shows a message indicating lack of data.
Use case ends.
3a. Customer not found.
3a1. System shows an error message.
Use case ends.
Use case: Monitor Stock Levels
MSS
Café owner requests to check stock levels for a specific item or set a low-stock threshold alert.
System validates the input.
System retrieves current stock data.
System displays the stock levels or sets the threshold alert.
Use case ends.
Extensions
2a. Provided item name format is invalid.
2a1. System shows an error message.
Use case ends.
2b. Item not found in inventory.
2b1. System shows an error message.
Use case ends.
2c. Provided threshold value is invalid.
2c1. System shows an error message.
Use case ends.
3a. Stock level is below the threshold.
3a1. System shows a low-stock alert message.
Use case ends.
Use case: View Customer Rewards
MSS
Café owner requests to view a customer’s reward points.
System validates the customer name.
System retrieves and displays the customer’s reward points and eligible rewards.
Use case ends.
Extensions
2a. Provided customer name format is invalid.
2a1. System shows an error message.
Use case ends.
3a. Customer not found.
3a1. System shows an error message.
Use case ends.
Use case: View Customer Order History
MSS
Café owner requests to view a customer’s order history.
System validates the customer name.
System retrieves and displays the customer’s past orders.
Use case ends.
Extensions
2a. Provided customer name format is invalid.
2a1. System shows an error message.
Use case ends.
3a. Customer not found.
3a1. System shows an error message.
Use case ends.
3b. No past orders found for the customer.
3b1. System shows a message indicating no recorded orders.
Use case ends.
Use case: Record Customer Feedback
MSS
Café owner requests to add feedback for a customer.
System prompts for customer name, rating, and feedback message.
Café owner provides the required details.
System validates the input.
System records the feedback.
System confirms the feedback addition.
Use case ends.
Extensions
4a. Provided customer name format is invalid.
4a1. System shows an error message.
4a2. Use case resumes at step 2.
4b. Provided rating is out of the accepted range.
4b1. System shows an error message.
4b2. Use case resumes at step 2.
4c. Feedback message exceeds character limit.
4c1. System shows an error message.
4c2. Use case resumes at step 2.
4d. Customer not found.
4d1. System shows an error message.
Use case ends.
Use case: Add a Supplier Email
MSS
Café owner requests to add a new supplier email.
System prompts for the supplier's name and email.
Café owner provides the required details.
System validates the input.
System adds the new supplier.
System confirms the addition.
Use case ends.
Extensions
4a. Provided name format is invalid.
4a1. System shows an error message.
4a2. Use case resumes at step 2.
4b. Provided email format is invalid.
4b1. System shows an error message.
4b2. Use case resumes at step 2.
4c. Supplier with the same name and email already exists.
4c1. System shows a duplication error message.
Use case ends.
4d. Supplier with the same name but a different email exists.
4d1. System prompts to confirm if email should be updated.
4d2. Café owner chooses not to update.
Use case ends.
4d3. Café owner chooses to update.
System updates the email.
System confirms the update.
Use case ends.
4e. Required fields are missing.
4e1. System shows an error message.
4e2. Use case resumes at step 2.
Use case: Delete a Supplier Email
MSS
Café owner requests to delete a supplier email.
System prompts for the supplier's name.
Café owner provides the supplier's name.
System checks if the supplier exists.
System deletes the supplier.
System confirms the deletion.
Use case ends.
Extensions
4a. No supplier with the given name is found.
4a1. System shows an error message.
Use case ends.
4b. Multiple suppliers with the same name are found.
4b1. System prompts for the email.
4b2. Café owner provides the email.
4b3. System validates and deletes the correct entry.
4b4. System confirms the deletion.
Use case ends.
Use case: View Supplier Email List MSS
Café owner requests to view the supplier email list.
System retrieves and displays the list of suppliers.
Use case ends.
Extensions
2a. The supplier list is empty.
2a1. System shows a message indicating no suppliers are found.
Use case ends.
Use case: View Supplier Email List
MSS
Café owner requests to view the supplier email list.
System retrieves and displays the list of suppliers.
Use case ends.
Extensions
2a. The supplier list is empty.
2a1. System shows a message indicating no suppliers are found.
Use case ends.
Performance & Scalability
The application should be able to handle up to 1000 total entries (staff, customers, and drinks combined) without noticeable sluggishness in performance.
The system should respond to user actions within 1 second for typical operations like adding, deleting, or searching for customers and staff.
The startup time should be no more than 2 seconds on a modern consumer-grade computer.
The application should consume no more than 200MB of RAM during normal operation with 1000 total entries.
Compatibility & Portability
The application should be compatible with Java 11 or above and run on any mainstream OS (Windows, Linux, macOS).
The application should work consistently across different screen resolutions and window sizes.
The system should be self-contained and should not require an internet connection or external databases.
Usability & Accessibility
A café owner with basic typing skills should be able to accomplish most tasks faster using commands than using a mouse-driven interface.
The tabbed interface should provide intuitive separation between staff management, customer records, and the drink catalog.
The application should provide clear, contextual error messages when a user makes an incorrect input.
Command shortcuts (like c
and s
) should make frequent operations more efficient.
Reliability & Robustness
The system should not crash or freeze when an invalid command is entered.
Customer, staff, and drink data should be persisted safely to prevent accidental loss due to application crashes.
The application should validate all inputs to prevent data corruption.
The system should be able to recover gracefully from unexpected failures (e.g., power loss, abrupt shutdowns).
Security & Privacy
The system should store customer and staff contact information securely.
The application should not expose private data unnecessarily in logs or error messages.
Maintainability & Extensibility
The codebase should maintain separation between the UI, Logic, Model, and Storage components.
New commands and features should be able to be added without modifying existing code.
The command structure should be consistent to make the application easier to learn and extend.
Domain-Specific Requirements
The reward points system should accurately track customer loyalty across multiple visits.
The application should support point redemption with clear feedback about points used and remaining.
Staff performance metrics should be maintainable and viewable.
Mainstream OS: Operating systems commonly used by the majority of users, including Windows, Linux, Unix, and macOS.
Private contact detail: A contact detail that is not meant to be shared with others, such as a personal phone number, home address, or private email.
Typical usage: Standard operations performed within the application, including adding, editing, deleting, and searching for contacts, assuming a user base of up to 1000 persons.
Command-based interaction: A method of input where users type textual commands to execute actions instead of using a graphical user interface (GUI).
Graphical User Interface (GUI): A visual interface that allows users to interact with the system through elements like buttons, forms, and icons instead of typing commands.
Error message: A message displayed by the system when a user enters an invalid input or an operation cannot be completed, providing clear guidance on how to correct the issue.
Modern consumer-grade computer: A personal computer with at least a quad-core processor and 8GB of RAM, manufactured within the last five years.
Modular codebase: A structured code design where different components can be modified, replaced, or extended independently without affecting the overall system.
Persisted data: Information that is stored and retained across application restarts, ensuring that user data is not lost when the application is closed.
Startup time: The time taken from launching the application to when it is fully ready for user interaction.
Authorized user: A user who has been granted specific permissions to access certain functionalities within the system.
Self-contained application: An application that does not require external dependencies or an internet connection for its core features to function.
Scalability: The system’s ability to maintain performance and responsiveness even as the user base or data size increases.
Undo/Redo functionality: A feature that allows users to reverse or reapply their last action, improving usability and error recovery.
Extensibility: The ability to add new features or enhance existing ones without major rework of the system.
Logging and audit trail: A system feature that records user actions and system events for security, debugging, or compliance purposes.
Given below are instructions to test the app manually.
NOTE: These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing.
Initial launch
java -jar cafeconnect.jar
in a terminal.Saving window preferences
Opening help window via Command Line
help
Opening help window via Tool bar
Help
menu, then click on the Help
optionInteracting the help window
Closing the help window
Adding a customer
customeradd cid/C005 n/James Bond p/98765432 e/jamesbond@example.com a/123 Spy Street rp/0 vc/0 fi/Martini ts/0
customeradd cid/C001 n/Duplicate Customer p/12345678 e/dup@example.com a/Duplicate Address rp/0 vc/0 fi/Coffee ts/0
Adding a customer using shortcut
c C099:John Smith:98761234
Deleting a customer
customerdelete 1
customerdelete 0
customerdelete
, customerdelete x
, customerdelete 999
(where x is non-numeric and 999 is larger than the list size)Adding a staff member
staffadd sid/S005 n/Emily Wong p/91234567 e/emily@example.com a/456 Worker Ave role/Manager shift/9am-5pm hours/0 rating/5.0
Adding a staff member using shortcut
s S099:Jane Doe:90001234
Deleting a staff member
staffdelete 1
Adding hours worked
hoursadd ind/1 h/5
Adding a drink to the catalog
drinkadd n/Green Tea p/3.50 c/Tea
Recording a purchase
purchase 1 n/Espresso
Redeeming points for a purchase
purchase 1 n/Cappuccino redeem/true
purchase 1 n/Expensive Drink redeem/true
(where the customer doesn't have enough points)Exiting via command
exit
Exiting via window controls