Skip to content

Commit

Permalink
Merge upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanleekk committed Oct 26, 2023
2 parents e210189 + 0565aa0 commit ffa2dbb
Show file tree
Hide file tree
Showing 25 changed files with 152 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It is based on the AddressBook-Level3 project created by the [SE-EDU initiative]

> An applicant management program for Hiring Managers to track applicants throughout the hiring process.
![Ui](docs/images/Ui.png)
![Ui](docs/images/readme/Ui.png)

Staff-Snap is a desktop app for HR Managers to track staff information, optimized for use via a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, Staff-Snap can get your staff information management tasks done faster than traditional GUI apps.

Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ shadowJar {
archiveFileName = 'staffsnap.jar'
}

run {
enableAssertions = true
}

defaultTasks 'clean', 'test'
10 changes: 5 additions & 5 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can reach us at the email `craigton.lian[at]gmail.com`

### Craigton Lian Ee John

<img src="images/craigtonlian.png" width="200px" height = "200px" style = "border-radius: 50%;">
<img src="images/developer-profiles/craigtonlian.png" width="200px" height = "200px" style = "border-radius: 50%;">


* Links:
Expand All @@ -28,7 +28,7 @@ You can reach us at the email `craigton.lian[at]gmail.com`

### Austin Huang De Yu

<img src="images/austinhuang1203.png" width="200px" height = "200px" style = "border-radius: 50%;">
<img src="images/developer-profiles/austinhuang1203.png" width="200px" height = "200px" style = "border-radius: 50%;">

* Links:
[[github](http://github.com/austinhuang1203)]
Expand All @@ -39,7 +39,7 @@ You can reach us at the email `craigton.lian[at]gmail.com`

### Ivan Lee Kai Kiat

<img src="images/ivanleekk.png" width="200px" height = "200px" style = "border-radius: 50%;">
<img src="images/developer-profiles/ivanleekk.png" width="200px" height = "200px" style = "border-radius: 50%;">


* Links:
Expand All @@ -52,7 +52,7 @@ You can reach us at the email `craigton.lian[at]gmail.com`

### Celestine Tan Yen Tong

<img src="images/celestinetan03.png" width="200px" height = "200px" style = "border-radius: 50%;">
<img src="images/developer-profiles/celestinetan03.png" width="200px" height = "200px" style = "border-radius: 50%;">


* Links:
Expand All @@ -66,7 +66,7 @@ You can reach us at the email `craigton.lian[at]gmail.com`

### Wang Jingting

<img src="images/jingting1412.png" width="200px" height = "200px" style = "border-radius: 50%;">
<img src="images/developer-profiles/jingting1412.png" width="200px" height = "200px" style = "border-radius: 50%;">


* Links:
Expand Down
66 changes: 62 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,59 @@ _{Explain here how the data archiving feature will be implemented}_
update.
3. The state of the parser, rather than the app is used to reduce the chances of accidental clears.

### Sort feature

#### Implementation

The sort feature is facilitated by `Descriptor`, an enumeration which describes the valid fields which can be used to
sort an applicant.

To enable sorting, `Applicant` implements `Comparable<Applicant>`, to allow for comparison between applicants.
To allow for applicants to be sorted by different descriptors, `Applicant` is augmented to contain a static `Descriptor`
field. This is used in `Applicant#compareTo()`, where a switch case checking the state of the `Descriptor` field will
then compare the specified field of both applicants.

In order to enable comparison of each valid field, these fields will implement the `Comparable` interface. Currently
valid
fields for sorting are

1. Name
2. Phone

#### Steps to trigger

1. User opens the app
2. User enters `sort d/ [valid field]`, where valid field is one of the fields listed above to be sorted by

Once step 2 has been completed, the GUI will update and refresh the applicant list to be sorted by the specified field.

The following diagram summarises what happens when a user executes a Sort command:
<puml src="diagrams/SortCommandActivityDiagram.puml" alt="SortCommandActivityDiagram" />

#### Design considerations

##### Aspect: How to compare applicants

- Alternative 1 (current choice): use Comparable interface
- Pros: Standard method of comparison between objects in Java and implementing it will make it compatible with most
other sorting functions in Java. Easily extensible by adding more cases to the switch statement, to compare by
other fields when it becomes supported.
- Cons: Applicant#compareTo has to return different values depending on which descriptor has been chosen, causing
some bugs when working with other Java functions as the order of Objects compared to each other is not meant to
change during runtime.

##### Aspect: Command syntax

- Alternative 1 (current choice): `sort d/ [valid field]`
- Pros: Simple and minimal text fields, with a single prefix required to enable sorting.
- Cons: Only able to sort in ascending order.
- Alternative 2: `sort d/ [valid field] o/ [a/d]`
- Pros: Able to sort in either ascending or descending order.
- Cons: Requires additional input from the user, slowing down the use of the command.
- Alternative 3: `sort d/ [valid field] o/ [a/d]` where `o/` is optional
- Pros: Retains the ability to sort in either order, but also the conciseness of Alternative 1.
- Cons: Users who are not aware of the `o/` feature may not use it.

### Filter feature

#### Implementation
Expand All @@ -373,6 +426,9 @@ It currently contains the following fields and is able to filter for applicants
2. Phone
3. Email
4. Position
5. Status
6. Less than score
7. Greater than score

When `CustomFilterPredicate#test` is called, it will check if the specified fields are a substring of the same field of
the applicant,
Expand All @@ -381,7 +437,8 @@ returning true if all specified fields match, and false otherwise.
#### Steps to trigger

1. User opens the app
2. User enters `filter [n/, e/, p/, hp/] [term]`, where one or more of the prefixes can be specified to be filtered by
2. User enters `filter [n/, e/, p/, hp/, s/, lts/, gts/] [term]`, where one or more of the prefixes can be specified to
be filtered by

Once step 2 is complete, the GUI will update and refresh the applicant list with only applicants which match all
specified fields.
Expand All @@ -408,13 +465,14 @@ The following diagram summarises what happens when a user executes a Filter comm

#### Aspect: Command syntax

- Alternative 1: `filter n/ [Name] e/ [Email] p/ [Position] hp/ [Phone]`
- Alternative 1: `filter n/ [Name] e/ [Email] p/ [Position] hp/ [Phone] s/ [Status] lts/ [Score] gts/ [Score]`
- Pros: Unambiguous and forces all fields to be entered, preventing errors.
- Cons: Users cannot filter by single fields. Requires more key presses to enter a filter command.
- Alternative 2: `filter [n/, e/, p/, hp/] [term]`, where only one term is allowed
- Alternative 2: `filter [n/, e/, p/, hp/, s/, lts/, gts/] [term]`, where only one term is allowed
- Pros: Quicker to key in command than alternative 1.
- Cons: Only allows users to filter by one field at a time, limiting utility of filter command.
- Alternative 3 (current choice): `filter [n/, e/, p/, hp/] [term]`, where at least one term is required and the others
- Alternative 3 (current choice): `filter [n/, e/, p/, hp/, s/, lts/, gts/] [term]`, where at least one term is required
and the others
are optional
- Pros: Provides flexibility in the filter command to filter by one or more fields, while still retaining the speed
of alternative 2 when few fields are required.
Expand Down
52 changes: 39 additions & 13 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## User Interface Guide

![User Interface Guide Example](./images/userInterfaceGuide.png)
![User Interface Guide Example](images/user-guide/userInterfaceGuide.png)



Expand All @@ -17,7 +17,7 @@

<box type="tip" seamless>

**Notation Guide** :rocket:<br>
**Notation Guide**<br>

* Words in `UPPER_CASE` are the parameters to be supplied by the user.
* Items in square brackets are optional.
Expand All @@ -29,12 +29,12 @@
---
### `help` : Viewing help

Displays a message explaining how to access the help page.
Opens up your browser to view the help page.

Format: `help`

UI mockup:
![Help UI Mockup](./images/help.png)
![Help UI Mockup](images/user-guide/help.png)

---
### `add` : Adding a new applicant
Expand All @@ -48,7 +48,7 @@ Example:
* `add n/Jane Greenwood p/Project Manager e/[email protected] hp/91234567`

UI mockup:
![Add UI Mockup](./images/add.png)
![Add UI Mockup](images/user-guide/add.png)

---
### `edit` : Editing an applicant
Expand All @@ -65,7 +65,7 @@ Example:
* `edit 2 hp/80081234 e/[email protected]` edits the phone number and email of the 2nd applicant in the list.

UI mockup:
![Edit UI Mockup](./images/edit.png)
![Edit UI Mockup](images/user-guide/edit.png)

---
### `list` : Listing all applicants
Expand All @@ -75,7 +75,7 @@ Displays the full list of all applicants.
Format: `list`

UI mockup:
![List UI Mockup](./images/list.png)
![List UI Mockup](images/user-guide/list.png)

---
### `delete` : Deleting an applicant
Expand All @@ -92,7 +92,7 @@ Examples:
* `sort d/name` followed by `delete 3` deletes the 3rd person in the sorted applicant list.

UI mockup:
![Delete UI Mockup](./images/delete.png)
![Delete UI Mockup](images/user-guide/delete.png)

---
### `find` : Finding an applicant by name
Expand All @@ -111,22 +111,26 @@ Examples:
* `find IVAN CHEW` finds any applicant whose name contains “ivan” or contains “chew”.

UI mockup:
![Find UI Mockup](./images/find.png)
![Find UI Mockup](images/user-guide/find.png)

---
### `sort`: Sorting applicants by descriptor

Sorts the applicant list by using a particular descriptor as the sorting criteria.

Format: `sort d/DESCRIPTOR`
* `DESCRIPTOR` must be either `name` or `phone`.
* `DESCRIPTOR` must be either `name` or `phone` or `email` or `position` or `score` or `status`.

Examples:
* `sort d/name` sorts the applicant list by name in alphabetical order.
* `sort d/phone` sorts the applicant list by phone numbers in ascending order.
* `sort d/email` sorts the applicant list by email in alphabetical order.
* `sort d/position` sorts the applicant list by positions in alphabetical order.
* `sort d/score` sorts the applicant list by score in descending order.
* `sort d/status` sorts the applicant list by status in alphabetical order.

UI mockup:
![Sort UI Mockup](./images/sort.png)
![Sort UI Mockup](images/user-guide/sort.png)

---
### `addi` : Adding an interview to an applicant
Expand Down Expand Up @@ -154,6 +158,28 @@ Examples:
* `editi 3 i/2 t/screening` edits the 2nd interview type of the 3rd person in the displayed applicant list to a screening interview.
* `editi 2 i/1 r/8.9` edits the 1st interview rating of the 2nd person in the displayed applicant list to 8.9.

---
### `deletei` : Deleting an interview from an applicant

Deletes an interview from an applicant.

Format: `deletei INDEX i/INTERVIEW_INDEX`

Examples:
* `deletei 1 i/2` deletes the 2nd interview of the 1st person in the displayed applicant list.

---
### `status` : Editing an applicant status

Edits the status of an applicant.

Format: `status INDEX s/STATUS`
* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list.
* `STATUS` must be either `o`(offered) or `r`(rejected) or `u`(undecided).

Examples:
* `status 3 s/o` updates the status of the 3rd person in the displayed applicant list to OFFERED.

---
### `clear` : Clearing all applicant entries

Expand All @@ -162,7 +188,7 @@ Clears all the current data stored in the system.
Format: `clear`

UI mockup:
![Clear UI Mockup](./images/clear.png)
![Clear UI Mockup](images/user-guide/clear.png)

---
### `exit` : Exiting the program
Expand All @@ -180,7 +206,7 @@ Automatically saves the data to a local storage whenever there is a change to th
### Editing the data file

<box type="warning" header="**Caution**">
Editing the data file directly may result in unexpected behaviour.
If the format of the edited data file is invalid, Staff-Snap will override the existing data file with an empty data file in the next run. Please make a backup before you attempt to edit the data file!
</box>

Staff-Snap applicant data are saved automatically as a JSON file `[JAR file location]/data/applicantBook.json`. Advanced users are welcome to update data directly by editing that data file.
Expand Down
22 changes: 22 additions & 0 deletions docs/diagrams/SortCommandActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@startuml
'https://plantuml.com/activity-diagram-beta

start
:User enters sort command syntax;
:ApplicantBookParser parses command_word;
:SortCommandParser parses arguments;
if (Descriptor is present) then (true)
:Execute SortCommand;
:Update Applicant Descriptor;
:Refresh Applicant List;
:Display success message;
:Show updated list in GUI;
stop
else (false)
:Throw ParseException with
invalid command format
message and proper Sort
syntax;
:Display error message;
stop
@enduml
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[![CI Status](https://github.com/AY2324S1-CS2103T-W08-1/tp/actions/workflows/gradle.yml/badge.svg)](https://github.com/AY2324S1-CS2103T-W08-1/tp/actions)
[![codecov](https://codecov.io/gh/AY2324S1-CS2103T-W08-1/tp/graph/badge.svg?token=7PPPGQNQFE)](https://codecov.io/gh/AY2324S1-CS2103T-W08-1/tp)

![Ui](images/Ui.png)
![Ui](images/readme/Ui.png)

**Staff-Snap is a desktop application for managing your employee details.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).
**Staff-Snap is a desktop application for managing your applicant details during your recruitment cycle.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).

* If you are interested in using Staff-Snap, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start).
* If you are interested about developing Staff-Snap, the [**Developer Guide**](DeveloperGuide.html) is a good place to start.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package seedu.staffsnap.logic.commands;

import static seedu.staffsnap.logic.commands.CommandTestUtil.assertCommandSuccess;
//import static seedu.staffsnap.testutil.TypicalApplicants.getTypicalApplicantBook;
import static seedu.staffsnap.testutil.TypicalApplicants.getTypicalApplicantBook;

import org.junit.jupiter.api.Test;

//import seedu.staffsnap.model.ApplicantBook;
import seedu.staffsnap.logic.commands.exceptions.CommandException;
import seedu.staffsnap.model.ApplicantBook;
import seedu.staffsnap.model.Model;
import seedu.staffsnap.model.ModelManager;
//import seedu.staffsnap.model.UserPrefs;
import seedu.staffsnap.model.UserPrefs;

public class ClearCommandTest {
private Command confirmStub = new ConfirmationCommand();


@Test
Expand All @@ -20,16 +22,17 @@ public void execute_emptyApplicantBook_success() {

assertCommandSuccess(new ClearCommand(), model, ClearCommand.MESSAGE_SUCCESS, expectedModel);
}
/*

@Test
public void execute_nonEmptyApplicantBook_success() {
public void execute_nonEmptyApplicantBook_success() throws CommandException {
Model model = new ModelManager(getTypicalApplicantBook(), new UserPrefs());
Model expectedModel = new ModelManager(getTypicalApplicantBook(), new UserPrefs());
expectedModel.setApplicantBook(new ApplicantBook());
confirmStub.execute(model);

assertCommandSuccess(new ClearCommand(), model, ClearCommand.MESSAGE_SUCCESS, expectedModel);
}
*/




Expand Down
Loading

0 comments on commit ffa2dbb

Please sign in to comment.