Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
chiralcentre committed Apr 13, 2024
2 parents 7ed9ca7 + 6ffcf07 commit 8c90e29
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ Alternative 2: Use job title as argument.
Pros: Job title is usually known beforehand, and job title is the unique primary key for all jobs in the list.
Cons: Job title can be quite long and cumbersome for users to type out.

![EditJobSequenceDiagram](images/EditJobSequenceDiagram.png)

### Get Command

Get command allows the recruiters to retrieve the candidate from the list at specified index in the database. If a recruiter types in `get [INDEX]` with valid index, it returns the candidate at that specific index in the list of candidates displayed in the UI. Specifically, get command is implemented via following via following steps:
Expand Down Expand Up @@ -242,6 +244,10 @@ Step 3. `SlotsLeftCommandParser#parse(String)` creates a new `SlotsLeftCommand`

Step 4. `SlotsLeftCommand#execute(Model)` is then called in `LogicManager#execute(String)`, where `ModelManager#getFilteredJobList()` is called. `List#get(int)` is then called, which returns a job object. `Job#getTitle()` is then called to return a String (the title of the job), which is then used as an argument for `ModelManager#countRemainingVacancy(String)`, returning the number of remaining vacancies of the job.

The following sequence diagram shows how a SlotsLeft operation goes through the various components:

![SlotsLeftSequenceDiagram](images/SlotsLeftSequenceDiagram.png)

### Add_app Command

Add_app adds an application containing a job and a person
Expand All @@ -258,11 +264,11 @@ Step 4.`AddApplicationCommand#execute(Model)` is then called in `LogicManager#ex

Tag command adds one or more tags to a person. The person retains all tags it had before.

Step 1. The user launches the application for the first time. The `HireHub` will be initialized with the initial address book state. We assume that there is an existing person in the initial address book state - a person at index 1 with tag `t/tag0`.
Step 1. The user launches the application for the first time. The `HireHub` will be initialized with the initial address book state. We assume that there is an existing person in the initial address book state - a person at index 1 with tag `t/tag0`.

Step 2. The user enters `tag 1 t/tag1 t/tag2` to add tags to the candidate at 1st entry in the list displayed by UI. This calls `MainWindow#execute(String)`, which subsequently calls `LogicManager#execute(String)`, which subsequently calls `AddressBookParser#parseCommand(String)`, which then calls `TagCommandParser#parse(String)`.

Step 3. `TagCommandParser#parse(String)` creates a new `TagCommand` object, which contains the index that a `Person` object should match, and the `Set<Tag>` of tags to add. In this case, it contains the index 1 and a `Set<Tag>` `[t/tag1, t/tag2]`.
Step 3. `TagCommandParser#parse(String)` creates a new `TagCommand` object, which contains the index that a `Person` object should match, and the `Set<Tag>` of tags to add. In this case, it contains the index 1 and a `Set<Tag>` `[t/tag1, t/tag2]`.

Step 4.`TagCommand#execute(Model)` is then called in `LogicManager#execute(String)`, where the matching `Person` is found and the union of tags present and tags to add is calculated. A new person is created using the tag union and the old person's data. Then, the old person is updated in the person list with `ModelManager#setPerson(Person, Person)`, the filtered person list in the model is updated with `ModelManager#updateFilteredPersonList(Predicate<Person>)`, and the applications in the application list are updated to contain the edited person with `ModelManager#replaceApplications(Person, Person)`.

Expand Down
113 changes: 113 additions & 0 deletions docs/diagrams/EditJobSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":EditJobCommandParser" as EditJobCommandParser LOGIC_COLOR
participant "e:EditJobCommand" as EditJobCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as ModelManager MODEL_COLOR
participant ":FilteredList<Job>" as FilteredList MODEL_COLOR
end box

[-> LogicManager : execute("edit_job 2 ti/Data Analyst")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("edit_job 2 ti/Data Analyst")
activate AddressBookParser

create EditJobCommandParser
AddressBookParser -> EditJobCommandParser
activate EditJobCommandParser

EditJobCommandParser --> AddressBookParser
deactivate EditJobCommandParser

AddressBookParser -> EditJobCommandParser : parse("2 ti/Data Analyst")
activate EditJobCommandParser

create EditJobCommand
EditJobCommandParser -> EditJobCommand
activate EditJobCommand

EditJobCommand --> EditJobCommandParser : e
deactivate EditJobCommand

EditJobCommandParser -> EditJobCommand
activate EditJobCommand

EditJobCommand --> EditJobCommandParser : editJobDescriptor
deactivate EditJobCommand

EditJobCommandParser --> AddressBookParser : e, editJobDescriptor
deactivate EditJobCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
EditJobCommandParser -[hidden]-> AddressBookParser
destroy EditJobCommandParser

AddressBookParser --> LogicManager : e, editJobDescriptor
deactivate AddressBookParser

LogicManager -> EditJobCommand : execute(m)
activate EditJobCommand

EditJobCommand -> ModelManager: getFilteredJobList()
activate ModelManager

ModelManager --> EditJobCommand
deactivate ModelManager

EditJobCommand -> FilteredList: get(2)
activate FilteredList

FilteredList --> EditJobCommand: Job
deactivate FilteredList

EditJobCommand -> EditJobCommand : createEditedJob(Job, editJobDescriptor)
activate EditJobCommand

EditJobCommand --> EditJobCommand : editedJob
deactivate EditJobCommand

EditJobCommand -> ModelManager
activate ModelManager

ModelManager -> FilteredList : setJob(Job, editedJob)
activate FilteredList

FilteredList --> ModelManager
deactivate FilteredList

ModelManager --> EditJobCommand
deactivate ModelManager

EditJobCommand -> ModelManager : updateFilteredJobList(x -> true)
activate ModelManager

ModelManager --> EditJobCommand
deactivate ModelManager

EditJobCommand -> ModelManager : replaceApplications(Job, editedJob)
activate ModelManager

ModelManager --> EditJobCommand
deactivate ModelManager

create CommandResult
EditJobCommand -> CommandResult
activate CommandResult

CommandResult --> EditJobCommand
deactivate CommandResult

EditJobCommand --> LogicManager : r
deactivate EditJobCommand

[<--LogicManager
deactivate LogicManager
@enduml
83 changes: 83 additions & 0 deletions docs/diagrams/SlotsLeftSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":SlotsLeftCommandParser" as SlotsLeftCommandParser LOGIC_COLOR
participant "s:SlotsLeftCommand" as SlotsLeftCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as ModelManager MODEL_COLOR
participant ":FilteredList<Job>" as FilteredList MODEL_COLOR
end box

[-> LogicManager : execute("slots_left 2")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("slots_left 2")
activate AddressBookParser

create SlotsLeftCommandParser
AddressBookParser -> SlotsLeftCommandParser
activate SlotsLeftCommandParser

SlotsLeftCommandParser --> AddressBookParser
deactivate SlotsLeftCommandParser

AddressBookParser -> SlotsLeftCommandParser : parse("2")
activate SlotsLeftCommandParser

create SlotsLeftCommand
SlotsLeftCommandParser -> SlotsLeftCommand
activate SlotsLeftCommand

SlotsLeftCommand --> SlotsLeftCommandParser :
deactivate SlotsLeftCommand

SlotsLeftCommandParser --> AddressBookParser : s
deactivate SlotsLeftCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
SlotsLeftCommandParser -[hidden]-> AddressBookParser
destroy SlotsLeftCommandParser

AddressBookParser --> LogicManager : s
deactivate AddressBookParser

LogicManager -> SlotsLeftCommand : execute(m)
activate SlotsLeftCommand

SlotsLeftCommand -> ModelManager : getFilteredJobList()
activate ModelManager

ModelManager -> FilteredList : get(2)
activate FilteredList

FilteredList --> ModelManager : Job
deactivate FilteredList

ModelManager --> SlotsLeftCommand : Job
deactivate ModelManager

SlotsLeftCommand -> ModelManager : countRemainingVacancy(Job)
activate ModelManager

ModelManager --> SlotsLeftCommand : vacancy left
deactivate ModelManager

create CommandResult
SlotsLeftCommand -> CommandResult
activate CommandResult

CommandResult --> SlotsLeftCommand
deactivate CommandResult

SlotsLeftCommand --> LogicManager : r
deactivate SlotsLeftCommand

[<--LogicManager
deactivate LogicManager
@enduml
Binary file added docs/images/EditJobSequenceDiagram.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/SlotsLeftSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8c90e29

Please sign in to comment.