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

Update UG/DG for Archive, hyperlinks, and UI diagram #180

Merged
merged 2 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/DevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ As part of CI, this project uses Codecov to generate coverage reports. Here are

1. Sign up with Codecov using your GitHub account [here](https://codecov.io/signup).
1. Once you are inside Codecov web app, add your fork to CodeCov.
1. Get the Markdown code for the Codecov badge provided in `Settings > Badges` and update the `docs/index.md` of your repo with it so that the badge [![codecov](https://codecov.io/gh/se-edu/addressbook-level3/branch/master/graph/badge.svg)](https://codecov.io/gh/se-edu/addressbook-level3) in that page reflects the coverage of your project.
1. Get the Markdown code for the Codecov badge provided in `Settings > Badges` and update the `docs/index.md` of your repo with it so that the badge [![codecov](https://codecov.io/gh/AY2122S1-CS2103-W14-1/tp/branch/master/graph/badge.svg)](https://codecov.io/gh/AY2122S1-CS2103-W14-1/tp) in that page reflects the coverage of your project.

### Repository-wide checks

Expand Down Expand Up @@ -73,7 +73,7 @@ Any warnings or errors will be printed out to the console.

Here are the steps to create a new release.

1. Update the version number in [`MainApp.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java).
1. Update the version number in [`MainApp.java`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/MainApp.java).
1. Generate a fat JAR file using Gradle (i.e., `gradlew shadowJar`).
1. Tag the repo with the version number. e.g. `v0.1`
1. [Create a new release using GitHub](https://help.github.com/articles/creating-releases/). Upload the JAR file you created.
58 changes: 45 additions & 13 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: Developer Guide

## **Acknowledgements**

* {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}
* Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5)

--------------------------------------------------------------------------------------------------------------------

Expand All @@ -23,7 +23,7 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md).

<div markdown="span" class="alert alert-primary">

:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/se-edu/addressbook-level3/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams.
:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams.
</div>

### Architecture
Expand All @@ -36,7 +36,7 @@ Given below is a quick overview of main components and how they interact with ea

**Main components of the architecture**

**`Main`** has two classes called [`Main`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/Main.java) and [`MainApp`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java). It is responsible for,
**`Main`** has two classes called [`Main`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/Main.java) and [`MainApp`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/MainApp.java). It is responsible for,
* At app launch: Initializes the components in the correct sequence, and connects them up with each other.
* At shut down: Shuts down the components and invokes cleanup methods where necessary.

Expand Down Expand Up @@ -69,13 +69,13 @@ The sections below give more details of each component.

### UI component

The **API** of this component is specified in [`Ui.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/Ui.java)
The **API** of this component is specified in [`Ui.java`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/ui/Ui.java)

![Structure of the UI Component](images/UiClassDiagram.png)

The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PatientListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI.

The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml)
The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/resources/view/MainWindow.fxml)

The `UI` component,

Expand All @@ -84,9 +84,27 @@ The `UI` component,
* keeps a reference to the `Logic` component, because the `UI` relies on the `Logic` to execute commands.
* depends on some classes in the `Model` component, as it displays `Patient` object residing in the `Model`.

**Displaying Patient and Appointment Panels**

The main UI parts of the `MainWindow` to display Patient and Appointment information are `PatientListPanel` and
`AppointmentListPanel`, each holding a number of `PatientCard`'s and `AppointmentCard`'s.

![Example of PatientCard](images/PatientCard.png)

In the `PatientCard` part, we can see all the details that we store of the Patient.

![Example of AppointmentCard](images/AppointmentCard.png)

In the `AppointmentCard` part, appointments occurring today have a highlighted '**TODAY**' indicator to help clinic staff
easily identify appointments occurring today. Non-essential patient details are also omitted.

We can also toggle between the **Archive** and **Upcoming** tabs to view Appointments that are upcoming or have been
archived. This is also the reason why `MainWindow` component holds two `AppointmentListPanel`'s - One for
upcoming appointments, and the other for archived appointments.

### Logic component

**API** : [`Logic.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/logic/Logic.java)
**API** : [`Logic.java`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/logic/Logic.java)

Here's a (partial) class diagram of the `Logic` component:

Expand Down Expand Up @@ -139,6 +157,7 @@ The following is a list of commands that extend the three abstract classes:
- `FindPatientCommand`
- `AppointmentCommand`
- `AddAppointmentCommand`
- `ArchiveAppointmentCommand`
- `EditAppointmentCommand`
- `DeleteAppointmentCommand`
- `ListAppointmentsCommand`
Expand All @@ -162,7 +181,7 @@ any form of extra user input), we have a specific parser that tokenises the comm
- `DeleteAppointmentCommandParser`

### Model component
**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java)
**API** : [`Model.java`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/model/Model.java)

<img src="images/ModelClassDiagram.png" width="800" />

Expand All @@ -183,7 +202,7 @@ The `Model` component,

### Storage component

**API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java)
**API** : [`Storage.java`](https://github.com/AY2122S1-CS2103-W14-1/tp/tree/master/src/main/java/seedu/docit/storage/Storage.java)

<img src="images/StorageClassDiagram.png" width="600" />

Expand Down Expand Up @@ -306,9 +325,9 @@ The diagram below is a more in-depth look at how `JSONAdaptedAppointment` is ins

### Archiving an Appointment

A user is able archives an appointment when the appointment is past its date, i.e. the patient has either missed his/her appointment
A user is able to archive an appointment when the appointment is _expired_, i.e. the patient has either missed his/her appointment
or already attended the scheduled appointment. In this case, the appointment should be archived, so that clinic staff
are able to view what medicine was prescribed to the patient during previous appointments.
are able to view what medicine was prescribed to the patient during previous appointments.

#### How Archiving is Implemented

Expand All @@ -328,13 +347,26 @@ details.

#### Auto-Archiving Implementation

The proposed archiving implementation involves scanning through all appointments in a day and comparing it to
the current date (not time) of the user system. If the current date is 1 day ahead of the appointment, the appointment is
automatically archived.
The archiving implementation involves scanning through all appointments in a day and comparing it to
the current date and time of the user system. If the current date and time is 24 hours ahead of the scheduled
appointment time (24-hour buffer), i.e. by our definition, _expired_, the appointment is automatically archived. This auto-archiving implementation is handled
by the `ModelManager` class in two ways.

1. Upon initialisation of the application, the application automatically archives expired appointments (24-hours past their
scheduled time). This is called through `ModelManager#archivePastAppointments()`.


2. A `ScheduledExecutorService` object schedules the task `AutoArchiveApmts` which implements the `Runnable` interface. Every
day at the `ModelManager.UPDATE_HOUR`th hour, the `Runnable` object executes the `ModelManager#archivePastAppointments()`
method.


In the case where there are many scheduled appointments, this saves the user trouble of archiving past appointments when
they are already over.

#### Specific Auto-Archiving

Users may still archive specific appointments manually to remove visual clutter. This is done through the `ArchiveAppointmentCommand`.

### \[Proposed\] Undo/redo feature

Expand Down
1 change: 1 addition & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,4 @@ Shows a sorted list of all appointments
| Archive | Storage for data that is non-urgent, e.g. appointment records that are past their date. |
| Patient Record | A record of a patient's details, medical history, medication, appointment list, and name. |
| Prescription | The issued medication/treatment for a patient along with a duration and volume. |
| Expired Appointment | An appointment that is 24-hours past its scheduled time. |
Binary file modified docs/diagrams/DeleteSequenceDiagram.png
Loading
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/diagrams/LogicClassDiagram.png
Loading
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/diagrams/ParserClasses.png
Loading
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/diagrams/SaveAppointmentSequenceDiagram1.png
Loading
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/diagrams/SaveAppointmentSequenceDiagram2.png
Loading
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/diagrams/UiClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/diagrams/UiClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Class MainWindow
Class HelpWindow
Class ResultDisplay
Class PatientListPanel
Class AppointmentListPanel
Class PatientCard
Class AppointmentCard
Class StatusBarFooter
Class CommandBox
}
Expand All @@ -34,19 +36,23 @@ MainWindow *-down-> "1" CommandBox
MainWindow *-down-> "1" ResultDisplay
MainWindow *-down-> "1" PatientListPanel
MainWindow *-down-> "1" StatusBarFooter
MainWindow *-down-> "2" AppointmentListPanel
MainWindow --> "0..1" HelpWindow

PatientListPanel -down-> "*" PatientCard
AppointmentListPanel -down-> "*" AppointmentCard

MainWindow -left-|> UiPart

ResultDisplay --|> UiPart
CommandBox --|> UiPart
PatientListPanel --|> UiPart
AppointmentListPanel --|> UiPart
PatientCard --|> UiPart
StatusBarFooter --|> UiPart
HelpWindow --|> UiPart

AppointmentCard ..> Model
PatientCard ..> Model
UiManager -right-> Logic
MainWindow -left-> Logic
Expand Down
Binary file added docs/images/AppointmentCard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/PatientCard.png
Loading
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/UiClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/tutorials/AddRemark.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We’ll assume that you have already set up the development environment as outli

Looking in the `logic.command` package, you will notice that each existing command have their own class. All the commands inherit from the abstract class `Command` which means that they must override `execute()`. Each `Command` returns an instance of `CommandResult` upon success and `CommandResult#feedbackToUser` is printed to the `ResultDisplay`.

Let’s start by creating a new `RemarkCommand` class in the `src/main/java/seedu/address/logic/command` directory.
Let’s start by creating a new `RemarkCommand` class in the `src/main/java/seedu/docit/logic/command` directory.

For now, let’s keep `RemarkCommand` as simple as possible and print some output. We accomplish that by returning a `CommandResult` with an accompanying message.

Expand Down Expand Up @@ -45,7 +45,7 @@ public class RemarkCommand extends Command {

Now that we have our `RemarkCommand` ready to be executed, we need to update `AddressBookParser#parseCommand()` to recognize the `remark` keyword. Add the new command to the `switch` block by creating a new `case` that returns a new instance of `RemarkCommand`.

You can refer to the changes in this [diff](https://github.com/se-edu/addressbook-level3/commit/35eb7286f18a029d39cb7a29df8f172a001e4fd8#diff-34ace715a8a8d2e5a66e71289f017b47).
You can refer to the changes in this [diff](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/35eb7286f18a029d39cb7a29df8f172a001e4fd8#diff-34ace715a8a8d2e5a66e71289f017b47).

### Run the application

Expand Down Expand Up @@ -136,7 +136,7 @@ public class RemarkCommand extends Command {
}
```

Your code should look something like [this](https://github.com/se-edu/addressbook-level3/commit/35eb7286f18a029d39cb7a29df8f172a001e4fd8#diff-34ace715a8a8d2e5a66e71289f017b47) after you are done.
Your code should look something like [this](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/35eb7286f18a029d39cb7a29df8f172a001e4fd8#diff-34ace715a8a8d2e5a66e71289f017b47) after you are done.

### Parse user input

Expand Down Expand Up @@ -221,7 +221,7 @@ public RemarkCommand parse(String args) throws ParseException {
</div>

If you are stuck, check out the sample
[here](https://github.com/se-edu/addressbook-level3/commit/dc6d5139d08f6403da0ec624ea32bd79a2ae0cbf#diff-fc19ecee89c3732a62fbc8c840250508).
[here](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/dc6d5139d08f6403da0ec624ea32bd79a2ae0cbf#diff-fc19ecee89c3732a62fbc8c840250508).

## Add `Remark` to the model

Expand All @@ -231,7 +231,7 @@ Now that we have all the information that we need, let’s lay the groundwork fo

Create a new `Remark` in `seedu.docit.model.patient`. Since a `Remark` is a field that is similar to `Address`, we can reuse a significant bit of code.

A copy-paste and search-replace later, you should have something like [this](https://github.com/se-edu/addressbook-level3/commit/4516e099699baa9e2d51801bd26f016d812dedcc#diff-af2f075d24dfcd333876f0fbce321f25). Note how `Remark` has no constrains and thus does not require input
A copy-paste and search-replace later, you should have something like [this](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/4516e099699baa9e2d51801bd26f016d812dedcc#diff-af2f075d24dfcd333876f0fbce321f25). Note how `Remark` has no constrains and thus does not require input
validation.

### Make use of `Remark`
Expand All @@ -242,7 +242,7 @@ Let’s change `RemarkCommand` and `RemarkCommandParser` to use the new `Remark`

Without getting too deep into `fxml`, let’s go on a 5 minute adventure to get some placeholder text to show up for each patient.

Simply add the following to [`seedu.docit.ui.PatientCard`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-0c6b6abcfac8c205e075294f25e851fe).
Simply add the following to [`seedu.docit.ui.PatientCard`](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/850b78879582f38accb05dd20c245963c65ea599#diff-0c6b6abcfac8c205e075294f25e851fe).

**`PatientCard.java`:**

Expand All @@ -254,7 +254,7 @@ private Label remark;

`@FXML` is an annotation that marks a private or protected field and makes it accessible to FXML. It might sound like Greek to you right now, don’t worry — we will get back to it later.

Then insert the following into [`main/resources/view/PatientListCard.fxml`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-12580431f55d7880578aa4c16f249e71).
Then insert the following into [`main/resources/view/PatientListCard.fxml`](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/850b78879582f38accb05dd20c245963c65ea599#diff-12580431f55d7880578aa4c16f249e71).

**`PatientListCard.fxml`:**

Expand Down Expand Up @@ -284,7 +284,7 @@ Unfortunately, a change to `Patient` will cause other commands to break, you wil

</div>

Refer to [this commit](https://github.com/se-edu/addressbook-level3/commit/ce998c37e65b92d35c91d28c7822cd139c2c0a5c) and check that you have got everything in order!
Refer to [this commit](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/ce998c37e65b92d35c91d28c7822cd139c2c0a5c) and check that you have got everything in order!


## Updating Storage
Expand All @@ -299,14 +299,14 @@ While the changes to code may be minimal, the test data will have to be updated

</div>

Check out [this commit](https://github.com/se-edu/addressbook-level3/commit/556cbd0e03ff224d7a68afba171ad2eb0ce56bbf)
Check out [this commit](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/556cbd0e03ff224d7a68afba171ad2eb0ce56bbf)
to see what the changes entail.

## Finalizing the UI

Now that we have finalized the `Patient` class and its dependencies, we can now bind the `Remark` field to the UI.

Just add [this one line of code!](https://github.com/se-edu/addressbook-level3/commit/5b98fee11b6b3f5749b6b943c4f3bd3aa049b692)
Just add [this one line of code!](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/5b98fee11b6b3f5749b6b943c4f3bd3aa049b692)

**`PatientCard.java`:**

Expand Down Expand Up @@ -373,7 +373,7 @@ Tests are crucial to ensuring that bugs don’t slip into the codebase unnoticed

Let’s verify the correctness of our code by writing some tests!

Of course you can simply add the test cases manually, like you've been doing all along this tutorial. The result would be like the test cases in [here](https://github.com/se-edu/addressbook-level3/commit/fac8f3fd855d55831ca0cc73313b5943d49d4d6e#diff-d749de38392f7ea504da7824641ba8d9). Alternatively, you can get the help of IntelliJ to generate the skeletons of the test cases, as explained in the next section.
Of course you can simply add the test cases manually, like you've been doing all along this tutorial. The result would be like the test cases in [here](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/fac8f3fd855d55831ca0cc73313b5943d49d4d6e#diff-d749de38392f7ea504da7824641ba8d9). Alternatively, you can get the help of IntelliJ to generate the skeletons of the test cases, as explained in the next section.

### Automatically generating tests

Expand All @@ -394,7 +394,7 @@ Following convention, let’s change the name of the generated method to `execut

Let’s use the utility functions provided in `CommandTestUtil`. The functions ensure that commands produce the expected `CommandResult` and output the correct message. In this case, `CommandTestUtil#assertCommandSuccess` is the best fit as we are testing that a `RemarkCommand` will successfully add a `Remark`.

You should end up with a test that looks something like [this](https://github.com/se-edu/addressbook-level3/commit/fac8f3fd855d55831ca0cc73313b5943d49d4d6e#diff-d749de38392f7ea504da7824641ba8d9).
You should end up with a test that looks something like [this](https://github.com/AY2122S1-CS2103-W14-1/tp/commit/fac8f3fd855d55831ca0cc73313b5943d49d4d6e#diff-d749de38392f7ea504da7824641ba8d9).

## Conclusion

Expand Down
Loading