feat: adapt investment territories to Tempo corridor configuration
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-23 13:24:58 +02:00
parent a0e80db4ec
commit 0025309b98
15 changed files with 461 additions and 42 deletions
@@ -51,7 +51,7 @@ final class InvestmentOpportunityChoicesTest extends TestCase
{
$entries = array_slice(app(CorridorAgribusinessOpportunities::class)->entries(), 0, 2);
$records = Opportunity::whereIn('management_creation_key', array_column($entries, 'key'))->orderBy('id')->get();
$sites = DB::table('geo_locations')->where('location_type', 'province')->where('data_classification', 'public')->whereNull('deleted_at')->orderBy('id')->limit(2)->pluck('id');
$sites = collect(app(\App\Services\InvestmentCorridorContext::class)->provinces('pemba-lichinga'))->pluck('id');
$this->get('/investimentos/iniciar?opportunities[]='.$records[0]->id.'&opportunities[]='.$records[1]->id)->assertOk();
$id = $this->dossier();
$before = $this->getJson('/investimentos/'.$id.'/contexto')->assertOk()->json();
@@ -98,7 +98,7 @@ final class InvestmentOpportunityChoicesTest extends TestCase
public function test_documented_location_cannot_change_silently_and_stale_source_cannot_be_confirmed(): void
{
$record = Opportunity::where('management_creation_key', app(CorridorAgribusinessOpportunities::class)->entries()[0]['key'])->firstOrFail();
$sites = DB::table('geo_locations')->where('location_type', 'province')->where('data_classification', 'public')->whereNull('deleted_at')->orderBy('id')->limit(2)->pluck('id');
$sites = collect(app(\App\Services\InvestmentCorridorContext::class)->provinces('pemba-lichinga'))->pluck('id');
$record->primary_territory_id = $sites[0]; $record->save();
$id = $this->dossier(); $version = $this->getJson('/investimentos/'.$id.'/contexto')->json('case.version');
$input = ['version' => $version, 'selection' => [], 'opportunity_choices' => [['source' => 'opportunity:'.$record->id, 'territory' => 'territory:'.$sites[1]]]];