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

Edit DG docs #301

Merged
merged 1 commit into from
Nov 13, 2023
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
14 changes: 7 additions & 7 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can reach us at the email `seer[at]comp.nus.edu.sg`
[[portfolio](team/kb-tay.md)]

* Role: Developer
* Responsibilities: User Stories
* Responsibilities: Testing + Debugging

### Nicholas Chia

Expand All @@ -26,17 +26,17 @@ You can reach us at the email `seer[at]comp.nus.edu.sg`
[[github](http://github.com/nikele2001)]
[[portfolio](team/nikele2001.md)]

* Role: Team Lead
* Responsibilities: UI
* Role: Developer
* Responsibilities: Documentation + UI

### Poon Yip Hang, Ryan

<img src="images/sopa301.png" width="200px">

[[github](http://github.com/sopa301)] [[portfolio](team/sopa301.md)]

* Role: Developer
* Responsibilities: Issue tracking
* Role: Team Lead
* Responsibilities: Issue tracking + Documentation

### Low Jun Yu

Expand All @@ -46,7 +46,7 @@ You can reach us at the email `seer[at]comp.nus.edu.sg`
[[portfolio](team/jylow.md)]

* Role: Developer
* Responsibilities: Debugging + Issue tracking
* Responsibilities: Debugging + Testing

### Alyssa Png Kai Wen

Expand All @@ -56,4 +56,4 @@ You can reach us at the email `seer[at]comp.nus.edu.sg`
[[portfolio](team/alyssapng.md)]

* Role: Developer
* Responsibilities: UI + Debugging
* Responsibilities: UI + Documentation
35 changes: 17 additions & 18 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ The **Gather Emails** feature in our software system is designed to efficiently
The `GatherCommand` is initiated by the `GatherCommandParser`. The `GatherCommandParser` checks for the prefixes `fp/` or `t/` in the user's input and creates either a `GatherEmailByFinancialPlan` or `GatherEmailByTag` object respectively.
Both `GatherEmailByFinancialPlan` or `GatherEmailByTag` implements the `GatherEmailPrompt` interface.

The `GatherCommand` takes in the `GatherEmailPrompt` object and passes it into the current `Model` model, subsequently interacting with the `AddressBook` class.
The `GatherCommand` takes in the `GatherEmailPrompt` object and passes it into the current `Model`, subsequently interacting with the `AddressBook` class.
The `GatherCommand#execute()` executes the gather operation by calling `Model#gatherEmails(GatherEmailPrompt prompt)`. Below shows how the gather operation logic works as described above:

![GatherSequenceDiagram1](images/GatherSequenceDiagram1.png)
Expand All @@ -288,9 +288,8 @@ Depending on the type of `GatherEmailPrompt`, it triggers either:
- `Person#gatherEmailsContainsTag(String prompt)` —  Checks if the given prompt is a substring of any Tag names in the `Set<Tag>` of the current person.
- `Person#gatherEmailsContainsFinancialPlan(String prompt)` —  Checks if the given prompt is a substring of any Financial Plan names in the `Set<FinancialPlan>` of the current person.

These methods internally utilize `Tag#containsSubstring(String substring)` and `FinancialPlan#containsSubstring(String substring)`, respectively. These substring comparisons are performed in a case-insensitive manner by converting both the prompt and the financial plan/tag names to lowercase before the check.
Currently, we only allow gathering emails by `FinancialPlan` and `Tag` as these are the more likely to be searched to gather emails by. This is to make gathering of emails more convenient and flexible. However, more classes implementing the `GatherEmailPromt` can be added
to facilitate the gathering of emails by more fields.
These methods internally utilize `Tag#containsSubstring(String substring)` and `FinancialPlan#containsSubstring(String substring)`, respectively. These substring comparisons are performed in a case-insensitive manner by converting both the prompt and the financial plan/tag names to lowercase before the check.
This is to make gathering of emails more convenient and flexible. Currently, we only allow gathering emails by `FinancialPlan` and `Tag` as these are the more likely to be searched to gather emails by. However, additional classes implementing the `GatherEmailPrompt` interface can be added to enable the gathering of emails based on a broader range of fields.

The following sequence diagram shows how the gather emails by financial plan operation works:

Expand Down Expand Up @@ -426,7 +425,7 @@ The `getAppointmentList()` method is called once during the startup of the progr

Do note that appointments are inherently sorted by their date and time, with the earliest appointment showing up at the top.

#### Design Considerations:
#### Design Considerations

**Aspect: Where to create** `SortedList<Appointment>`
* **Alternative 1 (current choice):** Implement it within `modelManager`
Expand Down Expand Up @@ -533,10 +532,10 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

**MSS**

1. User requests to <u>list clients (UC01)</u>
1. User requests to <u>list clients (UC01)</u>.
2. User request to edit client’s contacts from the list via the `edit` command.
3. UNOFAS checks the correctness of the request.
4. UNOFAS changes the client’s contacts
4. UNOFAS changes the client’s contacts.

Use case ends.

Expand Down Expand Up @@ -601,7 +600,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

1. User requests to <u>list clients (UC01)</u>.
2. UNOFAS shows a list of clients.
3. User request to <u>add financial plan to client’s contacts (UC03)</u>.
3. User request to <u>add financial plan to client’s contacts (UC03)</u>.
4. UNOFAS checks for the correctness of the request.
5. UNOFAS changes the client’s contacts.

Expand Down Expand Up @@ -727,16 +726,16 @@ resistant to mistakes by having the user key in a specific phrase, or to initial

### Glossary

* **Mainstream OS**: Windows, Linux, Unix, OS-X
* **Private contact detail**: A contact detail that is not meant to be shared with others
* **API**: Application Programming Interface that enables application to use capabilities or data from another application
* **Financial Advisor**: A person who provides financial advice to clients
* **Financial Products**: A product connected with the way a person manages or uses money(e.g. Insurance)
* **Client**: A person whose financial products are being managed by a financial advisor
* **Portfolio value**: The intrinsic value of all financial products being held under a clients name
* **Central Repository**: A centralised storage location for all user data
* **Contact details**: Name, email, phone number, next-of-kin name, next-of-kin phone number and home address of a client
* **Manager**: A person who is a superior in charge of managing and mentoring a group of financial advisors.
* **Mainstream OS**: Windows, Linux, UNIX, OS-X.
* **Private contact detail**: A contact detail that is not meant to be shared with others.
* **API**: Application Programming Interface that enables application to use capabilities or data from another application.
* **Appointment** : An arrangement to meet someone at a particular time, in this case, a client.
* **Financial Advisor**: A person who provides financial advice and sells financial plans to prospective clients.
* **Financial Products**: A product connected with the way a person manages or uses money (e.g. Insurance).
* **Client**: A person whose financial products are being managed by a financial advisor.
* **Portfolio value**: The intrinsic value of all financial products being held under a clients name.
* **Central Repository**: A centralised storage location for all user data.
* **Contact details**: Name, email, phone number, next-of-kin name, next-of-kin phone number, home address, financial plan(s), tag(s) and appointment(if any) of a client.
* **Lexicographical**: Generalisation of alphabetical order to include symbols or elements of a totally ordered set.

--------------------------------------------------------------------------------------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static Appointment parseAppointment(String appointmentName, String appoin
try {
LocalDateTime appointmentDate = parseAppointmentDate(appointmentDateString);
return new Appointment(trimmedAppointmentName, appointmentDate);
} catch (DateTimeParseException e) {
} catch (ParseException e) {
throw new ParseException(Appointment.MESSAGE_INVALID_DATE);
}
}
Expand All @@ -196,15 +196,16 @@ public static Appointment parseAppointment(String appointmentName, String appoin
*
* @throws ParseException if the given {@code date} is invalid.
*/
public static LocalDateTime parseAppointmentDate(String appointmentDate) throws ParseException {
String date = appointmentDate.split(" ")[0];
public static LocalDateTime parseAppointmentDate(String appointmentDateTime) throws ParseException {
String date = appointmentDateTime.split(" ")[0];

try {
YearMonth yearMonth = YearMonth.parse(date, Appointment.DATE_FORMATTER);
if (!isValidDay(yearMonth, date)) {
throw new ParseException(Appointment.MESSAGE_INVALID_DATE);
}
return Appointment.parseAppointmentDate(appointmentDate);

return Appointment.parseAppointmentDate(appointmentDateTime);
} catch (DateTimeParseException e) {
throw new ParseException(Appointment.MESSAGE_INVALID_DATE);
}
Expand Down
21 changes: 15 additions & 6 deletions src/test/java/seedu/address/logic/parser/ParserUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,24 +324,33 @@ void parseAppointment_invalidInput_shouldThrowParseException() {
String invalidDateString2 = "31-11-2023 14:30";
assertThrows(ParseException.class, () ->
ParserUtil.parseAppointment(VALID_APPOINTMENT_DESC, invalidDateString2));

// Wrong format
String invalidFormat = "1";
assertThrows(ParseException.class, () ->
ParserUtil.parseAppointment(VALID_APPOINTMENT_DESC, invalidFormat));
}
@Test
void parseAppointmentDate_validDate_shouldParseSuccessfully() throws ParseException {
String validDateString = "29-02-2024 14:30";
String validDateTimeString = "29-02-2024 14:30";
try {
ParserUtil.parseAppointmentDate(validDateString);
ParserUtil.parseAppointmentDate(validDateTimeString);
} catch (ParseException e) {
fail();
}
}
@Test
void parseAppointmentDate_invalidDate_shouldThrowParseException() {
// Wrong format
String invalidDateTime = "1";
assertThrows(ParseException.class, () -> ParserUtil.parseAppointmentDate(invalidDateTime));

// 29th Feb for non leap year
String invalidDateString1 = "29-02-2022 14:30";
assertThrows(ParseException.class, () -> ParserUtil.parseAppointmentDate(invalidDateString1));
String invalidDateTime1 = "29-02-2022 14:30";
assertThrows(ParseException.class, () -> ParserUtil.parseAppointmentDate(invalidDateTime1));

// No 31st Nov
String invalidDateString2 = "31-11-2023 14:30";
assertThrows(ParseException.class, () -> ParserUtil.parseAppointmentDate(invalidDateString2));
String invalidDateTime2 = "31-11-2023 14:30";
assertThrows(ParseException.class, () -> ParserUtil.parseAppointmentDate(invalidDateTime2));
}
}
Loading