feat: add workforce evidence and sourced economic context map layers
This commit is contained in:
@@ -538,11 +538,12 @@ class InvestmentCatalogue
|
||||
}
|
||||
$public = app(ProactiveInvestment::class)->publicData($record);
|
||||
$evidence = array_values(array_filter(StructuredData::collectionItems($public['evidence'] ?? []),
|
||||
fn ($proof) => in_array($proof['category'] ?? null, ['resource', 'infrastructure'], true) && ($proof['purpose'] ?? null) === 'local'));
|
||||
fn ($proof) => in_array($proof['category'] ?? null, ['resource', 'infrastructure', 'workforce', 'activity', 'supply', 'demand'], true) && ($proof['purpose'] ?? null) === 'local'));
|
||||
if ($evidence !== []) {
|
||||
$thematic[] = ['id' => $record->id, 'title' => $record->title, 'url' => $properties['url'], 'location' => $properties['location'],
|
||||
'state' => $public['state'] ?? 'hypothesis', 'limitations' => $public['limitations'] ?? null,
|
||||
'evidence' => array_map(fn ($proof) => array_intersect_key($proof, array_flip(['id', 'category', 'statement', 'source', 'locator', 'period', 'scope', 'coverage', 'verified_on'])), $evidence)];
|
||||
'evidence' => array_map(fn ($proof) => [...array_intersect_key($proof, array_flip(['id', 'statement', 'source', 'locator', 'period', 'scope', 'coverage', 'verified_on'])),
|
||||
'source_category' => $proof['category'], 'category' => in_array($proof['category'], ['activity', 'supply', 'demand'], true) ? 'economic_potential' : $proof['category']], $evidence)];
|
||||
}
|
||||
$sites = collect($points->get($record->id) ?? []);
|
||||
if ($sites->isNotEmpty()) {
|
||||
|
||||
@@ -33,7 +33,7 @@ final class ProactiveInvestment
|
||||
'proactive.evidence.*.observation_id' => 'sometimes|nullable|string|size:64',
|
||||
'proactive.supply_comparisons' => 'sometimes|array|max:40',
|
||||
'proactive.evidence.*.id' => 'required|uuid|distinct',
|
||||
'proactive.evidence.*.category' => 'required|in:activity,resource,infrastructure,supply,demand',
|
||||
'proactive.evidence.*.category' => 'required|in:activity,resource,infrastructure,supply,demand,workforce',
|
||||
'proactive.evidence.*.purpose' => 'required|in:local,methodology',
|
||||
'proactive.evidence.*.access' => 'required|in:internal,public',
|
||||
'proactive.evidence.*.document_id' => 'nullable|uuid',
|
||||
|
||||
Reference in New Issue
Block a user