Skip to content

Commit

Permalink
Merge pull request #190 from 1simjustin/docs/dg
Browse files Browse the repository at this point in the history
DG Pagination
  • Loading branch information
djleong01 committed Apr 15, 2024
2 parents 955b2fc + c58ac5a commit 174bbb7
Showing 1 changed file with 58 additions and 47 deletions.
105 changes: 58 additions & 47 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
- [PIN](#pin)
- [Chart](#chart)
- [Exceptions and Logging](#exceptions-and-logging)
- [User Stories](#user-stories)
- [Product scope](#product-scope)
- [Target user profile](#target-user-profile)
- [Value proposition](#value-proposition)
- [User Stories](#user-stories)
- [Non-Functional Requirements](#non-functional-requirements)
- [Glossary](#glossary)
- [Instructions for Testing](#instructions-for-testing)
Expand Down Expand Up @@ -56,16 +56,31 @@ The high-level overview of the application is provided in the flowchart below as

Design and Implementation has been broken down into the subsequent sections, each tagged for ease of reference:

* [UI and I/O](#ui-and-io)
* [Commands](#commands)
* [Storage](#storage)
* [Group and GroupList](#group-and-grouplist)
* [Member and MemberList](#member-and-memberlist)
* [Transaction and TransactionList](#transaction-and-transactionlist)
* [DateTime](#DateTime)
* [PIN](#pin)
* [Chart](#chart)
* [Exceptions and Logging](#exceptions-and-logging)
- [Developer Guide](#developer-guide)
- [Table of Contents](#table-of-contents)
- [Acknowledgements](#acknowledgements)
- [Design \& Implementation](#design--implementation)
- [UI and I/O](#ui-and-io)
- [Commands](#commands)
- [Storage](#storage)
- [Group and GroupList](#group-and-grouplist)
- [Member and MemberList](#member-and-memberlist)
- [Transaction and TransactionList](#transaction-and-transactionlist)
- [DateTime](#datetime)
- [PIN](#pin)
- [Chart](#chart)
- [Exceptions and Logging](#exceptions-and-logging)
- [User Stories](#user-stories)
- [Product scope](#product-scope)
- [Target user profile](#target-user-profile)
- [Value proposition](#value-proposition)
- [Non-Functional Requirements](#non-functional-requirements)
- [Glossary](#glossary)
- [Instructions for Testing](#instructions-for-testing)
- [Manual Testing](#manual-testing)
- [JUnit Testing](#junit-testing)
- [Text UI Testing](#text-ui-testing)
- [Future Enhancements](#future-enhancements)

### UI and I/O

Expand Down Expand Up @@ -679,7 +694,7 @@ import longah.util.DateTime;
import longah.util.Transaction;
// In pareTransaction() method of the Transaction Class
// Check for the special prefix of date & time component while adding parsing user expression
// Check for prefix of date & time component while adding parsing user expression
if (splitInput[0].contains("t/")) {
String[] splitLenderTime = splitInput[0].split("t/", 2);
...
Expand Down Expand Up @@ -831,21 +846,14 @@ This diagram shows the sequence when the user resets their PIN.

Given below is an example usage scenario and how the PIN creation and authentication mechanism behaves at each step:

1. The user launches the application for the first time. The PINHandler initializes, loading the saved PIN and
authentication enabled status from the file. If no PIN exists, it prompts the user to create a new PIN.
2. The user creates a new 6-digit PIN using the createPin method. The entered PIN is hashed using SHA-256 before
saving it to the file.
3. The user enables authentication upon startup using the 'pin enable' command. The authenticationEnabled flag is set to True and saved to the file.
4. The user closes the application and relaunches it. The PINHandler loads the saved PIN and authentication
enabled status from the file again.
5. The user attempts to log in by entering their PIN. The authenticate method hashes the entered PIN and
compares it with the saved hashed PIN. If they match, the user is successfully authenticated. Otherwise, the user is denied access.
6. The user decides to reset their PIN by entering their current PIN and creating a new one using the resetPin
method.
7. The user disables authentication upon startup using the 'pin disable' command. The authenticationEnabled flag
is set to false and saved to the file.
8. The user relaunches the application, and authentication is no longer required since it has been disabled.
The user can proceed with the application and do any actions without entering a PIN.
1. PINHandler initialization loads the saved PIN and authentication enabled status from the file. If no PIN exists, prompt the user to create a new PIN.
2. User creates a new 6-digit PIN using the createPin method. The entered PIN is hashed using SHA-256 before saving it to the file.
3. User enables authentication upon startup using the 'pin enable' command. The authenticationEnabled flag is set to True and saved to the file.
4. The user closes the application and relaunches it. The PINHandler loads the saved PIN and authentication enabled status from the file again.
5. The user attempts to log in by entering their PIN. The authenticate method hashes the entered PIN and compares it with the saved hashed PIN.If they match, the user is successfully authenticated. Otherwise, the user is denied access.
6. The user decides to reset their PIN by entering their current PIN and creating a new one using the resetPin method.
7. The user disables authentication upon startup using the 'pin disable' command. The authenticationEnabled flag is set to false and saved to the file.
8. On relaunch, authentication is not required since it was disabled. The user can proceed with the application and do any actions without entering a PIN.

Code Segment:
```
Expand All @@ -861,8 +869,6 @@ PINHandler.authenticate();
}
```

<div style="page-break-after: always;"></div>

<ins> Design Considerations </ins>

Resetting PIN: The resetPin() method allows users to change their PIN by first verifying their current PIN. This adds
Expand Down Expand Up @@ -902,16 +908,16 @@ The `Chart` class consists of the following components:
distinguishes positive and negative balances and adds tooltips for enhanced user interaction. Additionally, it includes
an annotation recommending a command for managing debts effectively.

<div style="page-break-after: always;"></div>

<ins>Usage Example</ins>

Given below is an example usage scenario and how the Chart class behaves at each step:

1. The user adds a few members to the group and performs transactions among them.
2. The user enters the 'chart' command to view the current balances of all members.

Code Segment
<div style="page-break-after: always;"></div>

Code Segment:
```
// Prepare data
List<String> members = Arrays.asList("Member1", "Member2", "Member3");
Expand All @@ -935,8 +941,6 @@ hovered over.
Annotation: An annotation is included to suggest a command for managing debts efficiently, ensuring users
are aware of available features within the application.

<div style="page-break-after: always;"></div>

### Exceptions and Logging

<ins>Overview</ins>
Expand All @@ -957,6 +961,8 @@ The `LongAhException` class has the following static field:
The `Logging` class has the following static field:
* *longAhLogger*: A Logger type object to perform the logging.

<div style="page-break-after: always;"></div>

<ins>Constructor</ins>

The `LongAhException` class calls the Exception constructor using the message associated with the received ExceptionMessage and stores the type of exception.
Expand All @@ -974,8 +980,6 @@ The `Logging` class has the following key methods:
* *logInfo*: Takes a string `message` as an argument. Create a log at the INFO level.
* *logWarning*: Takes a string `message` as an argument. Create a log at the WARNING level.

<div style="page-break-after: always;"></div>

<ins>Usage Example</ins>

Use of the `LongAhException` class is demonstrated below, including throwing of an exception and printing the desired output message. This example covers the throwing exception due to invalid index.
Expand Down Expand Up @@ -1003,17 +1007,6 @@ Logging.logInfo(message);
Logging.logWarning(message);
```

## Product scope

### Target user profile

Busy people with large transaction quantities among friends

### Value proposition

- Help users to find the least transactions solution to a large quantity of transactions
- Allow users to view past expenses of a group

<div style="page-break-after: always;"></div>

## User Stories
Expand Down Expand Up @@ -1043,6 +1036,20 @@ Busy people with large transaction quantities among friends
| v2.1 | user | filter transactions based on transaction time | reference a transaction made during an interested time period |
| v2.1 | advanced user | have command shortcuts | input commands faster |


## Product scope

### Target user profile

Busy people with large transaction quantities among friends

### Value proposition

- Help users to find the least transactions solution to a large quantity of transactions
- Allow users to view past expenses of a group

<div style="page-break-after: always;"></div>

## Non-Functional Requirements

* Technical Requirements: Any mainstream OS, i.e. Windows, macOS or Linux, with Java 11 installed. Instructions for downloading Java 11 can be found [here](https://www.oracle.com/sg/java/technologies/javase/jdk11-archive-downloads.html).
Expand All @@ -1059,6 +1066,8 @@ Busy people with large transaction quantities among friends
* Group - Discrete units each containing their respective lists of Member and Transaction.
* Separator - "\|" has been used to denote separator within this document but within the Storage related classes, the ASCII Unit Separator as denoted by ASCII 31 is used instead. This is defined within `StorageHandler`.

<div style="page-break-after: always;"></div>

## Instructions for Testing

### Manual Testing
Expand Down Expand Up @@ -1095,6 +1104,8 @@ All tests passed!
2 tests failed: MEMBER 2
```

<div style="page-break-after: always;"></div>

## Future Enhancements

The following are features we intend to include in future iterations of this application.
Expand Down

0 comments on commit 174bbb7

Please sign in to comment.