Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
solomonng2001 committed Apr 14, 2024
2 parents 93c4314 + e56eb16 commit 4a449ac
Show file tree
Hide file tree
Showing 8 changed files with 651 additions and 150 deletions.
507 changes: 357 additions & 150 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions docs/diagrams/AddPersonObjectDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml
!include style.puml
skinparam objectFontColor white

object "<u>:AddCommand</u>" as AddCommand LOGIC_COLOR
object "<u>:AddCommandParser</u>" as AddCommandParser LOGIC_COLOR
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR
object "<u>:Model</u>" as Model MODEL_COLOR
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR
object "<u>toAdd:Person</u>" as Person LOGIC_COLOR
object "<u>:ArgumentMultimap</u>" as ArgumentMultimap LOGIC_COLOR
object "<u>:ParserUtil</u>" as ParserUtil LOGIC_COLOR

AddressBookParser --> AddCommandParser : calls
AddressBookParser --> AddCommand
AddCommandParser -> AddCommand
AddCommandParser --> ArgumentMultimap : instantiates
ParserUtil --> ArgumentMultimap : parses
AddCommand --> Person
AddCommand --> Model
AddCommand -right-> CommandResult : outputs
Model -right-> Person : adds
Model --> Person : set client to display as
@enduml
60 changes: 60 additions & 0 deletions docs/diagrams/AddPersonSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@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 "a:AddCommand" as AddCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box
[-> LogicManager : execute(...)
activate LogicManager

LogicManager -> AddressBookParser : parseCommand(...)
activate AddressBookParser

create AddCommand
AddressBookParser -> AddCommand : AddCommand(...)
activate AddCommand

AddCommand --> AddressBookParser
deactivate AddCommand

AddressBookParser --> LogicManager : a
deactivate AddressBookParser

LogicManager -> AddCommand : execute()
activate AddCommand

AddCommand -> Model : addPerson(toAdd)
activate Model

Model --> AddCommand
deactivate Model

AddCommand -> Model : setDisplayClient(toAdd)
activate Model

Model --> AddCommand
deactivate Model

create CommandResult
AddCommand --> CommandResult
activate CommandResult

CommandResult --> AddCommand
deactivate CommandResult

AddCommand --> LogicManager : result
deactivate AddCommand
AddCommand -[hidden]-> LogicManager : result
destroy AddCommand

[<--LogicManager
deactivate LogicManager
@enduml
27 changes: 27 additions & 0 deletions docs/diagrams/AddPolicyActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@startuml
'https://plantuml.com/activity-diagram-beta

start
:User enters AddPolicyCommand with a specified index and parameters;
:AddressBookParser parses the command;
:AddPolicyCommandParser parses the arguments provided;
if () then ([command is valid])
:New AddPolicyCommand instance is created;
:Policy object is created with the specified parameters;
if () then ([PolicyID already exists])
:AddPolicyCommand throws exception;
else ([PolicyID does not exist])
:Policy object is added to client specified by the index;
:The existing client in the client list is replaced with the updated client;
endif
else ([command is invalid])
:Parser throws exception;
endif
if () then ([no error thrown])
:Display updated PolicyList;
else ([error thrown])
:Display error message;
endif
stop

@enduml
26 changes: 26 additions & 0 deletions docs/diagrams/DeletePolicyObjectDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@startuml
!include style.puml
skinparam objectFontColor white

object "<u>:DeletePolicyCommand</u>" as DeletePolicyCommand LOGIC_COLOR
object "<u>:DeletePolicyCommandParser</u>" as DeletePolicyCommandParser LOGIC_COLOR
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR
object "<u>:Model</u>" as Model MODEL_COLOR
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR
object "<u>policyDeletedPerson:Person" as Person1 LOGIC_COLOR
object "<u>personToDeletePolicy:Person" as Person2 LOGIC_COLOR
object "<u>:ArgumentMultimap" as ArgumentMultimap LOGIC_COLOR
object "<u>:ParserUtil" as ParserUtil LOGIC_COLOR

AddressBookParser --> DeletePolicyCommandParser : calls
AddressBookParser --> DeletePolicyCommand
DeletePolicyCommandParser -> DeletePolicyCommand
DeletePolicyCommandParser --> ArgumentMultimap : instantiates
ParserUtil --> ArgumentMultimap : parses
DeletePolicyCommand --> Person1
DeletePolicyCommand --> Person2
DeletePolicyCommand --> Model
DeletePolicyCommand -right-> CommandResult : outputs
Model --> Person2 : Removes
Model --> Person1 : Updates
@enduml
60 changes: 60 additions & 0 deletions docs/diagrams/DeletePolicySequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@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 "d:DeletePolicyCommand" as DeletePolicyCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box
[-> LogicManager : execute("deletepolicy 1 i/1")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("deletepolicy 1 i/1")
activate AddressBookParser

create DeletePolicyCommand
AddressBookParser -> DeletePolicyCommand : DeletePolicyCommand(1, "1")
activate DeletePolicyCommand

DeletePolicyCommand --> AddressBookParser
deactivate DeletePolicyCommand

AddressBookParser --> LogicManager : d
deactivate AddressBookParser

LogicManager -> DeletePolicyCommand : execute()
activate DeletePolicyCommand

DeletePolicyCommand -> Model : setPerson(personToDeletePolicy, policyDeletedPerson)
activate Model

Model --> DeletePolicyCommand
deactivate Model

DeletePolicyCommand -> Model : setDisplayClient(policyDeletedPerson)
activate Model

Model --> DeletePolicyCommand
deactivate Model

create CommandResult
DeletePolicyCommand --> CommandResult
activate CommandResult

CommandResult --> DeletePolicyCommand
deactivate CommandResult

DeletePolicyCommand --> LogicManager : result
deactivate DeletePolicyCommand
DeletePolicyCommand -[hidden]-> LogicManager : result
destroy DeletePolicyCommand

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

object "<u>:SortCommand</u>" as SortCommand LOGIC_COLOR
object "<u>:SortCommandParser</u>" as SortCommandParser LOGIC_COLOR
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR
object "<u>:Model</u>" as Model MODEL_COLOR
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR
object "<u>sortCriteria:SortCriteria</u>" as SortCriteria LOGIC_COLOR
object "<u>sortOrder:SortOrder</u>" as SortOrder LOGIC_COLOR
object "<u>:Comparator<Person></u>" as Comparator LOGIC_COLOR
object "<u>:ArgumentMultimap</u>" as ArgumentMultimap LOGIC_COLOR
object "<u>:ParserUtil</u>" as ParserUtil LOGIC_COLOR

AddressBookParser --> SortCommandParser : calls
AddressBookParser --> SortCommand
SortCommandParser -> SortCommand
SortCommandParser --> ArgumentMultimap : instantiates
ParserUtil --> ArgumentMultimap : parses
SortCommand --> Model
SortCommand ---> SortCriteria : contains
SortCommand ---> SortOrder : contains
SortCommand --> Comparator : creates
SortCommand -right-> CommandResult : outputs
Comparator --> SortCriteria : uses
Comparator --> SortOrder : uses
Model --> Comparator : updates comparator to sort persons
@enduml
68 changes: 68 additions & 0 deletions docs/diagrams/SortPersonsSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@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 "a:AddCommand" as AddCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "<<class>>\nPersonComparator" as PersonComparator MODEL_COLOR
end box

[-> LogicManager : execute(...)
activate LogicManager

LogicManager -> AddressBookParser : parseCommand(...)
activate AddressBookParser

create AddCommand
AddressBookParser -> AddCommand : AddCommand(...)
activate AddCommand

AddCommand --> AddressBookParser
deactivate AddCommand

AddressBookParser --> LogicManager : a
deactivate AddressBookParser

LogicManager -> AddCommand : execute()
activate AddCommand

AddCommand -> PersonComparator : getComparator(sortCriteria, sortOrder)
activate PersonComparator

PersonComparator --> AddCommand : comparator
deactivate PersonComparator

AddCommand -> Model : updateSortPersonComparator(comparator)
activate Model

Model --> AddCommand
deactivate Model

AddCommand -> Model : setDisplayClientAsFirstInSortedFilteredPersonList()
activate Model

Model --> AddCommand
deactivate Model

create CommandResult
AddCommand --> CommandResult
activate CommandResult

CommandResult --> AddCommand
deactivate CommandResult

AddCommand --> LogicManager : result
deactivate AddCommand
AddCommand -[hidden]-> LogicManager : result
destroy AddCommand

[<--LogicManager
deactivate LogicManager
@enduml

0 comments on commit 4a449ac

Please sign in to comment.