Use `DeclarativeEnum` for Threat Insights related models

Why are we doing this work

Currently, we are storing the enum values for our entities in two different places;

  1. ActiveRecord models
  2. GraphQL enum types

Since we've already implemented the DeclarativeEnum, we can start using it as the single source of the truth for our enum values which then can be used in ActiveRecord models and GraphQL enum types.

We want to refactor our enums by using DeclarativeEnum only for the groupthreat insights related models which can be applied to all models later if we see the benefit.

Relevant links

Implementation plan

  • Create declarative enums for the ones used in following models;
    • ee/app/models/vulnerabilities/external_issue_link.rb - !111998 (merged)
    • ee/app/models/vulnerabilities/feedback.rb
    • ee/app/models/vulnerabilities/finding.rb
    • ee/app/models/vulnerabilities/finding_signature.rb
    • ee/app/models/vulnerabilities/flag.rb
    • ee/app/models/vulnerabilities/historical_statistic.rb
    • ee/app/models/vulnerabilities/issue_link.rb
    • ee/app/models/vulnerabilities/statistic.rb
  • Update the GraphQL enums to use declarative enums for the ones created in the previous task
Edited by Mehmet Emin INAC