Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Commit

Permalink
Merge pull request #142 from AY1920S1-CS2103-T11-1/atharvjoshi-patch-2
Browse files Browse the repository at this point in the history
Update DeveloperGuide.adoc
  • Loading branch information
atharvjoshi authored Oct 23, 2019
2 parents 34d2811 + 420c44e commit 9b4baff
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ The incident draft creation mechanism is facilitated by the New Command. It crea
// end::incidentdraftcreation[]

// tag::incidentfill[]
=== [Proposed] Incident Filling and Submission feature
==== Proposed Implementation
=== Incident Filling and Submission feature
==== Implementation
The incident filling and submission subroutines are facilitated by the `fill` and `submit` commands respectively. In the IMS, each incident can have one of three statuses - `DRAFT`, `COMPLETE`, and `FINAL`. The `fill` command facilitates a `DRAFT` incident report becoming a `COMPLETE` incident report while the `submit` command facilitates a `COMPLETE` incident report becoming a `FINAL` incident report.

===== Overview of `Fill` and `Submit`
Expand All @@ -333,19 +333,24 @@ In this mode, the command - `fill` or `submit` - actually fills (i.e. changes in
These two commands as well as the two modes they can be used in are summarised in the activity diagrams below:

Fill Command

image::fillCommandActivityDiagram.png[]

Submit Command

image::submitCommandActivityDiagram.png[]

===== No parameter mode (listing incidents)
The `IncidentManagerParser` will return a new `FillCommand` which has its fields `targetIndex`, `callerNumber`, and `description` initialised to null (as they won't be required). The `execute()` method in `FillCommand` checks for these null conditions and simply displays the list of incidents filtered according to whether they are `DRAFT` or not.
TODO - SEQUENCE DIAGRAM FOR FILL COMMAND WITHOUT PARAMETERS

image::fillCommandSequenceDiagramWithParams.png

The `SubmitCommand` functions similarly, this time listing the incidents filtered by whether they are `COMPLETE` or not.
===== Parameter mode (modifying incidents)
The `FillCommandParser` will be invoked to parse the fields `targetIndex`, `callerNumber`, and `description` and return a `FillCommand` containing these non-null fields. The `execute()` method in `FillCommand` will now fetch the specified incident from the list of drafts and call the static `updateReport()` method. The `updateReport()` method creates a new Incident object which has all its required attributes filled. The attributes from the incident to be updated are simply copied into this new Incident object. The fill command then inserts this new Incident into the list of incidents at the same index.
The `SubmitCommand` functions similarly, with one crucial difference. As no Incident fields are to be updated, the specified incident is simply retrieved, marked as `FINAL` using the static `submitReport()` method, and inserted into the list of incidents at the same index again. The `submitReport` method also creates a new Incident object which is a copy of the Incident to be submitted, with the difference being that the newly created Incident is marked `FINAL`.
TODO - SEQUENCE DIAGRAM FOR FILL COMMAND WITH PARAMETERS

image::fillCommandSequenceDiagramWithoutParams.png

==== Design Considerations

Expand Down

0 comments on commit 9b4baff

Please sign in to comment.