-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS2113T-T12-2] PayMeBack #31
base: master
Are you sure you want to change the base?
Changes from 250 commits
b38f3a4
ece2718
4d3921a
751879e
917fb2c
5910b70
e9c03f7
24f03e1
78816cd
41e0bba
d6153fd
2cd0f29
d3ab8a0
bae3243
e9c343d
c5d8b4f
cca6bf4
530caa0
3b89b5f
5f6b666
147dfbd
22b538d
4b933d6
57345ce
b79ef82
6a3a195
d6b8935
ef42682
ded548b
e1ec762
67f594e
2743014
3e8c609
3e2b65b
f156f26
73d2104
e57e5a7
a3d8a04
1da9282
eb68f35
69e087d
cd4b77d
ee4a744
39276b6
ffadeea
d26f1b4
ac6235b
4dca363
c18343f
81676ae
9ab966d
7b050ab
13fe163
049ffdd
7b4d23b
6ba4fab
7b73641
97ff228
6e714b6
1405393
fc1a506
5c59ecc
c9719eb
820acb0
d6acfe3
fdd0de6
69ec1e2
1c5aa8c
fa83d1b
5922050
84906e6
e096035
968a59e
f67bb36
8183a79
4f3b568
d00cf84
41576d8
c4cf096
b299ccb
a2f236d
228f90e
ef2eee7
ed8b8cf
35e4491
6acd73a
9bb60f0
4e3e95e
48f4b5f
dafefb3
4d707b6
13ea2d4
99143fa
1232c56
4ae7376
4bf4295
3088d45
5e65219
4204327
afe847d
4b30fd5
7b832ef
cedabb6
6640513
8a4553e
0d0bbac
f607102
1bda179
2a6dcbb
5ba8721
364c7d9
849ad16
99a04d4
6f3ebf5
3df7ee3
f84993e
714de85
0285941
647fda3
2e0d939
7260ecd
3f1fc94
a90ceb8
a9fb34f
77eff87
d93284c
8dbcbb1
01e0205
a90c95c
4f8ef22
805adbd
f91abb0
c030c69
b466cf0
56131df
15dcd8b
4bb5310
0a52833
4e34264
eeec27e
9c95fd3
53839ad
a2e80ed
5758fc4
0eb02be
b084f7d
1721bbe
ab2ab0f
bc14608
0572548
82166a2
026f29d
8b424af
ebc6a06
28d4e12
53d1a69
a85a6c2
6917217
0eb2414
0fdf3bf
f081d95
6f13fe3
00847b3
0630e97
d275703
c3e1d29
82d27ab
5b3a539
91f5442
54e17db
9205b18
0da57ee
40849ef
63349eb
31e94d9
745440b
3f963f5
c8cb614
2acccf4
71e4d6e
31ea7ce
a15d47b
b78cecc
d9500ed
715acca
e9cbb6b
8f0216f
cfb0d67
7b44422
56be89a
47ac179
049342d
3a34a22
7a05996
5e8ddbf
2f5413f
90446bc
79bd7c8
fab093c
8229f6d
117e4d3
0d57a91
b213551
21b7be3
69e4c7e
640fbf1
3e693ad
6d16aa1
44c68f7
6f8f4c1
fa2b91b
6cf773b
bd1c572
2cc02ed
1880555
03ea6bc
d00c305
8c9aa6e
ec7ccdd
c71e578
0a5a184
41621b8
603bc67
64281c0
bc0f1ca
45f98c4
f9cd37e
100aa27
ea9183c
38c777b
9a636c8
d659d8a
7452419
2e74c27
9a261af
4967fb2
ba7e77f
12ffc8b
628b4f1
4bb095b
0b72e18
67c4988
3445567
25091de
bfd9244
060a243
efe8ccb
9ab3d6e
3f407a9
82e898b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
name: Bug report (Customised Template) | ||
about: Template to provide bug reports | ||
title: '' | ||
labels: type.Bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Bug Description** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Actual Behaviour** | ||
Provide any output of what actually happened, and the stack trace if possible. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report (Github Template) | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: User Stories | ||
about: Blank template (with some tags set) for adding new user stories | ||
title: '' | ||
labels: type.Story | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ bin/ | |
|
||
/text-ui-test/ACTUAL.txt | ||
text-ui-test/EXPECTED-UNIX.TXT | ||
src/main/java/seedu/duke/Mytest.java | ||
trips.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,91 @@ | |
|
||
## Acknowledgements | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
Third party library used: GSON under Apache License 2.0 | ||
|
||
## Design & implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
## Design | ||
|
||
### Architecture | ||
The ***Architecture Diagram*** given above explains the high-level design of the App. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Diagram remained to be finished There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep I agree, better to have atleast a few class diagrams |
||
|
||
Given below is a quick overview of main components and how they interact with each other. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could add an object diagram here to show how the classes interact with one another |
||
**Main components of the architecture** | ||
|
||
`Main` is responsible for initialising the different components correctly at app launch, and connecting them with one another. | ||
|
||
`Commons` represents a collection of classes used by multiple components. | ||
The major classes in `Commons` are `Trip`, `Expense` and `Person`. | ||
Further elaboration on these classes will be in the following sections later. | ||
|
||
The remaining components are as follows: | ||
|
||
`Ui`: The User Interface of the App | ||
`Parser`: The command executor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having line breaks here may improve your DG as it makes the DG more readable and easier to understand, and it will be slightly less cluttered. |
||
`Storage`: Holds the data of the App in memory, and also reads and writes data to the hard disk | ||
|
||
**How the architecture components interact with one another** | ||
|
||
The ***Sequence Diagram*** below shows how the components interact with each other. | ||
For this particular interaction, the user has issued the command | ||
`create` with the correct input parameters. | ||
|
||
The sections below provide more details of the components and classes in them. | ||
|
||
|
||
### `Trip` Class | ||
|
||
The `Trip` class contains attributes storing the details of trips added by the user, | ||
and is a container class for the expenses (each expense being represented by an | ||
instance of the `Expense` class) and persons (each person being represented by an | ||
instance of the `Person` class) tagged to the trip. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the Trip class contains many other classes and constructors of the other classes, would a UML diagram here help with the clarity of your DG? |
||
A trip is created when the `Parser` class calls its `executeCreate()` method to instantiate | ||
a new instance of `Trip`. The newly-created trip is then added to the `ArrayList<Trip>` | ||
in the Storage class | ||
|
||
Although the program is able to store zero trips, in order for it to work at any appreciable level, | ||
there must be at least one trip added by the user (either through input or through loading from the | ||
save file) in order for any other features to be available. If there are no trips added, the program | ||
will repeatedly prompt the user to add a new trip. | ||
|
||
### `Person` Class | ||
The Person Class, | ||
* Represents an individual that participated in an expense or a whole trip. | ||
* A user-defined amount of `Person` objects will be created by the user during the create function of the `Trip` Class. | ||
* Every time an object is created of the `Expense` Class, the user may define the people who were involved in the expense, however the people who are added to the expense must be already a `Person` object in the `Trip` object that the expense was made. | ||
* One `Person` object who was involved in the expense will then be appointed as the payer of the group, the user will then have to indicate how much (in foreign currency) each of the participating persons spent for that particular expense. This is then stored and updated in each of the respective `Person` object’s `moneyOwed` HashMap, where a positive double refers to how much the person owes the respective Person object (i.e. the key of the HashMap) and a negative double refers to how much the Person object (i.e. the key of the HashMap) owes to that instance of the Person object. | ||
* Example: If the HashMap = {person2 = 22, person3 = -11} in the person1 object, then person1 owes person2 $22 and person3 owes person1 $11. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a fellow developer, I would like to recommend that the description for each your classes could follow a standard format. This would help the reader easily understand the idea/explanations of the concepts. |
||
|
||
### `Ui` Class | ||
|
||
The `Ui` class handles everything that the user sees, which includes exception handling messages, outputs to users and feedback. | ||
|
||
`Ui` class consists of multiple print methods, where some are listed above in the UML diagram. `Ui` depends on other classes, | ||
such as `Storage`, `Parser`, `Trip` and `Expense` to obtain information stored in these classes. | ||
|
||
The `Ui` class, | ||
- Obtains information from Storage, Parser, Trip and Expense components. | ||
- Prints the information through the terminal. | ||
|
||
### `Parser` Class | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A UML class diagram would be helpful here to show the associations used for each command being called here. |
||
The `Parser` class handles all input and executes the corresponding actions based on the user input. | ||
It consists of methods that will execute most commands that is crucial to the functionality of our program. | ||
|
||
`Parser` depends on other classes for the respective inputs and outputs.`Duke` calls the `Parser` class in order for the | ||
necessary commands to be executed. However, not all functionality is stored here. Rather, `Parser` acts like an interface | ||
that handles all the logic required to pass in the correct information into the different classes to execute. | ||
|
||
The `Parser` class | ||
- Contains the logic to check user commands and break the input into the necessary contents for other classes to use | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps, documentations like this can be followed for the other classes too? |
||
|
||
### `Expense` Class | ||
The `Expense` class deals with most functionalities related to adding an expense inside a trip. The sequence diagram below shows how an expense is initialised. | ||
![](../Resources/Expense%20Sequence%20Diagram.jpeg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unable to view sequence diagram. Perhaps you could recheck the directory/link? |
||
|
||
When `Parser` calls the `executeExpense` method, it creates an expense object, and also calls the `promptDate` method to set that expense object’s date. `promptDate` calls `isDateValid` to validate user input. | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to add some in this part? |
||
## Product scope | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding hyperlinks to subtopics would be a great idea! (like content pointers used in UG)