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

Yutong Hr DG #105

Merged
merged 4 commits into from
Oct 29, 2020
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
Binary file added HrArchitecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 42 additions & 11 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ It implements the following operation:
![](EventDiagram/SequenceDiagram/CommandSearchEvent.png)


**3.4.4: Displaying countdown to upcoming events** `CommandEventCountdown`
**3.4.4. Displaying countdown to upcoming events** `CommandEventCountdown`

Current Implementation
The `CommandEventCountdown` class in `seedu.duke.event` handles displays the countdown as an additional feature in the eventlist.
Expand All @@ -341,7 +341,7 @@ The sequence diagram for displaying countdown is as shown below:

![](EventDiagram/SequenceDiagram/CommandEventCountdown.png)

**3.4.5: Mark an event as completed** `CommandEventStatus`
**3.4.5. Mark an event as completed** `CommandEventStatus`

Current Implementation
The `CommandEventStatus` class in `seedu.duke.event` handles marking of an event. It can manually mark an event as done.
Expand Down Expand Up @@ -382,9 +382,9 @@ The sequence diagram for deleting a particular event or all events is as shown b

![CommandDelEventAttendance](EventDiagram/SequenceDiagram/CommandAddEventAttendance.png)

**3.5.2. Listing Events** `CommandEventList`
**3.4.7. Listing Events** `CommandEventList`

3.5.2.1 Current implementation
3.4.7.1 Current implementation
The `CommandEventList` class in `seedu.duke.event` handles listing all the events in `EventList`.

It implements the following operation:
Expand All @@ -407,7 +407,14 @@ The sequence diagram for listing events is as shown below:
![](EventDiagram/SequenceDiagram/CommandEventList.png)

### 3.5. HR
This section describes some noteworthy details on how features under HR are implemented. <br/>
The diagram below shows the architecture for HR feature.<br/>

![](hrDiagramPic/HrArchitecture.png)

There are a total of 7 commands under HR feature.
`CommandAddMember`, `CommandDelMember`, `CommandViewMember` ,`CommandListConnection`, `CommandSearchMember` , `CommandListProfAdmin` and `CommandChangeMemberInfo`.

The implementation for each command is described in detail below.

**3.5.1. Add/delete member feature**
3.5.1.1. Current Implementation
Expand Down Expand Up @@ -446,8 +453,21 @@ The following shortcut commands can achieve the same result: <br/>
Step 3. The user executes `hr delMember 1` command to delete the member in the member list. The `hr delMember`
command calls `CommandDelMember#execute()`, causing the `Member` of index 1 removed from `MemberList`.

The following shortcut commands can achieve the same result: <br/>
`hr delete 1`<br/>
`hr d 1`<br/>

![](hrDiagramPic/2-1S3.png)

The sequence diagram for adding a member is as shown below:

![CommandAddMember](hrDiagramPic/CommandAddMember.png)

The sequence diagram for deleting a member is as shown below:

![CommandDelMember](hrDiagramPic/CommandDelMember.png)


**3.5.2. List the members**
3.5.2.1. Current Implementation
The `CommandViewMember` class in `seedu.duke.hr` handles listing all the members in `MemberList` and
Expand All @@ -457,15 +477,23 @@ It implements the following operation:

Given below is an example usage scenario and how the program list the information of members.

Step 1. After some `hr addMember` commands, the user created a `MemberList` with two `Member`. The first `Member` is
"John Sterling" with phone number "12345678", email "123@gmail.com", role "member" and the second `Member` is
"Harry Potter", phone number "88888888", email "qaz@gmail.com", role "president".
Step 1. After some `hr addMember` commands, the user created a `MemberList` with two `Member`. <br/>
The first `Member` is "John Sterling" with phone number "12345678", email "123@gmail.com", role "member". <br/>
The second `Member` is "Harry Potter", phone number "88888888", email "qaz@gmail.com", role "president". <br/>

![](hrDiagramPic/2-2S1.png)

Step 2. The user executes `hr listMember` command to list the summary of `MemberList`. The `hr listMember` command calls
`CommandViewMember#execute()`, then every `Member` in `MemberList` and the contacts and roles will be printed out within
the same line, separated by "|". Nothing will be changed in `MemberList`.

The following shortcut commands can achieve the same result: <br/>
`hr list`<br/>
`hr l`<br/>

The sequence diagram for listing the members is as shown below:

![CommandViewMember](hrDiagramPic/CommandViewMember.png)

**3.5.3. Change member information**
3.5.3.1. Current Implementation
Expand All @@ -477,9 +505,9 @@ modified member information.

Given below is an example usage scenario and how the program list the information of members.

Step 1. After some `hr addMember` commands, the user created a `MemberList` with two `Member`. The first `Member` is
"John Sterling" with phone number "12345678", email "123@gmail.com", role "member" and the second `Member` is
"Harry Potter", phone number "88888888", email "qaz@gmail.com", role "president".
Step 1. After some `hr addMember` commands, the user created a `MemberList` with two `Member`. <br/>
The first `Member` is "John Sterling" with phone number "12345678", email "123@gmail.com", role "member". <br/>
The second `Member` is "Harry Potter", phone number "88888888", email "qaz@gmail.com", role "president". <br/>

Step 2. The user executes `hr changeInfo /n john sterling /p 11111111 /r publicity director` command to change the phone
number and role of the member with name "John Sterling" in the list. The `hr changeInfo` command calls
Expand All @@ -490,6 +518,9 @@ sensitive.
The following shortcut commands can achieve the same result: <br/>
`hr c /n john Sterling /p 11111111 /r publicity director`<br/>

The sequence diagram for changing contacts and role information of a member is as shown below:

![CommandChangeMemberInfo](hrDiagramPic/CommandChangeMemberInfo.png)

**3.5.4. Design Considerations**
Aspect: Changing member information
Expand Down
17 changes: 17 additions & 0 deletions docs/hrDiagram/CommandAddMember.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@startuml
-> ":CommandAddMember": execute()


activate ":CommandAddMember"
":CommandAddMember" -> ":MemberList" : addToList()
activate ":MemberList"
":MemberList" -> ":Member": add()
activate ":Member"
return
":MemberList" -> ":Member" : toString()
activate ":Member"
return
return output
return output
deactivate ":CommandAddMember"
@enduml
21 changes: 21 additions & 0 deletions docs/hrDiagram/CommandChangeMemberInfo.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@startuml

-> ":CommandChangeMemberInfo": execute()
activate ":CommandChangeMemberInfo"
activate ":MemberList"
activate ":MemberList" #DarkSalmon
":CommandChangeMemberInfo" -> ":MemberList" : findMemberByName()
activate ":MemberList"
":MemberList" --> ":CommandChangeMemberInfo" : m=findMemberByName()
deactivate ":MemberList"
opt m == null
end
":CommandChangeMemberInfo" -> ":MemberList" : changeMemberInfo()
activate ":MemberList"
":MemberList" -> ":Member" : toString()
activate ":Member"
return
return output
return output

@enduml
18 changes: 18 additions & 0 deletions docs/hrDiagram/CommandDelMember.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@startuml

-> ":CommandDelMember": execute()
activate ":CommandDelMember"
activate ":MemberList"
activate ":MemberList" #DarkSalmon
":CommandDelMember" -> ":MemberList" : deleteFromList()
activate ":MemberList"
":MemberList" -> ":Member" : toString()
activate ":Member"
return
":MemberList" -> ":Member": remove()
activate ":Member"
return output
return output
return output

@enduml
24 changes: 24 additions & 0 deletions docs/hrDiagram/CommandViewMember.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml
-> ":CommandViewMember" : execute()

activate ":CommandViewMember"

":CommandViewMember" -> ":MemberList":listMembers()
activate ":MemberList" #DarkSalmon
alt Member.numOfMembers == 0
":MemberList" --> ":CommandViewMember"
else else
loop until end of ArrayList
":MemberList" -> ":Member" : toString()
activate ":Member"
":Member" --> ":MemberList"
deactivate ":Member"
":MemberList" --> ":CommandViewMember" : output
deactivate ":MemberList"
return output
end
deactivate ":MemberList"
deactivate ":MemberList"
deactivate ":CommandViewMember"
end
@enduml
46 changes: 46 additions & 0 deletions docs/hrDiagram/HrArchitecture.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@startuml
class "{abstract} \n Command"
class CommandAddMember {
}
class CommandDelMember {
}
class CommandViewMember {
}
class MemberList {
}
class Member {
}

Rectangle HrCommands {
"{abstract} \n Command" <|--CommandDelMember
"{abstract} \n Command" <|--CommandAddMember
"{abstract} \n Command" <|--CommandViewMember
"{abstract} \n Command" <|-- CommandSearchMember
"{abstract} \n Command" <|-- CommandListProfAdmin
"{abstract} \n Command" <|-- CommandListConnection
"{abstract} \n Command" <|-- CommandChangeMemberInfo
}
MemberList <-left-Member
Member <--MemberList
MemberList <--CommandAddMember
CommandAddMember <-- MemberList
MemberList <-- CommandDelMember
CommandDelMember <-- MemberList
MemberList <--CommandViewMember
CommandViewMember <-- MemberList
MemberList <--CommandSearchMember
CommandSearchMember <-- MemberList
MemberList <-- CommandListProfAdmin
CommandListProfAdmin <-- MemberList
MemberList <--CommandListConnection
CommandListConnection <-- MemberList
MemberList <--CommandChangeMemberInfo
CommandChangeMemberInfo <-- MemberList
class Ui
class FileMananger
MemberList <-- FileMananger
"{abstract} \n Command" <-- Ui
class Duke
Ui <-- Duke

@enduml
Binary file added docs/hrDiagramPic/CommandAddMember.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/hrDiagramPic/CommandChangeMemberInfo.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/hrDiagramPic/CommandDelMember.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/hrDiagramPic/CommandViewMember.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/hrDiagramPic/HrArchitecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.