Skip to content

Commit

Permalink
Merge and add role to import function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jollybomber committed Oct 17, 2024
2 parents b3e9f0d + 70cdad9 commit d448c71
Show file tree
Hide file tree
Showing 43 changed files with 1,326 additions and 206 deletions.
78 changes: 43 additions & 35 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,50 +281,56 @@ _{Explain here how the data archiving feature will be implemented}_
* is reasonably comfortable using CLI apps
* has a need to generate and visualize reports (e.g., volunteer hours, visit frequency) in a simple and efficient way

**Value proposition**: manage volunteer records and site visits faster than a typical mouse/GUI-driven app, while efficiently scheduling and tracking volunteer engagement

**Value proposition**: Manage volunteering _tutor_ and _tutee_ records, site visits, and scheduling faster than a
typical mouse/GUI-driven app, while efficiently tracking and enhancing volunteer engagement.

### User stories

Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*`

| Priority | As a …​ | I want to …​ | So that I can…​ |
|----------|------------|----------------------------------------------------------------|----------------------------------------------------------------------------|
| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App |
| `* * *` | supervisor | view the contact details of volunteers | reach out to them for administrative matters |
| `* * *` | supervisor | view the contact details of clients | reach out to them for administrative matters |
| `* * *` | supervisor | add a new volunteer and their details | keep track of the volunteers and their personal information |
| `* * *` | supervisor | add a new client and their details | keep track of the clients and their personal information |
| `* * *` | supervisor | update a volunteer's contact information | keep the details accurate |
| `* * *` | supervisor | update a client's contact information | keep the details accurate |
| `* * *` | supervisor | delete details of an inactive volunteer | keep the database up-to-date |
| `* * *` | supervisor | delete details of a former client | keep the database up-to-date |
| `* * *` | supervisor | view the address of a volunteer | arrange site visits to locations that are convenient for them |
| `* * *` | supervisor | view the address of a client | arrange site visits by volunteers located near them |
| `* * *` | supervisor | update a volunteer's address | keep the details accurate |
| `* * *` | supervisor | update a client's address | keep the details accurate |
| `* * *` | supervisor | update a volunteer's total volunteer hours | keep track of the number of hours they have put into volunteering |
| `* * *` | supervisor | update a volunteer's visitation records | keep track of their site visits |
| `* * *` | supervisor | view a volunteer's total volunteer hours | track their productivity and contributions over time |
| `* * *` | supervisor | interact with the application's GUI easily | enjoy the application and use it intuitively |
| `* * *` | supervisor | find a volunteer by name | locate details of volunteers without going through the entire list |
| `* *` | supervisor | view the availability of volunteers | schedule site visits that matches their availability |
| `* *` | supervisor | add the available timeslots of volunteers | allow site visits to be arranged |
| `* *` | supervisor | update the available timeslots of volunteers | ensure volunteers can conduct site visits as scheduled |
| `* *` | supervisor | view a volunteer's total hours in graphs or charts | easily analyze volunteer engagement and allocate resources efficiently |
| `* *` | supervisor | view volunteer visit frequency by location in graphs or charts | identify the most and least visited sites and adjust resources accordingly |
| `*` | supervisor | sort volunteers in different orders | locate a volunteer easily |
| `*` | supervisor | filter the volunteers by certain categories | locate a volunteer easily |
| `*` | supervisor | download a report of a volunteer's hours | use it for book-keeping or share with the volunteer upon request |
| `*` | supervisor | read large amount of data at once by importing an excel file | quickly populate the system without manually entering each data point |
| `*` | supervisor | have an autocomplete feature when typing commands | save time and reduce errors while entering commands or data |
| `*` | supervisor | utilize keyboard shortcuts | navigate to a different page quickly and conveniently |
| Priority | As a …​ | I want to …​ | So that I can…​ |
|----------|------------|----------------------------------------------------------------|--------------------------------------------------------------------------|
| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App |
| `* * *` | supervisor | view the contact details of _tutors_ | reach out to them for administrative matters |
| `* * *` | supervisor | view the contact details of _tutees_ | reach out to them for administrative matters |
| `* * *` | supervisor | add a new tutor and their details | keep track of the tutors and their personal information |
| `* * *` | supervisor | add a new tutee and their details | keep track of the tutees and their personal information |
| `* * *` | supervisor | add a tutor's tutoring subject | match them with tutees who need help in that subject |
| `* * *` | supervisor | add a tutee's required subject for tutoring | match them with a suitable volunteering tutor |
| `* * *` | supervisor | update a tutor's contact information | keep the details accurate |
| `* * *` | supervisor | update a tutee's contact information | keep the details accurate |
| `* * *` | supervisor | delete details of an inactive tutor | keep the database up-to-date |
| `* * *` | supervisor | delete details of a former tutee | keep the database up-to-date |
| `* * *` | supervisor | view the address of a tutor | arrange tutoring sessions in locations that are convenient for them |
| `* * *` | supervisor | view the address of a tutee | arrange tutoring sessions by tutors located near them |
| `* * *` | supervisor | update a tutor's address | keep the details accurate |
| `* * *` | supervisor | update a tutee's address | keep the details accurate |
| `* * *` | supervisor | update a tutor's total volunteer hours | keep track of the number of hours they have put into volunteering |
| `* * *` | supervisor | update a tutor's scheduled tutoring sessions | keep track of the sessions scheduled |
| `* * *` | supervisor | view a tutor's total volunteer hours | track their productivity and contributions over time |
| `* * *` | supervisor | view a tutor or tutee's scheduled tutoring sessions | avoid scheduling sessions that clash |
| `* * *` | supervisor | interact with the application's GUI easily | enjoy the application and use it intuitively |
| `* * *` | supervisor | find a tutor or tutee by name | locate details of tutors or tutees without going through the entire list |
| `* * *` | supervisor | undo the last command executed | easily correct mistakes without re-entering the data manually |
| `* * *` | supervisor | redo a previously undone command | reapply actions if undone by mistake |
| `* * *` | supervisor | view the history of commands from most recent to least recent | track the actions performed and verify changes |
| `* *` | supervisor | view the total number of tutors and tutees in graphs or charts | identify any inefficient allocation of resources and adjust accordingly |
| `* *` | supervisor | filter the tutors by subjects tutored | locate a tutor easily for matching purposes |
| `*` | supervisor | add the available timeslots of tutors | allow tutoring sessions to be arranged |
| `*` | supervisor | update the available timeslots of tutors | ensure tutors can conduct tutoring sessions as scheduled |
| `*` | supervisor | view the availability of tutors | schedule tutoring sessions that matches their availability |
| `*` | supervisor | view a tutor's total hours in graphs or charts | easily analyze tutor engagement and allocate resources efficiently |
| `*` | supervisor | sort tutors in different orders | locate a tutor easily |
| `*` | supervisor | download a report of a tutor's hours | use it for book-keeping or share with the tutor upon request |
| `*` | supervisor | read large amount of data at once by importing an excel file | quickly populate the system without manually entering each data point |
| `*` | supervisor | have an autocomplete feature when typing commands | save time and reduce errors while entering commands or data |
| `*` | supervisor | utilize keyboard shortcuts | navigate to a different page quickly and conveniently |

### Use cases

(For all use cases below, the **System** is the `VolunTier` and the **Actor** is the `user`, unless specified otherwise)

**Use case: UC1 - View list of persons**
**Use case: UC1 - View list of _persons_**

**MSS**

Expand Down Expand Up @@ -425,7 +431,9 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
### Glossary

* **Mainstream OS**: Windows, Linux, Unix, MacOS
* **Person**: A volunteer or a client
* **Tutor**: A volunteer; A person who provides tutoring services to tutees
* **Tutee**: A client; A person receiving tutoring services from a tutor
* **Person**: A tutor or tutee

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

Expand Down
44 changes: 44 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,50 @@ Examples:
* `list` followed by `delete 2` deletes the 2nd person in the address book.
* `find Betsy` followed by `delete 1` deletes the 1st person in the results of the `find` command.

### Viewing a person's details : `view`

Displays the details of a person that might not be shown in their card.

Format: `view INDEX`

* Views the details of the person at the specified `INDEX`.
* The index refers to the index number shown in the displayed person list.
* The index **must be a positive integer** 1, 2, 3, …​

Examples:
* `list` followed by `view 3` displays the details of the 3rd person in the address book.
* `find Lisa` followed by `view 1` displays the details of the 1st person in the results of the `find` command.

### Undoing a command : `undo`

Reverses the most recent command executed.

Format: `undo`

* You can only undo commands executed during the current session.

Examples:
* If you accidentally deleted a person, `undo` will add that person back.

### Redoing a command : `redo`

Reapplies a command that was previously undone.

Format: `redo`

* Redo is only available immediately after an undo.

Examples:
* If you `undo` the addition of a new tutor by mistake, `redo` will restore that entry.

### Viewing command history : `history`

Provides a list of commands executed, from the most recent to the earliest.

Format: `history`

* History displays only commands executed during the current session.

### Clearing all entries : `clear`

Clears all entries from the address book.
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/seedu/address/logic/LogicManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.address.logic;

import java.io.IOException;
import java.nio.file.AccessDeniedException;
import java.nio.file.Path;
import java.util.logging.Logger;

Expand Down Expand Up @@ -66,8 +67,10 @@ public CommandResult execute(String commandText) throws CommandException, ParseE
logger.info("Address book modified, saving to file.");
try {
storage.saveAddressBook(model.getAddressBook());
} catch (AccessDeniedException ade) {
throw new CommandException(FILE_OPS_PERMISSION_ERROR_FORMAT, ade);
} catch (IOException ioe) {
throw new CommandException(FILE_OPS_ERROR_MESSAGE + ioe, ioe);
throw new CommandException(FILE_OPS_ERROR_FORMAT, ioe);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
import seedu.address.logic.Messages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.person.Person;
import seedu.address.model.person.Tutee;

/**
* Adds a person to the address book.
*/
public class AddCommand extends Command {
public class AddTuteeCommand extends Command {

public static final String COMMAND_WORD = "add";
public static final String COMMAND_WORD = "addTutee";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a tutee to the address book. "
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_PHONE + "PHONE "
Expand All @@ -36,17 +36,17 @@ public class AddCommand extends Command {
+ PREFIX_HOURS + "6 ";


public static final String MESSAGE_SUCCESS = "New person added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book";
public static final String MESSAGE_SUCCESS = "New tutee added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This tutee already exists in the address book";

private final Person toAdd;
private final Tutee toAdd;

/**
* Creates an AddCommand to add the specified {@code Person}
*/
public AddCommand(Person person) {
requireNonNull(person);
toAdd = person;
public AddTuteeCommand(Tutee tutee) {
requireNonNull(tutee);
toAdd = tutee;
}

@Override
Expand All @@ -69,18 +69,18 @@ public boolean equals(Object other) {
}

// instanceof handles nulls
if (!(other instanceof AddCommand)) {
if (!(other instanceof AddTuteeCommand)) {
return false;
}

AddCommand otherAddCommand = (AddCommand) other;
AddTuteeCommand otherAddCommand = (AddTuteeCommand) other;
return toAdd.equals(otherAddCommand.toAdd);
}

@Override
public String toString() {
return new ToStringBuilder(this)
.add("toAdd", toAdd)
.add("toAddTutee", toAdd)
.toString();
}
}
Loading

0 comments on commit d448c71

Please sign in to comment.