Submit notification

Story

As App user (Notifier)
I want be able to submit my notification
so that it can be delivered to my insurance company / lease company / fleet manager

Acceptance Criteria

  • An incident can only be submitted after it has been signed by the notifier
  • In order to sign an incident, a confirmation code can be required:
    • for a double sided notification on a single device: only the counterpart needs a confirmation code. This can be requested by GET/v2/incidents/{incidentUuid}/signcode The platform sends an sms with a brief summary of the notification and a confirmation code to the device of the counterpart. This code has to be added to the signing request.
    • for a double sided notification on 2 devices: both parties have to enter a confirmation code. This can be requested by PUT /v2/incidents/{incidentUuid}/confirmationcode
      This sends a confirmationcode by sms that has to be added to the signing request of the own incident. For this situation there is a mechanism that checks that the notification of the counterpart has not changed in the meantime. See below at hashcodes.
  • To sign the incident there is te service PUT /v2/incidents/{incidentUuid}/status/
    This an only be done when the incident is valid
  • To check whether the counterpart has signed his notification, there is a polling mechanism which uses te service: GET /v2/incidents/{incidentUuid}

Sequence Diagram

hashcodes

When there are 2 parties that submit a notification on there own devices, you have to make sure that both submit the same version of the incident. This can be garantueed by the following mechanisms: * show the summary of both incident notifications before the signing of it. * Assure that the counterpart does not alter his part of the notification after this summary is show, or even signed. To detect this, there is a hashcode, that is calculated on the notification's content. Each time one of the notifiers updates his answers, this hashcode is being calculated. This hashcode is also returned when the incidents are retrieved from the platform:
GET /v2/incidents/{incidentUuid}

{"link":{"7e3d2f28-beab-423d-bcfc-1e4f0e3ddb21":
        { "status":"VALID",   
            "questionsName":"landbouwvoertuig",             
            "answersHashCode":"df90b9a9a97dbcf2b33c6830f6adb58d9e09c1c0539d8bc8ccd4ea19e7b747eb",  
            "uuid":"7e3d2f28-beab-423d-bcfc-1e4f0e3ddb21"}},   
 "status":"VALID",   
 "questionsName":"auto",   
 "answersHashCode":"3e94a059ccf2ca613e5bd4538a372e095aa694272e2a3c92164981d75a41693d",   
 "uuid":"d49d938a-a37a-445b-8379-77e595e54ddd"
}

In the signing request of double-sided notifications, the app must submit the hashcode of the counterpart: PUT /v2/incidents/{incidentUuid}/confirmationcode

{   "status":"SIGNED",
    "code":"6621",
    "hashCode":"df90b9a9a97dbcf2b33c6830f6adb58d9e09c1c0539d8bc8ccd4ea19e7b747eb"
}

The platform checks whether this hashcode is equal to the hashcode it has calculated for that notification