+
-[[homepage](http://www.comp.nus.edu.sg/~damithch)]
-[[github](https://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](https://github.com/zhongfu)]
+[[portfolio](team/zhongfu.md)]
-* Role: Project Advisor
+### Hong Yi En, Ian
-### Jane Doe
+
-
+[[github](http://github.com/ian-from-dover)]
+[[portfolio](team/ian-from-dover.md)]
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+### Wrik Karmakar
-* Role: Team Lead
-* Responsibilities: UI
+
-### Johnny Doe
+[[github](http://github.com/thewrik)] [[portfolio](team/thewrik.md)]
-
+### Elliot Lim Zhi Yong
-[[github](http://github.com/johndoe)] [[portfolio](team/johndoe.md)]
+
-* Role: Developer
-* Responsibilities: Data
+[[github](http://github.com/spyobird)]
+[[portfolio](team/spyobird.md)]
-### Jean Doe
-
+### Elumalai Oviya Dharshini
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+
-* Role: Developer
-* Responsibilities: Dev Ops + Threading
+[[github](http://github.com/ovidharshini)]
+[[portfolio](team/ovidharshini.md)]
-### James Doe
-
-
-
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
-
-* Role: Developer
-* Responsibilities: UI
diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index 46eae8ee565..641bc05e738 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -2,47 +2,61 @@
layout: page
title: Developer Guide
---
+
+## Introduction
+
+PeopleSoft is a desktop app for **calculating the salary for shift-based contractors**, optimized for use via a **Command Line Interface (CLI)**. If you are a **HR manager** and you can type fast, PeopleSoft can get your payroll tasks done **much faster** than traditional GUI apps.
+
+**PeopleSoft helps to:**
+* Simplify the management of data
+* Reduce menial labour
+* Reduce mistakes due to human error in calculation / accidental edits
+* Help employees be assured that their hours and pay are registered correctly in the system
+
+--------------------------------------------------------------------------------------------------------------------
+
* Table of Contents
{:toc}
--------------------------------------------------------------------------------------------------------------------
-## **Acknowledgements**
+## Acknowledgements
+* Project adapted from [addressbook-level3](https://se-education.org/addressbook-level3/DeveloperGuide.html#product-scope)
+* Layout of user stories adapted from [TAB](https://ay2122s1-cs2103t-f13-3.github.io/tp/DeveloperGuide.html#user-stories)
* {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}
--------------------------------------------------------------------------------------------------------------------
-## **Setting up, getting started**
+## Setting up, getting started
Refer to the guide [_Setting up and getting started_](SettingUp.md).
--------------------------------------------------------------------------------------------------------------------
-## **Design**
+## Design
-The ***Architecture Diagram*** given above explains the high-level design of the App.
+*Figure 1. Architecture diagram of the high-level design of PeopleSoft*
Given below is a quick overview of main components and how they interact with each other.
**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,
-* 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.
+**`Main`** has two classes called [`Main`](https://github.com/AY2122S2-CS2103T-T11-4/tp/blob/master/src/main/java/peoplesoft/Main.java) and [`MainApp`](https://github.com/AY2122S2-CS2103T-T11-4/tp/blob/master/src/main/java/peoplesoft/MainApp.java). It is responsible for,
+* At app launch: Initializing the components in the correct sequence, and connecting them up with each other.
+* At shut down: Shutting down the components and invoking cleanup methods where necessary.
[**`Commons`**](#common-classes) represents a collection of classes used by multiple other components.
-The rest of the App consists of four components.
+The rest of the application consists of four components.
* [**`UI`**](#ui-component): The UI of the App.
* [**`Logic`**](#logic-component): The command executor.
@@ -52,108 +66,239 @@ The rest of the App consists of four components.
**How the architecture components interact with each other**
-The *Sequence Diagram* below shows how the components interact with each other for the scenario where the user issues the command `delete 1`.
-
+*Figure 2. Sequence diagram showing component interactions when the user enters the command `persondelete 1`*
+
Each of the four main components (also shown in the diagram above),
-* defines its *API* in an `interface` with the same name as the Component.
-* implements its functionality using a concrete `{Component Name}Manager` class (which follows the corresponding API `interface` mentioned in the previous point.
+* defines its *API* in an `interface` with the same name as the component.
+* implements its functionality using a concrete `{Component Name}Manager` class (which follows the corresponding API `interface` mentioned in the previous point).
For example, the `Logic` component defines its API in the `Logic.java` interface and implements its functionality using the `LogicManager.java` class which follows the `Logic` interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
+*Figure 3. Partial class diagram of the interaction of components*
+
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 the [`Ui.java`](https://github.com/AY2122S2-CS2103T-T11-4/tp/blob/master/src/main/java/peoplesoft/ui/Ui.java) interface.

+*Figure 4. Class diagram of GUI*
-The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `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 consists of a `MainWindow` that is made up of parts e.g.`SideBar`, `CommandBox`, `ResultDisplay`, `OverviewPage`, 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/AY2122S2-CS2103T-T11-4/tp/blob/master/src/main/java/peoplesoft/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/AY2122S2-CS2103T-T11-4/tp/blob/master/src/main/resources/view/MainWindow.fxml)
The `UI` component,
* executes user commands using the `Logic` component.
* listens for changes to `Model` data so that the UI can be updated with the modified data.
* 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 `Person` object residing in the `Model`.
+* depends on some classes in the `Model` component, as it displays the `Person` and `Job` objects residing in the `Model`.
### Logic component
-**API** : [`Logic.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/logic/Logic.java)
+The **API** of this component is specified in the [`Logic.java`](https://github.com/AY2122S2-CS2103T-T11-4/tp/blob/master/src/main/java/peoplesoft/logic/Logic.java) interface.
Here's a (partial) class diagram of the `Logic` component:
+*Figure 5. Partial class diagram of the `Logic` component*
+
How the `Logic` component works:
1. When `Logic` is called upon to execute a command, it uses the `AddressBookParser` class to parse the user command.
-1. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `AddCommand`) which is executed by the `LogicManager`.
-1. The command can communicate with the `Model` when it is executed (e.g. to add a person).
-1. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`.
-
-The Sequence Diagram below illustrates the interactions within the `Logic` component for the `execute("delete 1")` API call.
+2. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `JobAddCommand`) which is executed by the `LogicManager`.
+3. The command can communicate with the `Model` when it is executed (e.g. to add a person).
+4. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`.

-
+*Figure 7. Class diagram of the Parser component, a subcomponent of the Logic component*
+
How the parsing works:
-* When called upon to parse a user command, the `AddressBookParser` class creates an `XYZCommandParser` (`XYZ` is a placeholder for the specific command name e.g., `AddCommandParser`) which uses the other classes shown above to parse the user command and create a `XYZCommand` object (e.g., `AddCommand`) which the `AddressBookParser` returns back as a `Command` object.
-* All `XYZCommandParser` classes (e.g., `AddCommandParser`, `DeleteCommandParser`, ...) inherit from the `Parser` interface so that they can be treated similarly where possible e.g, during testing.
+* When called upon to parse a user command, the `AddressBookParser` class creates an `XYZCommandParser` (`XYZ` is a placeholder for the specific command name e.g., `JobAddCommandParser`) which uses the other classes shown above to parse the user command and create a `XYZCommand` object (e.g., `JobAddCommand`) which the `AddressBookParser` returns back as a `Command` object.
+* All `XYZCommandParser` classes (e.g., `JobAddCommandParser`, `JobDeleteCommandParser`, ...) inherit from the `Parser` interface so that they can be treated similarly where possible e.g, during testing.
### Model component
-**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java)
+The **API** of this component is specified in the [`Model.java`](https://github.com/AY2122S2-CS2103T-T11-4/tp/blob/master/src/main/java/peoplesoft/model/Model.java) interface.
+*Figure 8. Class diagram of the `Model` component*
The `Model` component,
-* stores the address book data i.e., all `Person` objects (which are contained in a `UniquePersonList` object).
+* stores the address book data - i.e. all `Person` objects (which are contained in a `UniquePersonList` object), all `Job` objects (which are contained in a `UniqueJobList` object), and auxiliary classes `Employment`, `PaymentHandler` etc.
+* allows for the automatic serialization and deserialization of `AddressBook` objects (and any component objects, e.g. `Person`, `Email`, etc) to and from JSON.
* stores the currently 'selected' `Person` objects (e.g., results of a search query) as a separate _filtered_ list which is exposed to outsiders as an unmodifiable `ObservableList
+A more detailed model of `Person` and `Job` is given below. Notice the association class `Employment` between `Person` and `Job`.
-
+*Figure 10. Class diagram of the Storage component*
+
The `Storage` component,
-* can save both address book data and user preference data in json format, and read them back into corresponding objects.
+* can save both address book data and user preference data in JSON format, and read them back into corresponding objects.
* inherits from both `AddressBookStorage` and `UserPrefStorage`, which means it can be treated as either one (if only the functionality of only one is needed).
* depends on some classes in the `Model` component (because the `Storage` component's job is to save/retrieve objects that belong to the `Model`)
### Common classes
-Classes used by multiple components are in the `seedu.addressbook.commons` package.
+Classes used by multiple components are in the `peoplesoft.commons` package.
--------------------------------------------------------------------------------------------------------------------
-## **Implementation**
+## Implementation
This section describes some noteworthy details on how certain features are implemented.
+### JSON serialization and deserialization
+
+The serialization and deserialization of model objects (e.g. `AddressBook`, `UniquePersonList`, `Person`, `Job`, `Tag`) is handled by custom serializers and deserializers, implemented as nested class within each model class.
+
+These serializers and deserializers are automatically used by Jackson during serialization and deserialization.
+
+The serializer and deserializer for each class determine how the objects are to be serialized and deserialized, including but not limited to:
+* which fields are to be stored,
+* how each field should be (de)serialized, e.g. by directly converting it to/from a JSON type, or by delegating it to Jackson (which will use the serializer/deserializer for the field type), and
+* how the fields and current object are to be represented as (or parsed from) JSON values, e.g. objects, strings, numbers.
+
+This architecture has some advantages:
+* The serdes implementations are kept together with the related classes; developers adding new model classes will not have to modify files in other packages.
+ * The previous implementation (with `JsonAdaptedPerson` etc.) requires that developers update the `JsonAdapted` classes belonging in the `Storage` component; this may not be immediately evident to developers.
+* Developers adding new model classes can incorporate existing types (that already have corresponding serializers/deserializers) without needing to duplicate the serdes code, unlike with the previous implementation.
+* Developers will also not need to (practically) duplicate classes, e.g. `Job` -> `JsonAdaptedJob` (with the `@JsonCreator` annotation), just so that Jackson has something to serialize from/deserialize to.
+
+However, it also has some drawbacks:
+* It can be rather verbose, since each serializer/deserializer class contains a portion of boilerplate code
+* Developers writing serializers/deserializers will need to have basic knowledge of JSON, e.g. the types that are available, the structure of JSON objects and arrays, etc
+* Some knowledge of Jackson components (e.g. `JsonParser`, `JsonGenerator`, `ObjectNode`) is also required, as developers will need to use them to write values to/read values from the internal Jackson representation of a JSON value/object.
+
+### The `Find` command
+
+The `Find` command is an enhancement of the `Find` feature provided in AB3.
+It is structured using an object of `PersonContainsKeywordPredicate`, adapted from `NameContainsKeywordPredicate`. It
+has the following attributes:
+* `static final String COMMAND_WORD` initialised to `'find'`
+* `static final String MESSAGE_USAGE` initialised to the relevant message.
+* `PersonContainsKeywordPredicate predicate` used to find `Person` objects that match with the given keyword.
+
+Applying this filter to the entire list means that only `Persons` that match **ALL** the keywords would be retained in
+the filtered list.
+
+#### The `PersonContainsKeywordPredicate` class
+
+The **match** itself is defined as follows (within the `PersonContainsKeywordPredicate` class which implements the
+`Predicate` interface):
+If a `Person` contains **ALL** the keywords passed in the query, either in their `name` field or as equivalent to an
+element in their `tags` set of `Tag` objects, then, passed as a parameter to `test()`,
+it is a valid match.
+
+The implementation is achieved through using stream manipulations to iterate through each person object,
+and for any such object, iterating through each keyword passed in the query. The keyword is then checked if it is
+contained within the name or among the tags.
+
+One motivation behind using streams rather than iteration was that streams can be better optimized, given the need or
+bandwith arising later.
+
+### The `JobList` interface and `UniqueJobList` class
+
+The `JobList` is an interface for the list of jobs, that implements the `Iterable` interface and supports minimal list
+operations.
+
+The `UniqueJobList` class implements the `JobList` interface to that enforces uniqueness between its elements and does
+not allow nulls.
+Furthermore, it has the following attributes, to interact with `java.fx` effectively.
+* `ObservableList| Parameter | +Prefix | +Constraints | +
|---|---|---|
| Name | +n/ |
+
+ Contains only alphanumeric characters and spaces. +Should not be empty. + |
+
| Phone number | +p/ |
+
+ Contains only numbers. +Should be at least three digits long. + |
+
e/ |
+
+ Should be of the format
|
+ |
| Address | +a/ |
+
+ Should not be empty. + |
+
| Rate | +r/ |
+
+ Should be a number consisting of only digits Should not be negative. +Should not have more than two decimal places. +Should not be larger than |
+
| Tag | +t/ |
+
+ Contains only alphanumeric characters. +Should not be empty. + |
+
| Duration | +d/ |
+
+ Should be a number consisting of only digits Should be positive. +Should not be larger than Should not be empty. + |
+
| Employee to assign | +i/ |
+
+ Contains only digits Should be a valid index of an employee in the employee list. +Should not be empty. + |
+
| JOB_INDEX | +N.A. | +
+ Contains only digits Should be a valid index of a job in the job list. +Should not be empty. + |
+
| EMPLOYEE_INDEX | +N.A. | +
+ Contains only digits Should be a valid index of an employee in the employee list. +Should not be empty. + |
+
-According to the sequence diagram you saw earlier (and repeated above for reference), the `UI` component yields control to the `Logic` component through a method named `execute`. Searching through the code base for an `execute()` method that belongs to the `Logic` component yields a promising candidate in `seedu.address.logic.Logic`.
+According to the sequence diagram you saw earlier (and repeated above for reference), the `UI` component yields control to the `Logic` component through a method named `execute`. Searching through the code base for an `execute()` method that belongs to the `Logic` component yields a promising candidate in `peoplesoft.logic.Logic`.
@@ -48,7 +48,7 @@ According to the sequence diagram you saw earlier (and repeated above for refere
:bulb: **Intellij Tip:** The ['**Search Everywhere**' feature](https://www.jetbrains.com/help/idea/searching-everywhere.html) can be used here. In particular, the '**Find Symbol**' ('Symbol' here refers to methods, variables, classes etc.) variant of that feature is quite useful here as we are looking for a _method_ named `execute`, not simply the text `execute`.
+ * Returns null if there are no matches
+ *
+ */
+ private Level getLoggingLevel(String loggingLevelString) {
+ return Level.parse(loggingLevelString);
+ }
+
+ @Override
+ public Class