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

Dg addvisit #252

Merged
merged 11 commits into from
Apr 15, 2024
205 changes: 149 additions & 56 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

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

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ImmuniMateParser" as ImmuniMateParser LOGIC_COLOR
participant ":AddVisitCommandParser" as AddVisitCommandParser LOGIC_COLOR
participant "c:AddVisitCommand" as AddVisitCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
participant "v:Visit" as Visit MODEL_COLOR
end box

[-> LogicManager : execute("addvisit ...")
activate LogicManager
LogicManager -> ImmuniMateParser : parseCommand("addvisit ...")
activate ImmuniMateParser

create AddVisitCommandParser
ImmuniMateParser -> AddVisitCommandParser
activate AddVisitCommandParser
AddVisitCommandParser --> ImmuniMateParser
deactivate AddVisitCommandParser
ImmuniMateParser -> AddVisitCommandParser : parse("...")
activate AddVisitCommandParser

create Visit
AddVisitCommandParser -> Visit
activate Visit
Visit --> AddVisitCommandParser
deactivate Visit

create AddVisitCommand
AddVisitCommandParser -> AddVisitCommand
activate AddVisitCommand
AddVisitCommand --> AddVisitCommandParser
deactivate AddVisitCommand

AddVisitCommandParser --> ImmuniMateParser : c
deactivate AddVisitCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddVisitCommandParser -[hidden]-> ImmuniMateParser
destroy AddVisitCommandParser
ImmuniMateParser --> LogicManager : c
deactivate ImmuniMateParser

LogicManager -> AddVisitCommand : execute()
activate AddVisitCommand
AddVisitCommand -> Visit : getNric()
activate Visit
Visit --> AddVisitCommand : nric
deactivate Visit
AddVisitCommand -> Model : hasPerson(...)
activate Model
Model --> AddVisitCommand : false
deactivate Model
AddVisitCommand -> Model : hasVisit(...)
activate Model
Model --> AddVisitCommand : false
deactivate Model
AddVisitCommand -> Model : addVisit(v)
activate Model
Model --> AddVisitCommand : add visit in the model
deactivate Model

create CommandResult
AddVisitCommand -> CommandResult
activate CommandResult
CommandResult --> AddVisitCommand
deactivate
AddVisitCommand --> LogicManager : r
deactivate AddVisitCommand

[<--LogicManager : r
deactivate LogicManager
@enduml
119 changes: 119 additions & 0 deletions docs/diagrams/AddVisitCommandModel.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain
box Logic LOGIC_COLOR_T1
participant "l:Logic" as Logic LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as ModelManager MODEL_COLOR
participant ":ImmuniMate" as ImmuniMate MODEL_COLOR
participant ":UniqueVisitList" as UniqueVisitList MODEL_COLOR
participant "internalList: ObservableList<Visit>" as internalList MODEL_COLOR
participant "p:Person" as p MODEL_COLOR
participant "v:Visit" as Visit MODEL_COLOR
end box

[-> Logic : execute()
activate Logic

create p
Logic -> p
activate p
p --> Logic
deactivate p

create Visit
Logic -> Visit
activate Visit
Visit --> Logic
deactivate Visit

Logic -> ModelManager : hasPerson(p)
activate ModelManager

ModelManager -> ImmuniMate: hasPerson(p)
activate ImmuniMate

ImmuniMate -> UniqueVisitList : contains(p)
activate UniqueVisitList

UniqueVisitList -> internalList : stream().anyMatch(p::isSamePerson)
activate internalList

internalList -> p : isSamePerson()
activate p

p --> internalList
deactivate p

internalList --> UniqueVisitList
deactivate internalList

UniqueVisitList --> ImmuniMate
deactivate UniqueVisitList

ImmuniMate --> ModelManager
deactivate ImmuniMate

ModelManager --> Logic
deactivate ModelManager

Logic -> ModelManager : hasVisit(v)
activate ModelManager

ModelManager -> ImmuniMate: hasVisit(v)
activate ImmuniMate

ImmuniMate -> UniqueVisitList : contains(v)
activate UniqueVisitList

UniqueVisitList -> internalList : stream().anyMatch(v::isSameVisit)
activate internalList

internalList -> Visit : isSameVisit()
activate Visit

Visit --> internalList
deactivate Visit

internalList --> UniqueVisitList
deactivate internalList

UniqueVisitList --> ImmuniMate
deactivate UniqueVisitList

ImmuniMate --> ModelManager
deactivate ImmuniMate

ModelManager --> Logic
deactivate ModelManager

Logic -> ModelManager : addVisit(v)
activate ModelManager

ModelManager -> ImmuniMate: addVisit(v)
activate ImmuniMate

ImmuniMate -> UniqueVisitList : add(v)
activate UniqueVisitList

UniqueVisitList -> internalList : add(v)
activate internalList

internalList --> UniqueVisitList
deactivate internalList

UniqueVisitList --> ImmuniMate
deactivate UniqueVisitList

ImmuniMate --> ModelManager
deactivate ImmuniMate

ModelManager --> Logic
deactivate ModelManager

[<--Logic
deactivate Logic

@enduml
2 changes: 1 addition & 1 deletion docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Participant ":Storage" as storage STORAGE_COLOR
user -[USER_COLOR]> ui : "delete S1234567X"
activate ui UI_COLOR

ui -[UI_COLOR]> logic : execute("delete X1234567X")
ui -[UI_COLOR]> logic : execute("delete S1234567X")
activate logic LOGIC_COLOR

logic -[LOGIC_COLOR]> model : deletePerson(p)
Expand Down
63 changes: 63 additions & 0 deletions docs/diagrams/ClusterLogicModelDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ImmuniMateParser" as ImmuniMateParser LOGIC_COLOR
participant ":ClusterCommandParser" as ClusterCommandParser LOGIC_COLOR
participant "c:ClusterCommand" as ClusterCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("cluster 50 ...")
activate LogicManager
LogicManager -> ImmuniMateParser : parseCommand("cluster 50 ...")
activate ImmuniMateParser

create ClusterCommandParser
ImmuniMateParser -> ClusterCommandParser
activate ClusterCommandParser
ClusterCommandParser --> ImmuniMateParser
deactivate ClusterCommandParser
ImmuniMateParser -> ClusterCommandParser : parse("50 ...")
activate ClusterCommandParser

create ClusterCommand
ClusterCommandParser -> ClusterCommand
activate ClusterCommand
ClusterCommand --> ClusterCommandParser
deactivate ClusterCommand
ClusterCommandParser --> ImmuniMateParser : c
deactivate ClusterCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
ClusterCommandParser -[hidden]-> ImmuniMateParser
destroy ClusterCommandParser
ImmuniMateParser --> LogicManager : c
deactivate ImmuniMateParser
LogicManager -> ClusterCommand : execute(m)
activate ClusterCommand
ClusterCommand -> Model : updateFilteredPersonList(...)
activate Model
Model --> ClusterCommand
deactivate Model
ClusterCommand -> Model : getFilteredPersonList(...)
activate Model
Model --> ClusterCommand
deactivate Model

create CommandResult
ClusterCommand -> CommandResult
activate CommandResult
CommandResult --> ClusterCommand
deactivate
ClusterCommand --> LogicManager : r
deactivate ClusterCommand

[<--LogicManager : r
deactivate LogicManager
@enduml
16 changes: 11 additions & 5 deletions docs/diagrams/DeleteInfoModelDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ end box
[-> CreateCommand : execute()
activate CreateCommand

CreateCommand -> ModelManager : getFilteredPersonsList()
activate ModelManager

ModelManager --> CreateCommand : persons
deactivate ModelManager

CreateCommand -> ModelManager : hasPerson(...)
activate ModelManager

Expand All @@ -32,19 +38,19 @@ activate internalList
internalList -> p1 : isSamePerson(p1)
activate p1

p1 --> internalList
p1 --> internalList : true
deactivate p1

internalList --> UniquePersonList
internalList --> UniquePersonList : true
deactivate internalList

UniquePersonList --> ImmuniMate
UniquePersonList --> ImmuniMate : true
deactivate UniquePersonList

ImmuniMate --> ModelManager
ImmuniMate --> ModelManager : true
deactivate ImmuniMate

ModelManager --> CreateCommand
ModelManager --> CreateCommand : true
deactivate ModelManager

CreateCommand -> ModelManager : getFilteredPersonList()
Expand Down
9 changes: 8 additions & 1 deletion docs/diagrams/DeleteInfoSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ deactivate ImmuniMateParser
LogicManager -> DeleteInfoCommand : execute(m)
activate DeleteInfoCommand

DeleteInfoCommand -> Model : getFilteredPersonsList()
activate Model

Model --> DeleteInfoCommand : persons
deactivate Model

DeleteInfoCommand -> Model : hasPerson(...)
activate Model
Model --> DeleteInfoCommand : false

Model --> DeleteInfoCommand : true
deactivate Model

DeleteInfoCommand -> Model : getFilteredPersonList().filtered().get(0)
Expand Down
59 changes: 59 additions & 0 deletions docs/diagrams/FindLogicModelDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ImmuniMateParser" as ImmuniMateParser LOGIC_COLOR
participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR
participant "f:FindCommand" as FindCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("find ...")
activate LogicManager
LogicManager -> ImmuniMateParser : parseCommand("find ...")
activate ImmuniMateParser

create FindCommandParser
ImmuniMateParser -> FindCommandParser
activate FindCommandParser
FindCommandParser --> ImmuniMateParser
deactivate FindCommandParser
ImmuniMateParser -> FindCommandParser : parse("...")
activate FindCommandParser

create FindCommand
FindCommandParser -> FindCommand
activate FindCommand
FindCommand --> FindCommandParser
deactivate FindCommand
FindCommandParser --> ImmuniMateParser : f
deactivate FindCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
FindCommandParser -[hidden]-> ImmuniMateParser
destroy FindCommandParser
ImmuniMateParser --> LogicManager : f
deactivate ImmuniMateParser
LogicManager -> FindCommand : execute(m)
activate FindCommand
FindCommand -> Model : updateFilteredPersonList(...)
activate Model
Model --> FindCommand
deactivate Model

create CommandResult
FindCommand -> CommandResult
activate CommandResult
CommandResult --> FindCommand
deactivate
FindCommand --> LogicManager : r
deactivate FindCommand

[<--LogicManager : r
deactivate LogicManager
@enduml
Loading
Loading