Skip to content
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

[CS2113-T14-4] DietaryBook #42

Open
wants to merge 587 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
587 commits
Select commit Hold shift + click to select a range
a13a658
Update ExitCommand.java
tikimonarch Oct 28, 2020
44da506
Merge pull request #104 from tikimonarch/MainBranch
HengFuYuen Oct 29, 2020
60fc25c
Add case where gender is male
HengFuYuen Oct 29, 2020
942beec
Merge pull request #105 from HengFuYuen/IncludeMale
HengFuYuen Oct 29, 2020
e563a49
Bug Fixes
tikimonarch Oct 29, 2020
7348828
Merge pull request #106 from tikimonarch/MainBranch
HengFuYuen Oct 29, 2020
917c550
Update help command message
HengFuYuen Oct 29, 2020
9cd464d
Merge pull request #107 from HengFuYuen/Ui-EditDatabase
HengFuYuen Oct 29, 2020
b7ba81b
add addFoodAtDateTime
0xEljh Oct 29, 2020
3ccd03e
Merge pull request #108 from AY2021S1-CS2113-T14-4/clean-up-branch
tikimonarch Oct 29, 2020
5c97f79
Put Examples of Usage for adding controling food items into the User …
snowbanana12345 Oct 29, 2020
6fea1da
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp
snowbanana12345 Oct 29, 2020
0e12c98
Add examples of usage to UserGuide section
snowbanana12345 Oct 29, 2020
cd4ea6d
minor fixes
snowbanana12345 Oct 29, 2020
920359e
Merge pull request #109 from snowbanana12345/Zhong-Ming-UserGuide-Branch
tikimonarch Oct 29, 2020
ae409f5
Update UserGuide.md
tikimonarch Oct 29, 2020
9b0e2fa
Merge branch 'master' into MainBranch
tikimonarch Oct 29, 2020
88b3a5a
Merge pull request #110 from tikimonarch/MainBranch
HengFuYuen Oct 29, 2020
4e99bb8
Add command with date time
tikimonarch Oct 29, 2020
1ebb527
Merge pull request #111 from tikimonarch/MainBranch
HengFuYuen Oct 29, 2020
8c2a702
Future date exception
tikimonarch Oct 29, 2020
15f3458
Update _config.yml
HengFuYuen Oct 29, 2020
9d358bd
Merge pull request #112 from tikimonarch/MainBranch
HengFuYuen Oct 29, 2020
48c9fd4
Fix major formatting issues
HengFuYuen Oct 29, 2020
d8d5210
Merge pull request #113 from HengFuYuen/UpdateGuide
HengFuYuen Oct 29, 2020
a66165b
Fix formatting
HengFuYuen Oct 29, 2020
d291a52
Merge pull request #114 from HengFuYuen/Guide
HengFuYuen Oct 29, 2020
6d4887b
Update UserGuide.md
tikimonarch Oct 30, 2020
e4da4f8
Merge pull request #115 from tikimonarch/MainBranch
HengFuYuen Oct 30, 2020
840662b
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp
Oct 31, 2020
acd0a80
Added a CalculatorData class to take in a FoodList and return informa…
Oct 31, 2020
6e1ceaa
added update method in Calculator class.
Oct 31, 2020
f549137
added the setCalculator method
Oct 31, 2020
65019bc
Added the initialization of data.
Oct 31, 2020
6fe80a6
add dated string representation
0xEljh Nov 2, 2020
25673fd
FoodListTest improvements
0xEljh Nov 2, 2020
66c5791
Remove unused imports
0xEljh Nov 2, 2020
7234e20
Rename ActivityLevel to FitnessLevel
HengFuYuen Nov 4, 2020
17274eb
Add logging for Person class
HengFuYuen Nov 4, 2020
e6c036d
edit data base
snowbanana12345 Nov 4, 2020
60728b8
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp …
snowbanana12345 Nov 4, 2020
0ad3d53
update data base
snowbanana12345 Nov 4, 2020
ccb2a92
rename architecture to design
snowbanana12345 Nov 4, 2020
dc7ebe4
change activity level to fitness level in person class
snowbanana12345 Nov 4, 2020
c59c1a8
Merge pull request #164 from HengFuYuen/PersonAndFitness
HengFuYuen Nov 4, 2020
c8483a4
Merge branch 'master' into clean-up-branch
HengFuYuen Nov 4, 2020
2c118e1
Merge pull request #163 from AY2021S1-CS2113-T14-4/clean-up-branch
HengFuYuen Nov 4, 2020
dffa920
Exceptions
tikimonarch Nov 4, 2020
afbbf0c
Bug fixes
tikimonarch Nov 4, 2020
37462a0
Add fixed
tikimonarch Nov 4, 2020
32f8183
Refactor Ui and add logging
HengFuYuen Nov 4, 2020
d6b7f35
Change global variable to local
HengFuYuen Nov 4, 2020
62dce5a
Add new line at the end of the file
HengFuYuen Nov 4, 2020
42b5919
Update JavaDoc comments
HengFuYuen Nov 4, 2020
8724ea3
Update I/O testing
HengFuYuen Nov 4, 2020
1cdce4e
Update InputChecker.java
tikimonarch Nov 4, 2020
f1d1c38
Improved exception catching
tikimonarch Nov 4, 2020
743ecb0
Improved option detection
tikimonarch Nov 4, 2020
53afb25
Updated error message
tikimonarch Nov 5, 2020
745ddfc
Merge pull request #169 from HengFuYuen/PersonLogging
HengFuYuen Nov 5, 2020
c983477
Improved command exception
tikimonarch Nov 5, 2020
061c9cd
Fixed End Time
tikimonarch Nov 5, 2020
a45623c
Merge pull request #166 from tikimonarch/MainBranch
tikimonarch Nov 5, 2020
15f18ab
Update README.md
HengFuYuen Nov 6, 2020
b28ede1
Delete DukeTest.java
HengFuYuen Nov 6, 2020
c1753f0
Update JavaDoc comments
HengFuYuen Nov 6, 2020
6c08533
Add MainLogger.java
HengFuYuen Nov 6, 2020
7bfcd39
Add logging for Ui.java
HengFuYuen Nov 6, 2020
2dec832
Add logging for UiHelper.java
HengFuYuen Nov 6, 2020
01af9a0
Use MainLogger for UiInput.java
HengFuYuen Nov 6, 2020
cc7390f
Add logging for UiMessage.java
HengFuYuen Nov 6, 2020
09de15b
Make UiOutput package private
HengFuYuen Nov 6, 2020
db46957
Make method package private
HengFuYuen Nov 6, 2020
1c08701
Update JUnit tests for UiHelper
HengFuYuen Nov 6, 2020
465946d
Add JUnit tests for UiInput
HengFuYuen Nov 6, 2020
4ae9b84
Merge branch 'master' into UiChanges
HengFuYuen Nov 6, 2020
7378bca
Merge pull request #170 from HengFuYuen/UiChanges
HengFuYuen Nov 6, 2020
f70f054
Use MainLogger for logging
HengFuYuen Nov 6, 2020
36aafbd
add resource to test folder
snowbanana12345 Nov 7, 2020
3787888
fix check style
snowbanana12345 Nov 7, 2020
a7e73e4
Add attribution
HengFuYuen Nov 7, 2020
6b90cfd
Add assertions for MainLogger
HengFuYuen Nov 7, 2020
ac38fd8
Add JavaDoc comments for MainLogger
HengFuYuen Nov 7, 2020
6fc3120
Update AboutUs.md
HengFuYuen Nov 7, 2020
ab173f6
Add PPP
HengFuYuen Nov 7, 2020
5b1e1a8
Update introduction
HengFuYuen Nov 7, 2020
2b16f06
Update quick start
HengFuYuen Nov 7, 2020
7a46f6c
Add notes and warnings to features section
HengFuYuen Nov 7, 2020
0bf41b7
Update name command feature
HengFuYuen Nov 7, 2020
66cee4c
Update name command feature
HengFuYuen Nov 7, 2020
49c8a11
Update info command feature
HengFuYuen Nov 7, 2020
f7d1d12
Update editinfo command feature
HengFuYuen Nov 7, 2020
a508052
Update minor formatting issues
HengFuYuen Nov 7, 2020
2863695
Update command summary
HengFuYuen Nov 7, 2020
faba5e1
Update image
HengFuYuen Nov 7, 2020
43dee1c
Update code quality
HengFuYuen Nov 7, 2020
9902676
Changed get... methods in CalculatorData class to getPortioned... met…
Nov 7, 2020
221662a
implement and test search food by index function in data base
snowbanana12345 Nov 7, 2020
f2cc9e0
Exception Bug Fixes
tikimonarch Nov 7, 2020
30b2195
passed check style
snowbanana12345 Nov 7, 2020
03e0bee
fix check style
snowbanana12345 Nov 7, 2020
a3aa572
no message
snowbanana12345 Nov 7, 2020
3084624
fix test check style
snowbanana12345 Nov 7, 2020
e787bb9
Merge branch 'master' into MainBranch
tikimonarch Nov 7, 2020
b34cf34
Merge pull request #179 from tikimonarch/MainBranch
tikimonarch Nov 7, 2020
0d362e4
Change preposition
HengFuYuen Nov 7, 2020
73c080b
start implementing FoodPortionDateSaveLoadManager
snowbanana12345 Nov 7, 2020
94958ed
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp …
snowbanana12345 Nov 7, 2020
2b1d4f5
Update grammar and divider length
HengFuYuen Nov 7, 2020
d3279c8
Merge branch 'master' into branch-3-changes
yuqiaoluolong Nov 7, 2020
539b522
Merge pull request #162 from yuqiaoluolong/branch-3-changes
yuqiaoluolong Nov 7, 2020
b46c5a7
Changed the the ActivityLevel to FitnessLevel
Nov 7, 2020
2d7028f
Changed the input attributes in the calculate... methods in Calculate…
Nov 7, 2020
18e72cf
Change help command output
HengFuYuen Nov 7, 2020
159dfbb
Merge branch 'master' into UiUpdates
HengFuYuen Nov 7, 2020
dd5eba7
Merge pull request #180 from yuqiaoluolong/branch-4-changes
HengFuYuen Nov 7, 2020
54cbe20
Merge branch 'master' into UiUpdates
HengFuYuen Nov 7, 2020
022b7d4
Update I/O testing
HengFuYuen Nov 7, 2020
3e0700d
add support for missing food details
0xEljh Nov 7, 2020
58d9636
move StringFormatter to utils package
0xEljh Nov 7, 2020
8e626aa
relax FoodListTest
0xEljh Nov 7, 2020
edc6f03
Remove unused dependencies
0xEljh Nov 7, 2020
a698e60
Update notes and warnings under Feature section
HengFuYuen Nov 7, 2020
b2a21e8
Elaborate on valid inputs for user name
HengFuYuen Nov 7, 2020
95c6471
Combine notes and warning section
HengFuYuen Nov 7, 2020
3dd4740
Merge pull request #173 from HengFuYuen/UpdatePersonLogging
HengFuYuen Nov 8, 2020
ff288ae
Merge branch 'master' into AboutUs-PPP
HengFuYuen Nov 8, 2020
ee8d466
implement 2nd layer of setters and getters
snowbanana12345 Nov 8, 2020
bb91199
add basic functionality test for FoodPortionSaveLoadManager
snowbanana12345 Nov 8, 2020
9fcdda3
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp …
snowbanana12345 Nov 8, 2020
5376ca3
implement and test save loading food list
snowbanana12345 Nov 8, 2020
dd44a64
pass check style
snowbanana12345 Nov 8, 2020
9485a2c
copy resources over to test
snowbanana12345 Nov 8, 2020
43ec8ce
Update help command output
HengFuYuen Nov 8, 2020
a3f9992
Improved date time check
tikimonarch Nov 8, 2020
e831f8f
Merge branch 'master' into MainBranch
tikimonarch Nov 8, 2020
49529b5
Bug fixes for garbage input
tikimonarch Nov 8, 2020
0dd2a80
Merge pull request #185 from snowbanana12345/Zhong-ming-Branch-DataBase
snowbanana12345 Nov 8, 2020
30ca0ff
Merge pull request #171 from HengFuYuen/README
HengFuYuen Nov 8, 2020
c472680
Merge pull request #178 from HengFuYuen/UpdateUserGuide
HengFuYuen Nov 8, 2020
33c335f
Fix icon
HengFuYuen Nov 8, 2020
518101e
Improve formatting
HengFuYuen Nov 8, 2020
be5ae29
Multi forward slash detection
tikimonarch Nov 8, 2020
9a91757
Added the minimum and maximum caps for recommended calorie intake.
Nov 8, 2020
e579218
Merge pull request #190 from HengFuYuen/UserGuideUpdate
HengFuYuen Nov 8, 2020
9ce73db
Merge pull request #188 from HengFuYuen/UpdateReadMe
HengFuYuen Nov 8, 2020
5f27da9
add sort
0xEljh Nov 8, 2020
b73c61e
Merge pull request #183 from AY2021S1-CS2113-T14-4/FoodList-Optional-…
0xEljh Nov 8, 2020
3fa460e
Created a testing method corresponding to the added caps.
Nov 8, 2020
e89793f
refactored the calculateRecommendation to improve the code quality.
Nov 8, 2020
4421ccd
Merge pull request #192 from AY2021S1-CS2113-T14-4/FoodList-Optional-…
HengFuYuen Nov 8, 2020
3792450
Changed the weight used in calculateRecommendation method from origin…
Nov 8, 2020
a71c91f
change the activity stuff to fitness...
Nov 8, 2020
a77bcdd
activity to fitness
Nov 8, 2020
9d2c93c
Changed some numbers accordingly.
Nov 8, 2020
c3f99b3
Merge pull request #191 from yuqiaoluolong/branch-5-cap
yuqiaoluolong Nov 8, 2020
b6d8e95
Update the Ui component description
HengFuYuen Nov 8, 2020
d47e868
Update Ui component diagram
HengFuYuen Nov 8, 2020
f021e0d
Merge branch 'master' into DeveloperGuide
HengFuYuen Nov 8, 2020
be3b213
Update enter user information feature description
HengFuYuen Nov 8, 2020
da8afaf
Merge branch 'master' into MainBranch
tikimonarch Nov 8, 2020
2af801f
Update enter user information feature diagrams
HengFuYuen Nov 8, 2020
b74db1a
Update user stories related to Person class
HengFuYuen Nov 8, 2020
27fbc63
Update non-functional requirements
HengFuYuen Nov 8, 2020
251c0de
Update glossary
HengFuYuen Nov 8, 2020
9375397
Update target user profile and value preposition
HengFuYuen Nov 8, 2020
a0d6cc4
Update feature description
HengFuYuen Nov 8, 2020
9305e77
Update edit user info feature
HengFuYuen Nov 8, 2020
001a2e9
update DevGuide with Model
0xEljh Nov 8, 2020
ee18b71
Rename files to remove spacing
HengFuYuen Nov 8, 2020
f64c7b9
Update edit user information feature
HengFuYuen Nov 9, 2020
f5431a5
Update view user information feature
HengFuYuen Nov 9, 2020
cfe39f2
Update instructions for manual testing
HengFuYuen Nov 9, 2020
3a0d247
Update _config.yml
HengFuYuen Nov 9, 2020
29d1cd3
Update HelpCommand display for user guide
HengFuYuen Nov 9, 2020
06dd83d
Merge pull request #194 from HengFuYuen/DeveloperGuide
HengFuYuen Nov 9, 2020
3c4fa91
Merge branch 'master' into AboutUs-PPP
HengFuYuen Nov 9, 2020
374ac75
Fix code snippet formatting with image
HengFuYuen Nov 9, 2020
6f21a7c
Improve code quality
HengFuYuen Nov 9, 2020
ef7592e
Data adding
tikimonarch Nov 9, 2020
a3bc36f
Merge branch 'master' into MainBranch
tikimonarch Nov 9, 2020
7bcc22f
Refactored Calculate command
tikimonarch Nov 9, 2020
9670687
Update multiplicities in the diagram
HengFuYuen Nov 9, 2020
0eac807
Add hengfuyuen.md
HengFuYuen Nov 9, 2020
cb3c081
Merge pull request #176 from HengFuYuen/AboutUs-PPP
HengFuYuen Nov 9, 2020
0ba2ab7
Merge branch 'master' into UiUpdates
HengFuYuen Nov 9, 2020
6f01334
Some changes about the calculator parts in UG.
Nov 9, 2020
563c8fd
Update AboutUs.md
HengFuYuen Nov 9, 2020
7e2b8f4
Merge pull request #198 from HengFuYuen/AboutUs
HengFuYuen Nov 9, 2020
7a4b10f
data base adding fixed
tikimonarch Nov 9, 2020
f89e787
changed the format about us back.
Nov 9, 2020
e746402
Merge branch 'master' into Zhong-ming-saveload-branch
snowbanana12345 Nov 9, 2020
5c97c67
Merge pull request #184 from snowbanana12345/Zhong-ming-saveload-branch
snowbanana12345 Nov 9, 2020
6e43da8
Merge pull request #197 from yuqiaoluolong/branch-6-UG
HengFuYuen Nov 9, 2020
11db296
Update PRs
HengFuYuen Nov 9, 2020
15ca4ff
add details to model section
0xEljh Nov 9, 2020
f89ac48
Fix formatting errors
HengFuYuen Nov 9, 2020
98e216e
Merge branch 'master' into PPPAndUG
HengFuYuen Nov 9, 2020
76e1093
Update PPP
HengFuYuen Nov 9, 2020
7685f86
Merge branch 'master' into UiUpdates
HengFuYuen Nov 9, 2020
c0fde24
Remove TOC
HengFuYuen Nov 9, 2020
3ab6d20
Merge branch 'master' into MainBranch
tikimonarch Nov 9, 2020
06e5885
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp …
snowbanana12345 Nov 9, 2020
46758f0
update dev guide documentation.
snowbanana12345 Nov 9, 2020
7bfeaf1
add missing fields feature to implementation
0xEljh Nov 9, 2020
2522dc3
create dev guide section on database
snowbanana12345 Nov 9, 2020
d607ea6
added person info in AboutUs
Nov 9, 2020
f7b5cdf
Merge pull request #200 from yuqiaoluolong/branch-7-AboutUs
HengFuYuen Nov 9, 2020
02bb8c3
Merge pull request #199 from HengFuYuen/PPPAndUG
HengFuYuen Nov 9, 2020
101613f
data base uml diaghrams
snowbanana12345 Nov 9, 2020
b635f43
data base segment done
snowbanana12345 Nov 9, 2020
90a8064
Implemented Save/Load
tikimonarch Nov 9, 2020
68a0a0b
Merge branch 'master' into MainBranch
tikimonarch Nov 9, 2020
0114ac8
start writing PPP
snowbanana12345 Nov 9, 2020
0f9940e
update PPP
snowbanana12345 Nov 9, 2020
1c37651
Merge pull request #201 from snowbanana12345/Zhong-Ming-UserGuide-Branch
snowbanana12345 Nov 9, 2020
539361a
Condense the calculator part in UG
Nov 9, 2020
85d1b4c
update PPP
snowbanana12345 Nov 9, 2020
9da3a15
add uml sequence diagrams on OptionalFood feature
0xEljh Nov 9, 2020
b46523c
Merge pull request #186 from tikimonarch/MainBranch
tikimonarch Nov 9, 2020
de7035a
Merge pull request #203 from snowbanana12345/Zhong-Ming-UserGuide-Branch
snowbanana12345 Nov 9, 2020
0faea49
Fix bugs
HengFuYuen Nov 9, 2020
bdf9f08
Merge branch 'master' into UiUpdates
HengFuYuen Nov 9, 2020
329892e
recalculation
Nov 9, 2020
0082df4
Merge pull request #202 from yuqiaoluolong/branch-8-condense_UG
yuqiaoluolong Nov 9, 2020
55569d1
PPP
Nov 9, 2020
4c19930
add links to source files
0xEljh Nov 9, 2020
88b43b4
Merge branch 'master' into docs
0xEljh Nov 9, 2020
70a2822
update data base section of user guide
snowbanana12345 Nov 9, 2020
61ba0d6
update user guide FAQ section on folder
snowbanana12345 Nov 9, 2020
fec1427
Merge pull request #206 from yuqiaoluolong/branch-9-PPP
yuqiaoluolong Nov 9, 2020
edb667a
Merge pull request #207 from snowbanana12345/Zhong-Ming-UserGuide-Branch
snowbanana12345 Nov 9, 2020
17c777a
some edits on ppp
Nov 9, 2020
54a25b6
Remove unused methods
HengFuYuen Nov 9, 2020
2680efb
Merge pull request #181 from HengFuYuen/UiUpdates
HengFuYuen Nov 9, 2020
579c29a
Merge pull request #204 from AY2021S1-CS2113-T14-4/docs
0xEljh Nov 9, 2020
d3d6e1c
Merge pull request #205 from HengFuYuen/PPP
HengFuYuen Nov 9, 2020
9a44221
some edits on UG about recalculation
Nov 9, 2020
236a502
Merge pull request #208 from yuqiaoluolong/master
yuqiaoluolong Nov 9, 2020
4813353
create elijahng project portfolio
0xEljh Nov 9, 2020
6920dd9
fix markdown comments
0xEljh Nov 9, 2020
94229ce
Revert "fix markdown comments"
0xEljh Nov 9, 2020
be6b257
fix markdown comments
0xEljh Nov 9, 2020
54eab90
Merge pull request #210 from AY2021S1-CS2113-T14-4/docs
HengFuYuen Nov 9, 2020
db3523d
PPP + userguide update
tikimonarch Nov 9, 2020
7a8dcd3
update PPP
0xEljh Nov 9, 2020
538ddb3
Merge pull request #209 from AY2021S1-CS2113-T14-4/Elijah-PPP
0xEljh Nov 9, 2020
15483f1
Merge pull request #211 from tikimonarch/MainBranch
HengFuYuen Nov 9, 2020
d9ef411
Update AboutUs.md
0xEljh Nov 9, 2020
747d19b
Update AboutUs.md
tikimonarch Nov 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/out/
/*.iml

# VSCode files
/.vscode/

# Gradle build files
/.gradle/
/build/
Expand All @@ -15,3 +18,8 @@ bin/

/text-ui-test/ACTUAL.txt
text-ui-test/EXPECTED-UNIX.TXT

# IDE specific files
.project
/.settings/

3 changes: 3 additions & 0 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: seedu.duke.DietBook

19 changes: 19 additions & 0 deletions UML_diaghrams/save_load_feature/Architecture.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@startuml
object Saver
object Loader
object FoodSaveLoadManager
object PersonSaveLoadManager
object Command
object File

File <-up-> Saver
File <-up-> Loader

Saver <-up-> FoodSaveLoadManager
Saver <-up-> PersonSaveLoadManager
Loader <-up-> FoodSaveLoadManager
Loader <-up-> PersonSaveLoadManager

FoodSaveLoadManager <-up-> Command
PersonSaveLoadManager <-up-> Command
@enduml
24 changes: 24 additions & 0 deletions UML_diaghrams/save_load_feature/FoodSaveLoadManager_load.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml

-> FoodSaveLoadManager : load()
activate FoodSaveLoadManager

FoodSaveLoadManager -> Loader : static load()

activate Loader
Loader -> FileLoader : load()

activate FileLoader
loop all lines
activate Scanner
FileLoader -> Scanner : readline()
Scanner --> FileLoader : line data
destroy Scanner
end
FileLoader --> Loader : FileLoader
deactivate FileLoader

Loader --> FoodSaveLoadManager : FileLoader
deactivate Loader
deactivate FoodSaveLoadManager
@enduml
24 changes: 24 additions & 0 deletions UML_diaghrams/save_load_feature/FoodSaveLoadManager_save.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml
-> FoodSaveLoadManager : save
activate FoodSaveLoadManager


loop all food items
loop every entry in a food object
activate Saver
FoodSaveLoadManager -> Saver : add()
end
end

FoodSaveLoadManager -> Saver : save()
deactivate Saver

activate FileWriter
loop all entries in Saver table
Saver -> FileWriter : write()
end
destroy FileWriter

deactivate FoodSaveLoadManager

@enduml
15 changes: 15 additions & 0 deletions UML_diaghrams/save_load_feature/UML diagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

@startuml
-> FoodSaveLoadManager : save

loop all food items
loop every entry in a food object
FoodSaveLoadManager -> Saver : add()
end
end

FoodSaveLoadManager -> Saver : save()
loop all entries in Saver table
Saver -> FileWriter : write()
end
@enduml
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ repositories {
}

dependencies {
implementation 'org.junit.jupiter:junit-jupiter:5.4.2'
implementation 'org.junit.jupiter:junit-jupiter:5.4.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'
}
Expand All @@ -29,11 +31,11 @@ test {
}

application {
mainClassName = "seedu.duke.Duke"
mainClassName = "seedu.dietbook.DietBook"
}

shadowJar {
archiveBaseName = "duke"
archiveBaseName = "dietbook"
archiveClassifier = null
}

Expand All @@ -43,4 +45,5 @@ checkstyle {

run{
standardInput = System.in
enableAssertions = true
}
6 changes: 5 additions & 1 deletion docs/AboutUs.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# About us
we are an idiosyncratic and narcissistic batch of self-righteous
elitist who defends presumably morally questionable positions.
Also we are cheap!


Display | Name | Github Profile | Portfolio
--------|:----:|:--------------:|:---------:
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Heng Fu Yuen | [Github](https://github.com/HengFuYuen) | [Portfolio](docs/team/johndoe.md)
152 changes: 146 additions & 6 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,155 @@
# Developer Guide

## Design & implementation
* Table of Contents
{:toc}

## Design

### UI component
![Ui component](diagrams/Ui component.png)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the arrow pointing to enumeration be dotted?

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing! Yes, Ui has dependencies and not associations with the enum classes which is why I used the dashed lines. Perhaps my following explanations were not clear enough. Thanks for the feedback!

**API**: [`Ui.java`](https://github.com/AY2021S1-CS2113-T14-4/tp/blob/master/src/main/java/seedu/dietbook/Ui.java)

The `UI` component,
* Takes in user command and passes to the `Logic` components for command execution.
* Updates the user about any changes in the data after executing the command or errors encountered when executing the commands.

The UI has a dependency with two enumeration class, [`ActivityLevel`](https://github.com/AY2021S1-CS2113-T14-4/tp/blob/master/src/main/java/seedu/dietbook/person/ActivityLevel.java) and [`Gender`](https://github.com/AY2021S1-CS2113-T14-4/tp/blob/master/src/main/java/seedu/dietbook/person/Gender.java) as descriptions of each [`ActivityLevel`](https://github.com/AY2021S1-CS2113-T14-4/tp/blob/master/src/main/java/seedu/dietbook/person/ActivityLevel.java) and [`Gender`](https://github.com/AY2021S1-CS2113-T14-4/tp/blob/master/src/main/java/seedu/dietbook/person/Gender.java) is required. Increased coupling was sacrificed to reduce code duplicates and increase ease of code extension/editing.

## Implementation
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you should delete this line for the final version?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted! Thank you!


### [Proposed] Enter user information feature

#### Proposed Implementation
The proposed feature utilised two commands words [`name`](UserGuide.md/####Entering username: `name`) and [`info`](UserGuide.md/####Entering user information: `info`) that allows users to enter their name using the [`name`](UserGuide.md/####Entering username: `name`) command and [`info`](UserGuide.md/####Entering user information: `info`) to enter other information, such as age, gender, height, activity level, original, current and target weight, separately.

The proposed feature to enter user information is facilitated by `Manager` which stores a [`Person`](https://github.com/AY2021S1-CS2113-T14-4/tp/blob/master/src/main/java/seedu/dietbook/person/Person.java) which
stores all user information provided. It implements the following operation:

* Manager#setPerson(String newName, Gender newGender, int newAge, int newHeight, int newOriginalWeight, int newCurrentWeight, int newTargetWeight, ActivityLevel newActivityLevel) - Calls the method below to set the attribute values of the `Person` object.
* Person#setAll(String newName, Gender newGender, int newAge, int newHeight, int newOriginalWeight, int newCurrentWeight, int newTargetWeight, ActivityLevel newActivityLevel) - Updates the attribute values of the `Person` object.

Both operation are only executed by the `Manager` class of the `Logic` component. Only one instance of `Person` is ever instantiated. A default person is instantiated at the start with default attribute values and when the user enters their information for the first time during the set up, all the default values would be updated to the inputted values. Therefore, the command to enter the user information will result in a change in the attribute values and not the creation of a new `Person` object.

Given below is the example usage scenario and how the feature works.

Step 1. When the user launches the application for the first time. A default `Person` object will be initialised by `Manager` and the user will be prompted to enter their name.

![Enter Info Step1](diagrams/Enter Info Step1.png)

Step 2. The user executes `name Jack` command to enter their name into DietBook. The `name` command calls `Manager#setName(Jack)`, to store the name in `Manager` first. After which, user will be prompted to enter all other details.

![Enter Info Step2](diagrams/Enter Info Step2.png)

Step 3. The user executes a command like the following `info g/M a/21 h/175 o/85 c/85 t/75 l/2` to enter all other personal information including age, gender, height, activity level, original, current and target weight. The `info` command then calls `Parse#executeProcessedInfo(info g/M a/21 h/175 o/85 c/85 t/75 l/2, manager)` which would parse the user command, check input validity by using methods in `InputChecker` and calls `Manager#setPerson(Jack, Gender.MALE, 21, 175, 85, 85, 75, ActivityLevel.LOW)` which proceeds to call `Person#setAll(Jack, Gender.MALE, 21, 175, 85, 85, 75, ActivityLevel.LOW)`.

![Enter Info Step3](diagrams/Enter Info Step3.png)

The following sequence diagrams shows how the feature works.

`name` command

![Name sequence diagram](diagrams/Name sequence diagram.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the constructor block is wrong.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted! Thanks for spotting the error!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you should align the dotted line to the middle of the execute() block.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted! Thanks for spotting the error!


`info` command

![Info sequence diagram](diagrams/Info sequence diagram.png)

#### Design considerations:

Aspect: Whether to enter name and other information separately or together

* **Alternative 1 (current choice)**: Enter name and other information separately
* Pros: Increase user interaction and engagement.
* Cons: Enter information using two commands.

* **Alternative 2**: Enter name and other information together
* Pros: Enter all information at once.
* Cons: Increase user interaction and engagement.

Aspect: Whether to use singleton pattern for Person class

* **Alternative 1 (current choice)**: Did not use singleton pattern for `Person`
* Pros: Reduce coupling and increase testability.
* Cons: Risk of creating multiple `Person` object by mistake and there might be negative consequence in creating multiple objects.

However, there is minimal risk of creating multiple `Person` object by mistake and minimal negative consequence in creating multiple objects as long as the `Manager` refers the correct instance of `Person`.

* **Alternative 2**: Use singleton pattern for `Person`
* Pros: Easy to implement, prevent the instantiation of more than one `Person` object.
* Cons: Increase coupling and reduce testability

Aspect: Changing attribute values in `Person` object or creating new `Person` object

* **Alternative 1 (current choice)**: Changing attribute values in `Person` object
* Pros: Reduce the number of objects being created to reduce memory usage and reduce the risk of creating multiple objects which can potentially lead to negative consequences and bugs.
* Cons: Unable to write tests as method chains.

* **Alternative 2**: Creating new `Person` object
* Pros: Ability to write tests as method chains.
* Cons: Creation of many objects, which take up memory spaces and ensure that only the correct `Person` instance is kept and referred to.

## Save/Load Feature

The Save/Load feature is implemented by the saveload package.
At the base of the package, there is the <mark> Saver </mark>
and <mark> Loader </mark> class.

### Architecture
![Alt text](save_load_feature/Architecture.png)
Note only the Saver and Loader class is flexible. They can be adapted to new situations without modifying
the code. The FoodSaveLoadManager and PersonSaveLoadManager are written specifically for this version. They
will have to be modified/replaced for future versions.

#### Saver class

Stores data in a internal table with length and height specified.
Handles the storage of its data by writing to a text file.

##### Constructor
Specifies the length and height of the internal Saver table
##### Main Methods
* Saver#save() saves the current data to the file in the folder with the given file name
* Saver#add() Store String data in the x,y position in the table

#### Loader class
Loads data from a text file and stores it in a internal table just like the saver
##### Constructor
static method Loader.load(folder name , file name) : creates a Loader object with
a table storing the data found in the text file
##### Main Methods
* Loader#get() retrives the data stored in the loader

#### FoodSaveLoadManager class
Built on top of Saver and Loader class to implement save/load functionality
for list of food items the user has input into the dietbook. Contains a instance
of both <mark> Saver </mark> and <mark> Loader </mark>. It has its own folder to work with,
the user only has to specify the file name.
##### Main Methods
* FoodSaveLoadManager#save() saves the list of food objects to the specified file name
* FoodSaveLoadManager#load() loads the file and returns the list of food objects stored inside it

#### PersonSaveLoadManager class
Built on top of Saver and Loader class to implement save/load functionality for user information
Same as FoodSaveLoadManager, it has its own folder to work with, the user only has to specify the file name
Unlike the FoodSaveLoadManager, it stores the data inside itself and can be updated.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps a class and sequence diagram would help convey the idea better idea.

##### Main Methods
* PersonSaveLoadManager#save() save the current state into the file
* PersonSaveLoadManager#load() loads the file
* Setters and Getters for all the personal data in this current version

#### UML diaghram
##### FoodSaveLoadManager#save()
![Alt text](save_load_feature/FoodSaveLoadManager_save.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you should end the dotted line at the cross

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are classes supposed to be below activation bars? It may be non-standard
image

##### FoodSaveLoadManager#load()
![Alt text](save_load_feature/FoodSaveLoadManager_load.png)
similiar diaghrams for PersonSaveLoadManager
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, should classes be placed under the activation bar? It may not be non-standard.
image


## Product scope
### Target user profile

{Describe the target user profile}
NUS students living on campus who would like to track their daily food and nutritional intake.

### Value proposition

Expand All @@ -23,12 +164,11 @@

## Non-Functional Requirements

{Give non-functional requirements}
1. Should work on any mainstream OS as long as `Java 11` is installed in the system.

## Glossary

* *glossary item* - Definition
* *Mainstream OD* - Windows, Linux, Unix, OS-X
* *Food items* - Includes both food and drinks

## Instructions for manual testing

{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing}
20 changes: 14 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Duke
# DietBook

{Give product intro here}
[![CI status](https://github.com/AY2021S1-CS2113-T14-4/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2021S1-CS2113-T14-4/tp/actions)

DietBook is a Command Line Interface (CLI) desktop application designed to **track your food and nutritional intake** as well as provide you with your **daily calorie recommendation**. As the application mainly targets _NUS students staying on campus_, it has a **database prepopulated with food items commonly found around NUS**. This allows for such food items to be easily added to the list of food items consumed for tracking.

**Useful links:**

* If you would like to use DietBook, head over to [User Guide](UserGuide.md) to get started.
* If you would like to know more about developing DietBook, head over to [Developer Guide](DeveloperGuide.md).
* If you would like to know more about the developers, head over to [About Us](AboutUs.md).

**Acknowledgements:**

* Libraries used: [JUnit5](https://github.com/junit-team/junit5)

Useful links:
* [User Guide](UserGuide.md)
* [Developer Guide](DeveloperGuide.md)
* [About Us](AboutUs.md)
Loading