fix: validate dossier scope and accurate directory MFA status
This commit is contained in:
@@ -53,10 +53,10 @@ final class InvestmentConsumerScope
|
||||
public function context(array $context, ?string $key): array
|
||||
{
|
||||
$choices = $context['opportunity_choices'] ?? [];
|
||||
$key = $this->key($context, $key);
|
||||
if (! $choices) {
|
||||
return $context;
|
||||
}
|
||||
$key = $key ?: (count($choices) === 1 ? $choices[0]['opportunity']['key'] : null);
|
||||
$choice = $key ? collect(StructuredData::collectionItems($choices))->firstWhere('opportunity.key', $key) : null;
|
||||
abort_if($key && ! $choice, 422, 'Escolha uma oportunidade deste dossier.');
|
||||
$specific = ['project_summary', 'sector_id', 'sector', 'province_id', 'district_id', 'admin_post_id', 'locality_id', 'province', 'district', 'location', 'special_zone_id', 'investment_regime'];
|
||||
|
||||
Reference in New Issue
Block a user