Implement updating of `Vulnerability::Reads#dismissal_reason` when a `Vulnerability::StateTransition` is created

In order to make vulnerability values filterable by dismissal_reason, we will need to ensure that this column is automatically filled in on the Vulnerability::Read model every time a new Vulnerability::StateTransition record is created.

We need to update the application code to keep this value up to date as new state transition records are created.

Implementation Plan

  • backend Update the Vulnerabilities::DismissService and any other applicable services to ensure that the Vulnerability::Reads#dismissal_reason is kept up to date.

Verification steps

  1. Go to Secure -> Vulnerability report
  2. Dismiss any Vulnerability with a reason
  3. Check if appropriate Vulnerability::Read record has dismissal_reason populated
Edited by Michał Zając