@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Opportunity;
|
||||
use App\Models\Sector;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class OpportunitySeeder extends Seeder
|
||||
{
|
||||
/** @var array<int, string> */
|
||||
private array $maturityLabels = [
|
||||
1 => 'Ideia identificada',
|
||||
2 => 'Pré-estudo disponível',
|
||||
3 => 'Estudo de viabilidade em curso',
|
||||
4 => 'Projecto estruturado',
|
||||
5 => 'Pronto para investimento',
|
||||
6 => 'Em negociação ou implementação',
|
||||
];
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
$items = [
|
||||
['sector' => 'agronegocio', 'reference' => 'INV-MZ-AGR-001', 'title' => 'Unidade de processamento agrícola em Nampula', 'province' => 'Nampula', 'maturity' => 4, 'amount' => 2500000, 'financing' => 'Capital e parceria técnica', 'impact' => '120 empregos directos e substituição de importações.', 'featured' => true],
|
||||
['sector' => 'energia', 'reference' => 'INV-MZ-ENE-002', 'title' => 'Mini-rede solar para polo produtivo', 'province' => 'Zambézia', 'maturity' => 3, 'amount' => 1200000, 'financing' => 'PPP ou financiamento misto', 'impact' => 'Acesso a energia para 40 unidades produtivas.', 'featured' => true],
|
||||
['sector' => 'turismo', 'reference' => 'INV-MZ-TUR-003', 'title' => 'Eco-lodge costeiro com integração comunitária', 'province' => 'Inhambane', 'maturity' => 2, 'amount' => 1800000, 'financing' => 'Capital privado ou joint venture', 'impact' => 'Emprego local e conservação da faixa costeira.', 'featured' => true],
|
||||
['sector' => 'infraestruturas', 'reference' => 'INV-MZ-INF-004', 'title' => 'Centro logístico provincial', 'province' => 'Sofala', 'maturity' => 4, 'amount' => 8500000, 'financing' => 'Concessão ou PPP', 'impact' => 'Redução de custos logísticos regionais.', 'featured' => false],
|
||||
['sector' => 'economia-azul', 'reference' => 'INV-MZ-BLUE-005', 'title' => 'Processamento de pescado e cadeia fria', 'province' => 'Zambézia', 'maturity' => 2, 'amount' => 900000, 'financing' => 'Capital, crédito ou parceria operacional', 'impact' => 'Redução de perdas pós-captura na pesca artesanal.', 'featured' => false],
|
||||
['sector' => 'mercado-financeiro', 'reference' => 'INV-MZ-FIN-006', 'title' => 'Plataforma de crédito para PME agrícolas', 'province' => 'Maputo Cidade', 'maturity' => 3, 'amount' => 3000000, 'financing' => 'Fundo de investimento ou parceiro financeiro', 'impact' => 'Acesso a financiamento para 300+ pequenas empresas.', 'featured' => false],
|
||||
];
|
||||
|
||||
foreach ($items as $item) {
|
||||
$sector = Sector::where('slug', $item['sector'])->first();
|
||||
if (! $sector) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Opportunity::updateOrCreate(
|
||||
['reference' => $item['reference']],
|
||||
[
|
||||
'sector_id' => $sector->id,
|
||||
'title' => $item['title'],
|
||||
'slug' => Str::slug($item['reference'].'-'.$item['title']),
|
||||
'summary' => $item['impact'],
|
||||
'description' => $item['impact'],
|
||||
'province' => $item['province'],
|
||||
'promoter_name' => 'Promotor em validação',
|
||||
'promoter_type' => 'privado',
|
||||
'maturity_level' => $item['maturity'],
|
||||
'maturity_label' => $this->maturityLabels[$item['maturity']],
|
||||
'estimated_investment_amount' => $item['amount'],
|
||||
'estimated_investment_currency' => 'USD',
|
||||
'financing_modality' => $item['financing'],
|
||||
'expected_impact' => $item['impact'],
|
||||
'status' => 'published',
|
||||
'is_featured' => $item['featured'],
|
||||
'published_at' => now(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user