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

Zhong ming branch data base #138

Open
wants to merge 374 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
374 commits
Select commit Hold shift + click to select a range
a169dd4
add DatedFoodEntry
0xEljh Oct 21, 2020
4f1855d
implement saver
snowbanana12345 Oct 21, 2020
3dc0ac3
add test for saver class
snowbanana12345 Oct 21, 2020
62c030a
implement loader
snowbanana12345 Oct 21, 2020
b43add7
test loader class
snowbanana12345 Oct 21, 2020
fd5ad65
add documentation
snowbanana12345 Oct 21, 2020
30de965
fix check style tests
snowbanana12345 Oct 21, 2020
4bb71e4
Shorten output divider
HengFuYuen Oct 21, 2020
51e3ecc
Change printDatabase method input paramater
HengFuYuen Oct 21, 2020
838f46a
Remove unused import
HengFuYuen Oct 21, 2020
398ceb0
Get gender description from Gender object
HengFuYuen Oct 21, 2020
50bd94d
Add method to convert LocalDateTime to String
HengFuYuen Oct 21, 2020
6d5a8f0
Add Junit tests for stringDateTime method in Ui
HengFuYuen Oct 21, 2020
50f4f3e
Add printFoodListGivenTimePeriod method
HengFuYuen Oct 21, 2020
c471d25
Major Issue Fixes
tikimonarch Oct 21, 2020
06496c6
Merge branch 'master' into MainBranch
tikimonarch Oct 21, 2020
4834663
Merge pull request #55 from HengFuYuen/Admin
HengFuYuen Oct 22, 2020
38d89d0
Merge branch 'master' into MoreUi
HengFuYuen Oct 22, 2020
58e4d16
Merge branch 'master' into MorePerson
HengFuYuen Oct 22, 2020
6d09878
Update package and remove wilcard import
HengFuYuen Oct 22, 2020
4174aec
Remove unused import in JUnit test
HengFuYuen Oct 22, 2020
7a00868
Merge pull request #8 from AY2021S1-CS2113-T14-4/master
snowbanana12345 Oct 22, 2020
9720f77
Add methods to trim Strings and get length
HengFuYuen Oct 22, 2020
23c9a75
Add JUnit tests for two Ui methods
HengFuYuen Oct 22, 2020
79bd2b9
Improved input parser
tikimonarch Oct 23, 2020
b6b556a
Implement FoodSaveLoadManager
snowbanana12345 Oct 23, 2020
a1da7e0
debug FoodSaveLoadManager
snowbanana12345 Oct 23, 2020
4ba066e
clear check style tests
snowbanana12345 Oct 23, 2020
7d084bb
copy food over to test
snowbanana12345 Oct 23, 2020
6d22bf1
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp
Oct 23, 2020
6002a6d
refactor location
Oct 23, 2020
4c13ef9
Merge branch 'master' into MainBranch
tikimonarch Oct 23, 2020
d93f653
Major OOP Update
tikimonarch Oct 23, 2020
8eb6d3b
Input Checker
tikimonarch Oct 24, 2020
ad72b4d
New check, bug fixes
tikimonarch Oct 24, 2020
609f8ea
Spacings
tikimonarch Oct 24, 2020
b7ea898
Merge pull request #61 from tikimonarch/MainBranch
tikimonarch Oct 24, 2020
e647a62
checkstyle import
tikimonarch Oct 24, 2020
1b032b3
Provide an example for inputting name
HengFuYuen Oct 24, 2020
0721aa5
Merge pull request #65 from tikimonarch/MainBranch
tikimonarch Oct 24, 2020
25209b8
Add others gender
HengFuYuen Oct 24, 2020
1df44a1
Add comments on organisation of Ui methods
HengFuYuen Oct 24, 2020
ee69fb2
Organise related methods together
HengFuYuen Oct 24, 2020
26bf707
Add getSystemRelatedCommands method
HengFuYuen Oct 24, 2020
3222b99
Update printAskForUserInfoMessage method
HengFuYuen Oct 24, 2020
168e6ac
Change initialisation completed message
HengFuYuen Oct 24, 2020
f2f9560
Update printTutorialMessage method
HengFuYuen Oct 24, 2020
e0315fb
Add getCalculatorRelatedCommands method
HengFuYuen Oct 24, 2020
ee501ad
Add getUserRelatedCommands method
HengFuYuen Oct 24, 2020
29618c8
Add getFoodListRelatedCommands method
HengFuYuen Oct 24, 2020
5927bcc
Update Ui.java
HengFuYuen Oct 24, 2020
367c9cd
Update JUnit test for Ui class
HengFuYuen Oct 24, 2020
48a62dd
Merge branch 'master' into MoreUi
HengFuYuen Oct 24, 2020
1263c99
Update Command Classes
HengFuYuen Oct 24, 2020
e3dec2a
Update I/O testing
HengFuYuen Oct 24, 2020
77776c3
Update I/O testing
HengFuYuen Oct 24, 2020
e8f0c5d
Update I/O testing
HengFuYuen Oct 24, 2020
e551340
Merge branch 'master' into MorePerson
HengFuYuen Oct 24, 2020
7a463bb
Merge pull request #60 from HengFuYuen/MoreUi
HengFuYuen Oct 24, 2020
8eef36a
Merge branch 'master' into MorePerson
HengFuYuen Oct 24, 2020
5ca5ddc
Update Gender
tikimonarch Oct 24, 2020
9a9069e
Update person related code in manager
HengFuYuen Oct 24, 2020
a8a6153
Commented out a line that requires changes
HengFuYuen Oct 24, 2020
e3b0935
Update printExitMessage method
HengFuYuen Oct 24, 2020
3ce5776
Change the maximum age a person can have
HengFuYuen Oct 24, 2020
9882296
Add current weight parameter and did refactoring
HengFuYuen Oct 24, 2020
5fa10b9
Update JUnit test for person class
HengFuYuen Oct 24, 2020
0f6ea15
Update I/O testing
HengFuYuen Oct 24, 2020
fe2018b
Enable assertions
HengFuYuen Oct 24, 2020
44c3209
Fix checktyle error
HengFuYuen Oct 24, 2020
5830442
Change to less specific age, weight and height cap
HengFuYuen Oct 25, 2020
ab7d99a
Refactor out logo
HengFuYuen Oct 25, 2020
91a9177
Refactor out getStartMessage method
HengFuYuen Oct 25, 2020
79b2f55
Add printWelcomeBackMessage method
HengFuYuen Oct 25, 2020
00fdbc0
Update printEditedPersonInfo method
HengFuYuen Oct 25, 2020
28da147
Shorten JavaDocs for several methods
HengFuYuen Oct 25, 2020
08d0349
Remove bug caused by wrong input order
HengFuYuen Oct 25, 2020
76705fa
Add methods to calculate nutrient given start date
HengFuYuen Oct 25, 2020
6d5178b
Fix checkstyle error
HengFuYuen Oct 25, 2020
4cf65bf
Recommendation of daily calorie intake calculation is added
Oct 25, 2020
249af2a
Reorder the outputs
HengFuYuen Oct 26, 2020
8dc7572
Change word
HengFuYuen Oct 26, 2020
123f982
Update parser to add current weight parameter
HengFuYuen Oct 26, 2020
f534919
Update parser to support others gender
HengFuYuen Oct 26, 2020
5619904
Fix bug for checking of empty inputs
HengFuYuen Oct 26, 2020
bafdc7d
Revert "Fix bug for checking of empty inputs"
HengFuYuen Oct 26, 2020
24df057
Update user guide
HengFuYuen Oct 26, 2020
3531f41
add date filtering
0xEljh Oct 26, 2020
aa20da5
update FoodListTest time test
0xEljh Oct 26, 2020
4c223c9
update FoodListTest to run slower
0xEljh Oct 26, 2020
1b966fd
Bug Fixes and new sub-features
tikimonarch Oct 26, 2020
7c60409
redundant import
tikimonarch Oct 26, 2020
a9fdcf3
checkstyle
tikimonarch Oct 26, 2020
1f46041
Update faq and command summary section
HengFuYuen Oct 26, 2020
338a94a
Update quick start and features section
HengFuYuen Oct 26, 2020
af41a0e
Merge pull request #73 from tikimonarch/MainBranch
tikimonarch Oct 27, 2020
a25f4eb
Merge branch 'master' into MorePerson
tikimonarch Oct 27, 2020
02cf2f4
Merge pull request #68 from HengFuYuen/MorePerson
HengFuYuen Oct 27, 2020
d2070d6
Merge branch 'master' into UserGuide
HengFuYuen Oct 27, 2020
19ba7c7
Merge pull request #72 from HengFuYuen/UserGuide
HengFuYuen Oct 27, 2020
430fe45
Shift readCommand method over to Ui
HengFuYuen Oct 27, 2020
eb15553
Merge pull request #75 from HengFuYuen/MoreUi-ReadCommand
HengFuYuen Oct 27, 2020
fc99136
Merge branch 'master' into FoodList-FP
0xEljh Oct 27, 2020
aeba42f
Resolve merge conflicts
0xEljh Oct 27, 2020
1dc2312
Merge pull request #53 from AY2021S1-CS2113-T14-4/FoodList-FP
0xEljh Oct 27, 2020
e392324
Merge branch 'master' into FoodList-Date-Branch
0xEljh Oct 27, 2020
0876b11
Resolve merge conflicts
0xEljh Oct 27, 2020
fe6f730
Repeated option checker
tikimonarch Oct 27, 2020
aa8757a
Merge branch 'master' into MainBranch
tikimonarch Oct 27, 2020
3a41a05
Update InputChecker.java
tikimonarch Oct 27, 2020
3547101
updated calculation of recommended daily calorie intake.
Oct 27, 2020
bdf49d8
Update introduction for user guide
HengFuYuen Oct 27, 2020
c7cc3c0
Update quick start of the user guide
HengFuYuen Oct 27, 2020
91c4a29
added the methods to calculate food nutrients from food added within …
Oct 27, 2020
ab18fd7
Update features section of the user guide
HengFuYuen Oct 27, 2020
097b0b8
Update command summary of the user guide
HengFuYuen Oct 27, 2020
766b291
increased accuracy of the calculation by editing the case handling of…
Oct 27, 2020
a82772f
changed from using original weight to calculate recommended daily cal…
Oct 27, 2020
e6a6a99
implement PersonSaveLoadManager
snowbanana12345 Oct 27, 2020
2bb79be
automatically changes.
Oct 27, 2020
f5695d9
Remove magic numbers
HengFuYuen Oct 27, 2020
0d2c684
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp …
Oct 27, 2020
bffeea8
Update minimum acceptable height and weight
HengFuYuen Oct 27, 2020
b1c23ec
Change minimum age to zero
HengFuYuen Oct 27, 2020
665480b
Update assertions
HengFuYuen Oct 27, 2020
880bebd
Merge branch 'master' into Zhong-ming-saveload-branch
snowbanana12345 Oct 27, 2020
9979d41
add Junit test
snowbanana12345 Oct 27, 2020
454e9bd
Merge branch 'Zhong-ming-saveload-branch' of https://github.com/snowb…
snowbanana12345 Oct 27, 2020
12ce0a3
Update acceptable values for some parameters
HengFuYuen Oct 27, 2020
d112834
Merge pull request #82 from HengFuYuen/MorePersonAndChecker
HengFuYuen Oct 27, 2020
82d1edf
deleted classes not included in the current main from tp_repo
Oct 27, 2020
b43b1ac
no message
snowbanana12345 Oct 27, 2020
4efc263
change directory
snowbanana12345 Oct 27, 2020
83d426b
Merge branch 'FoodList-Date-Branch' of https://github.com/AY2021S1-CS…
Oct 27, 2020
34b46b4
resolve static problems
Oct 27, 2020
0e62e65
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp …
snowbanana12345 Oct 27, 2020
b55f6f0
Merge pull request #56 from AY2021S1-CS2113-T14-4/FoodList-Date-Branch
0xEljh Oct 27, 2020
84c6fe5
add retrieval methods for portion and date
0xEljh Oct 27, 2020
0f77f9f
updated with new person format
Oct 27, 2020
726d094
add Junit test for PersonSaveLoadManager
snowbanana12345 Oct 27, 2020
d080a33
fix check style
snowbanana12345 Oct 27, 2020
03fcd8a
Relaxed date filter test for robustness
0xEljh Oct 27, 2020
a64c0f7
fix check style
snowbanana12345 Oct 27, 2020
23977b8
Add methods without recalculated food
HengFuYuen Oct 27, 2020
0de4f41
Merge pull request #58 from snowbanana12345/Zhong-ming-saveload-branch
snowbanana12345 Oct 27, 2020
91c8987
Merge branch 'master' into Zhong-ming-Branch-DataBase
snowbanana12345 Oct 27, 2020
87aa8c7
resolved name violation
Oct 27, 2020
55d5b07
copy paste
snowbanana12345 Oct 27, 2020
e913e66
Merge branch 'Zhong-ming-Branch-DataBase' of https://github.com/snowb…
snowbanana12345 Oct 27, 2020
3f63e1d
Fix checkstyle error
HengFuYuen Oct 27, 2020
fd551f5
Merge pull request #71 from yuqiaoluolong/branch-2-calculatorv2
yuqiaoluolong Oct 27, 2020
30bdbbe
Merge branch 'master' into MoreUserGuide
HengFuYuen Oct 27, 2020
cac4434
Merge branch 'master' into UpdateUi
HengFuYuen Oct 27, 2020
69eb966
Merge pull request #77 from HengFuYuen/MoreUserGuide
HengFuYuen Oct 27, 2020
e79f4f5
Merge branch 'master' into UpdateUi
HengFuYuen Oct 27, 2020
c67155b
Merge branch 'master' into DeveloperGuide
HengFuYuen Oct 27, 2020
093a593
fix bug
snowbanana12345 Oct 28, 2020
9288a11
Merge pull request #86 from snowbanana12345/Zhong-ming-Branch-DataBase
snowbanana12345 Oct 28, 2020
232aa92
Merge branch 'master' into MainBranch
tikimonarch Oct 28, 2020
5c8ad97
UML diagram
snowbanana12345 Oct 28, 2020
3af6408
Delete Duke.java
tikimonarch Oct 28, 2020
1e1c7ee
Merge pull request #76 from tikimonarch/MainBranch
tikimonarch Oct 28, 2020
5b73b91
architecture diaghram
snowbanana12345 Oct 28, 2020
427c846
Merge branch 'master' into UpdateUi
HengFuYuen Oct 28, 2020
d8c8d9f
finished words
snowbanana12345 Oct 28, 2020
08b941b
draw UML diaghrams
snowbanana12345 Oct 28, 2020
59643b9
complete DG
snowbanana12345 Oct 28, 2020
63f6a85
diaghrams
snowbanana12345 Oct 28, 2020
a602154
complete architecture
snowbanana12345 Oct 28, 2020
4305f30
Merge branch 'Zhong-Ming_Branch' of https://github.com/snowbanana1234…
snowbanana12345 Oct 28, 2020
f80517d
Merge branch 'Zhong-ming-saveload-branch' into Zhong-Ming-DG-Branch
snowbanana12345 Oct 28, 2020
a8fc02a
Merge pull request #9 from snowbanana12345/Zhong-Ming-DG-Branch
snowbanana12345 Oct 28, 2020
d1e0651
manually moved UML diaghrams and DG over to this branch
snowbanana12345 Oct 28, 2020
0434de7
Merge branch 'Zhong-ming-saveload-branch' of https://github.com/snowb…
snowbanana12345 Oct 28, 2020
7cd69c4
rename folders
snowbanana12345 Oct 28, 2020
e8cde0b
add save load feature part into developerGuide.md
snowbanana12345 Oct 28, 2020
4a09f85
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp
snowbanana12345 Oct 28, 2020
1203e54
Merge pull request #89 from HengFuYuen/UpdateUi
HengFuYuen Oct 28, 2020
a33270c
Merge pull request #87 from AY2021S1-CS2113-T14-4/FoodList-Date-Branch
HengFuYuen Oct 28, 2020
1ce4948
Command recommend and editinfo
tikimonarch Oct 28, 2020
64a8b45
Merge branch 'master' into MainBranch
tikimonarch Oct 28, 2020
9f088b8
Update Parser.java
tikimonarch Oct 28, 2020
4b8ad59
Merge pull request #90 from snowbanana12345/Zhong-ming-saveload-branch
snowbanana12345 Oct 28, 2020
cbfac91
Merge branch 'master' of https://github.com/AY2021S1-CS2113-T14-4/tp
snowbanana12345 Oct 28, 2020
088746b
Update help command output
HengFuYuen Oct 28, 2020
81a6782
Add Ui component
HengFuYuen Oct 28, 2020
79ab1d0
Add UML diagrams
HengFuYuen Oct 28, 2020
71a95dd
Add enter user information feature
HengFuYuen Oct 28, 2020
5fd07fe
Update target user
HengFuYuen Oct 28, 2020
ab9aa11
Update non functional requirements
HengFuYuen Oct 28, 2020
465d6bb
Update glossary
HengFuYuen Oct 28, 2020
a52a922
Change minor formatting
HengFuYuen Oct 28, 2020
fbabae0
Improve markdown code quality
HengFuYuen Oct 28, 2020
bc695d9
Add table of contents
HengFuYuen Oct 28, 2020
630ef09
Merge pull request #91 from HengFuYuen/UpdateHelp
0xEljh Oct 28, 2020
c61e726
Merge pull request #94 from HengFuYuen/DeveloperAndUserGuide
HengFuYuen Oct 28, 2020
c1bd39b
Update diagrams and links
HengFuYuen Oct 28, 2020
f9b1aa7
Merge pull request #97 from HengFuYuen/UpdateDiagramsAndLinks
HengFuYuen Oct 28, 2020
5fd1b03
Merge branch 'master' into UpdateDiagrams
HengFuYuen Oct 28, 2020
0b8c6c0
Update file names
HengFuYuen Oct 28, 2020
4455a95
Merge pull request #100 from HengFuYuen/UpdateDiagrams
HengFuYuen Oct 28, 2020
d0ce853
Set theme jekyll-theme-architect
HengFuYuen Oct 28, 2020
8024fdb
Remove static referencing
0xEljh Oct 28, 2020
1a58bc1
Delete Food.java in Test
0xEljh Oct 28, 2020
99f7e94
Add dataSuccessfullySavedMessage method
HengFuYuen Oct 28, 2020
61c0f21
add toString version of datetime support methods
0xEljh Oct 28, 2020
097fb48
Merge pull request #103 from AY2021S1-CS2113-T14-4/clean-up-branch
HengFuYuen Oct 28, 2020
3ab299d
Feature Updates
tikimonarch Oct 28, 2020
542af1e
Merge pull request #102 from HengFuYuen/Ui-SaveDataMessage
HengFuYuen Oct 28, 2020
094e04c
Merge branch 'master' into MainBranch
tikimonarch Oct 28, 2020
ad19185
Merge branch 'master' into MainBranch
tikimonarch Oct 28, 2020
ad5424d
Database Printing
tikimonarch Oct 28, 2020
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
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
221662a
implement and test search food by index function in data base
snowbanana12345 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
9485a2c
copy resources over to test
snowbanana12345 Nov 8, 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)

**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.}

### [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)

`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.
##### 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)
##### FoodSaveLoadManager#load()
![Alt text](save_load_feature/FoodSaveLoadManager_load.png)
similiar diaghrams for PersonSaveLoadManager

## 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}
Loading