Skip to content

Commit

Permalink
Merge cc0eaaa into fb2df80
Browse files Browse the repository at this point in the history
  • Loading branch information
0WN463 committed Nov 1, 2018
2 parents fb2df80 + cc0eaaa commit 8a85e84
Show file tree
Hide file tree
Showing 64 changed files with 479 additions and 395 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ addressbook.txt
backup_data.txt
exams.txt
statistics.txt
log.txt

# Package Files #
*.jar
Expand Down
7 changes: 4 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
= ClassRepo
ifdef::env-github,env-browser[:relfileprefix: docs/]
ifdef::env-github,env-browser[:imagesDir: docs/images]
:imagesDir: docs/images

https://travis-ci.org/CS2113-AY1819S1-F10-1/main[image:https://travis-ci.org/CS2113-AY1819S1-F10-1/main.svg?branch=master[Build Status]]
image:https://api.codacy.com/project/badge/Grade/e1ed6200448148c6a6c8d955ee177c64["Codacy code quality", link="https://www.codacy.com/app/0WN463/main?utm_source=github.com&utm_medium=referral&utm_content=CS2113-AY1819S1-F10-1/main&utm_campaign=Badge_Grade"]https://coveralls.io/github/CS2113-AY1819S1-F10-1/main?branch=master[image:https://coveralls.io/repos/github/CS2113-AY1819S1-F10-1/main/badge.svg[Build Status]]

image::UiNew.png[]
image::Ui.png[]

* This is a CLI (Command Line Interface) Database application *written in OOP fashion*. It has a very basic GUI.
* The application manages and facilitates data entry and viewing for a tuition centre.
* Students, tutors and admins can access information with increasing privileges respectively.
*What's in Version 1.1*
*What's in Version 1.3*

* A simple GUI added to replace the Text UI.
* A `Logic` class added together with a `LogicTest` class.
Expand All @@ -37,7 +38,7 @@ The full list of contributors for ClassRepo can be found https://cs2113-ay1819s1

== Acknowledgements

This application was adapted from AddressBook-Level 3 by se-edu https://github.com/se-edu/addressbook-level3[here].
This application was adapted from AddressBook-Level 3 by se-edu image:SeEduLogo.png[width = "20"] https://github.com/se-edu/addressbook-level3[here].

== Contact Us

Expand Down
17 changes: 9 additions & 8 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -306,21 +306,22 @@ image::RegisterExam_Sequence_Diagram.png[width="1200"]

// tag::privilege[]
=== Privilege Feature

The figure below shows the class diagram describing the implementation of the Privilege feature.
[[fig-PrivilegeDiagram]]
.Class Diagram of the Privilege Component
image::Privilege.png[width="600"]

==== Current Implementation

*Logic* is assigned to one *Privilege* object at all times. *Privilege* contains a *User* (specified by the *PrivilegeLevel* enum) and a *Person* (referred to as `myPerson`). +
*User* defines what access level the *Privilege* object has, which is implemented by *BasicUser*, *TutorUser* and *AdminUser*. +
*BasicUser* is the class with the lowest access level and the ancestor to other 2 *User* classes. +
To create an increasing level of access, each *User* of a higher level inherits from the successively lower one. +
*User* levels have their own list of new commands they can run, which is appended to the list inherited from their parent. +
* *Logic* is assigned to one *Privilege* object at all times. *Privilege* contains a *User* (specified by the *PrivilegeLevel* enum) and a *Person* (referred to as `myPerson`). +
* *User* defines what access level the *Privilege* object have, which is implemented by *BasicUser*, *TutorUser* and *AdminUser*. +
* *BasicUser* is the class with the lowest access level, and the ancestor to other 2 *User* classes. +
* To create an increasing level of access, each *User* of a higher level inherits from the successively lower one. +
* *User* levels have their own list of new commands they can run, which is appended to the list inherited from their parent. +


*Account* class, which contains its respective *Privilege* object as well as login details, assigns an access level to a *Person*. +
When switching *Privilege* levels, the *Privilege* object referred to by *Logic* will point its *User*(`user`) and *Person*(`myPerson`) to those of the desired *Privilege level*, as seen below in the Object Diagram and Sequence Diagram. +
* *Account* class, which contains its respective *Privilege* object as well as login details, assigns an access level to a *Person*. +
* When switching *Privilege* levels, the *Privilege* object referred to by *Logic* will point its *User*(`user`) and *Person*(`myPerson`) to those of the desired *Privilege level*, as seen below in the Object Diagram and Sequence Diagram. +

[[fig-PrivilegeObjectDiagram]]
.How switching Privilege is implemented (Object Diagram)
Expand Down
Binary file removed docs/Diagrams.pptx
Binary file not shown.
61 changes: 38 additions & 23 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ ClassRepo is *optimized for those who prefer to work with a Command Line Interfa
. Ensure you have Java version `9` or later installed in your Computer.
. Download the latest `addressbook.jar` link:{repoURL}/releases[here].
. Copy the file to the folder you want to use as the home folder for your Address Book.
. Double-click the file to start the app. The GUI should appear in a few seconds.
. Double-click the file to start the app. The GUI should appear in a few seconds, as shown below.
+
image::UiNew.png[]

[[fig-UI]]
.UI of ClassRepo
image::Ui.png[]

== Commands Available

Expand Down Expand Up @@ -66,7 +69,7 @@ The default master password when first deploying ClassRepo is `default_pw`.
====

****
Examples:
Example(s):
* `raise default_pw` +
Raises your privilege level to Admin.
Expand All @@ -90,7 +93,7 @@ It is recommended to change the master password when first deploying ClassRepo.
====

****
Examples:
Example(s):
* `editpw default_pw new_pw` +
Changes the master password to "new_pw".
Expand All @@ -110,7 +113,7 @@ This is recommended to be only done on machines that you are certain only admini
====

****
Examples:
Example(s):
* `raise default_pw` +
`perm true` +
Expand Down Expand Up @@ -140,7 +143,7 @@ be seen using the `viewall` command.
Persons can have any number of tags (including 0)
****

Examples:
Example(s):

* `add John Doe p/98765432 e/johnd@gmail.com a/John street, block 123, #01-01`
* `add Betsy Crowe pp/1234567 e/betsycrowe@gmail.com pa/Newgate Prison t/criminal t/friend`
Expand All @@ -164,7 +167,7 @@ Displays all persons (showing all non-private details) in the address book as a
Format: `listall` +

****
Examples:
Example(s):
* `listall` +
****
Expand All @@ -180,7 +183,7 @@ The search is case sensitive, the order of the keywords does not matter, only th
and persons matching at least one keyword will be returned (i.e. `OR` search).
=====

Examples:
Example(s):

* `find John` +
Returns `John Doe` but not `john`.
Expand All @@ -198,7 +201,7 @@ Deletes the person at the specified `INDEX`.
The index refers to the index number shown in the most recent listing.
****

Examples:
Example(s):

* `list` +
`delete 2` +
Expand All @@ -218,7 +221,7 @@ Views the person at the specified `INDEX`.
The index refers to the index number shown in the most recent listing.
****

Examples:
Example(s):

* `list` +
`view 2` +
Expand All @@ -238,7 +241,7 @@ Views all details of the person at the specified `INDEX`.
The index refers to the index number shown in the most recent listing.
****

Examples:
Example(s):

* `list` +
`viewall 2` +
Expand Down Expand Up @@ -273,7 +276,7 @@ Words in `UPPER_CASE` are the parameters, items in `SQUARE_BRACKETS` are optiona
Put a `p` before the exam name prefix to mark the exam as `private`.
****

Examples:
Example(s):

* `addexam e/Math 2018 Finals s/Mathematics d/01-12-2018 st/09:00 et/12:00 dt/At MPSH` +

Expand Down Expand Up @@ -308,7 +311,7 @@ Words in `UPPER_CASE` are the parameters, items in `SQUARE_BRACKETS` are optiona
PRIVATE_STATUS is denoted by `y` for private and `n` for non-private.
=====

Examples:
Example(s):

* `examslist` +
`editexam 2 p/y e/English 2018 Finals dt/In MPSH`
Expand Down Expand Up @@ -399,7 +402,7 @@ Fees are automatically marked as `private`. `private` details can only
be seen using the `viewall` command, or for fees specifically, the `viewfees` command.
****

Examples:
Example(s):

* `addfees 1 344.41`
* `addfees 2 0.60`
Expand All @@ -414,7 +417,7 @@ Views the fees of the person at the specified `INDEX`.
The index refers to the index number shown in the most recent listing.
****

Examples:
Example(s):

* `list` +
`viewfees 2` +
Expand All @@ -441,7 +444,7 @@ USER_TYPE can be of type "Basic", "Tutor" or "Admin".
=====

****
Examples:
Example(s):
* `list` +
`addacc 1 JohnDoe1337 P455W0RD Admin` +
Expand All @@ -454,7 +457,7 @@ Format: `delacc INDEX`
Deletes the account of the person with INDEX as specified by the last shown list. +

****
Examples:
Example(s):
* `list` +
`delacc 1` +
Expand All @@ -468,7 +471,7 @@ Logs into the account with the given USERNAME and PASSWORD. +
Sets the current privilege level to that of the account.

****
Examples:
Example(s):
* `login 1 JohnDoe1337 P455W0RD Admin`
Login an account with the username of `JohnDoe1337` and password of `P455W0RD`, provided it exists.
Expand All @@ -481,7 +484,7 @@ Logout from the currently signed in account. +
Also resets the privilege back to the level of a Basic User.

****
Examples:
Example(s):
* `logout`
Logs out of the current account, provided there is privilege or account to relinquish.
Expand Down Expand Up @@ -509,7 +512,7 @@ name. Duplicate assessments cannot be added.
****

Examples:
Example(s):

* `addassess CG2271 Midterm` +

Expand Down Expand Up @@ -547,7 +550,7 @@ i.e. Indices are selected after first carrying out the `list` and `listassess` c
****

Examples:
Example(s):

* `list`
* `listassess`
Expand All @@ -567,7 +570,7 @@ or student whose grades you want to view.
****

Examples:
Example(s):

* `viewgrades 1` +
* The results will be displayed as a list of assessments the student has taken and their corresponding grades.
Expand Down Expand Up @@ -600,7 +603,7 @@ Format: `attendance INDEX d/DATE att/ATTENDANCE`
Updates the attendance of the person with INDEX as specified by the last shown list according to the DATE. +
~*If~ ~the~ ~input~ ~date~ ~is~ ~0~ ~(e.g.~ ~d/0)~~,~ ~the~ ~current~ ~date~ ~will~ ~be~ ~used~
****
Examples:
Example(s):
* `list` +
`attendance 1 d/29-09-2018 att/1` +
Expand Down Expand Up @@ -662,3 +665,15 @@ Shows a list of people who were present today. +
Address book data are saved in the hard disk automatically after any command that changes the data.

There is no need to save manually. Address book data are saved in a file called `addressbook.txt` in the project root folder.

== Handling Errors

1. ClassRepo does not start up when running the jar file. +
*Plausible cause*: `addressbook.txt`, `exambook.txt` or `statistic.txt` contains invalid data.
*Solution*: Fix the data error in the problematic file.
Refer to `log.txt` to find the underlying error. +

2. ClassRepo shuts down mid-operation. +
*Plausible cause*: `addressbook.txt`, `exambook.txt` or `statistic.txt` was set to read-only during
a data saving operation. ClassRepo shuts itself down to ensure synchronisation of AppData and storage data.
*Solution*: Ensure that the data files are not set as read-only.
Binary file modified docs/images/0wn463.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/DependencyInjection.png
Binary file not shown.
Binary file removed docs/images/DependencyInjectionWithoutDIP.png
Binary file not shown.
2 changes: 0 additions & 2 deletions docs/images/GenPrivilegeDiagram.suml

This file was deleted.

Binary file removed docs/images/LogicStroageFileDIP.png
Binary file not shown.
Binary file removed docs/images/PrintableInterface.png
Binary file not shown.
Binary file removed docs/images/ReadOnlyPersonUsage.png
Binary file not shown.
Binary file modified docs/images/Ui.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/UiNew.png
Binary file not shown.
Binary file modified docs/images/lucdx.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/meg1456.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/meisbokai.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 34 additions & 32 deletions docs/team/0wn463.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,41 @@ Under this project, I serve as the Project Lead, monitoring the merger of Pull R

== Summary of contributions

* *Major enhancement*: added *Privilege* and *Account Features*
** What it does: Restricts available user interactions based on what privilege level they are currently hold. Accounts allow users to authenticate themselves so as to access more commands.
** Justification: This feature helps fufil the requirement of having different types of user interacting with the system. This creates some form of structure within the system, giving the users access only to the commands that they will need.
** Highlights: This feature weaves itself into all the commands implemented, which demands careful modification to each of them as to ensure no bugs arise from regression.

* *Minor enhancement*: Updated code of AddressBook-3 to fulfil the Learning Outcomes expected, to provide a good base to start the project on.

* *Other contributions*:

** Project management:
*** Managed releases `v1.2.1`, `v1.3` and `v1.4` (3 releases) on GitHub
** Enhancements to existing features:
*** Updated the GUI
**** Added a status console to display status messages
**** Designed and added Koro-san image:Koro-san.png[32,32], our mascot which serves as our Java application icon.

** Documentation:
*** Did cosmetic tweaks
**** Added table of content
**** Made Appendices collapsible
**** Designed and added icons image:Basic.png[16,16] image:Tutor.png[16,16] image:Admin.png[16,16] for easier identification of privilege required for commands
** Community:
*** PRs reviewed (with non-trivial review comments): https://github.com/CS2113-AY1819S1-F10-1/main/pull/86[#86], https://github.com/CS2113-AY1819S1-F10-1/main/pull/117[#117], https://github.com/CS2113-AY1819S1-F10-1/main/pull/127[#127]
*** Contributed to forum discussions (examples: https://github.com/nusCS2113-AY1819S1/forum/issues/30[#30], https://github.com/nusCS2113-AY1819S1/forum/issues/50[#50], https://github.com/nusCS2113-AY1819S1/forum/issues/58[#58])
=== *Major enhancement*: added *Privilege* and *Account Features*

* What it does: Restricts available user interactions based on what privilege level they are currently hold. Accounts allow users to authenticate themselves so as to access more commands.
* Justification: This feature helps fufil the requirement of having different types of user interacting with the system. This creates some form of structure within the system, giving the users access only to the commands that they will need.
* Highlights: This feature weaves itself into all the commands implemented, which demands careful modification to each of them as to ensure no bugs arise from regression.

=== *Minor enhancement*:
* Updated code of AddressBook-3 to fulfil the Learning Outcomes expected, to provide a good base to start the project on.

=== *Other contributions*:

* Project management:
** Managed releases `v1.2.1`, `v1.3` and `v1.4` (3 releases) on GitHub
* Enhancements to existing features:
** Updated the GUI
*** Added a status console to display status messages
*** Designed and added Koro-san image:Koro-san.png[32,32], our mascot which serves as our Java application icon.

* Documentation:
** Did cosmetic tweaks
*** Added table of content
*** Made Appendices collapsible
*** Designed and added icons image:Basic.png[16,16] image:Tutor.png[16,16] image:Admin.png[16,16] for easier identification of privilege required for commands
* Community:
** PRs reviewed (with non-trivial review comments): https://github.com/CS2113-AY1819S1-F10-1/main/pull/86[#86], https://github.com/CS2113-AY1819S1-F10-1/main/pull/117[#117], https://github.com/CS2113-AY1819S1-F10-1/main/pull/127[#127]
** Contributed to forum discussions (examples: https://github.com/nusCS2113-AY1819S1/forum/issues/30[#30], https://github.com/nusCS2113-AY1819S1/forum/issues/50[#50], https://github.com/nusCS2113-AY1819S1/forum/issues/58[#58])
** Tools:
*** Set up several Dev Ops application
**** Gradle (Build Automaton adapted from AB4)
**** Travis (Continuous Integration)
**** Coveralls (Code Coverage)
**** Codacy (Code Quality)
**** GitHub Pages (Auto-publishing)

*** Programmed a "Command usage to adoc format convertor", available at this https://repl.it/@0WN3D/PresentArcticIntegers[link]
* Set up several Dev Ops application
*** Gradle (Build Automaton adapted from AB4)
*** Travis (Continuous Integration)
*** Coveralls (Code Coverage)
*** Codacy (Code Quality)
*** GitHub Pages (Auto-publishing)

* Programmed a "Command usage to adoc format convertor", available at this https://repl.it/@0WN3D/PresentArcticIntegers[link]

== Contributions to the User Guide

Expand Down

0 comments on commit 8a85e84

Please sign in to comment.