@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Services\CountryCatalogue;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\Validator;
|
||||
@@ -62,6 +63,7 @@ class StoreSimulationFormDraftRequest extends FormRequest
|
||||
$rules = [
|
||||
// Anonymous clients must send an empty snapshot; `required` rejects
|
||||
// an empty array before the privacy policy can enforce that shape.
|
||||
'context' => ['nullable', 'uuid'],
|
||||
'personal_snapshot' => ['present', 'array:'.implode(',', $personal)],
|
||||
'economic_snapshot' => ['required', 'array:'.implode(',', $economic)],
|
||||
'economic_snapshot.purpose' => ['required', 'in:simulate_only,own_investment,seek_investor,seek_partner,present_opportunity,request_facilitation'],
|
||||
@@ -169,6 +171,10 @@ class StoreSimulationFormDraftRequest extends FormRequest
|
||||
'contact_province', 'contact_district', 'preferred_channel'] as $field) {
|
||||
$rules['personal_snapshot.'.$field] = ['nullable', 'string', 'max:3000'];
|
||||
}
|
||||
foreach (['tax_residency_country', 'fiscal_residency_country', 'contact_country'] as $field) {
|
||||
$rules['personal_snapshot.'.$field][] = app(CountryCatalogue::class)->legacyCountryRule();
|
||||
}
|
||||
$rules['economic_snapshot.funds_origin_countries.*'][] = app(CountryCatalogue::class)->legacyCountryRule();
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user