[License Compliance Widget Extension] - Backend - Add approval required field to Licenses API endpoint

Description

Add field to indicate if approval is required. We should build on the summary endpoint that will be added in #350333 (closed)

Current iteration of License MR widget extension

Screen_Shot_2022-03-16_at_12.01.40_AM

Why we need this field

So the UI can know when to indicate approval_required

license_compliance_v13_0

Implementation plan

  1. Enhance LicenseCompliance::CollapsedComparerEntity and LicenseCompliance::ComparerEntity with approval_required field.
  2. This field should get information from merge_request.has_denied_policies?. We need to propagate this value to the serializer
  3. Update tests.
Edited by -