commit16
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"format": "investmoz-funding-references-v1",
|
||||
"references": {
|
||||
"fdel": {
|
||||
"edition": "fdel-br43-20250305-tete20251020-v1",
|
||||
"provenance": [
|
||||
{ "url": "https://mpd.gov.mz/wp-content/uploads/2025/10/BR_43_I_SERIE_2025.pdf", "sha256": "0ea99c5f894760e3b715e377e87e9715fad9423e322e5753de1b9bb345c64753", "checked_on": "2026-11-02", "reference": "BR I Série n.º 43, 05/03/2025, pp. 157–160; Decreto n.º 4/2025 e Regulamento anexo" },
|
||||
{ "url": "https://cmct.gov.mz/fundo-de-desenvolvimento-economico-local-fdel/", "sha256": "c69c2c3883766aa6a238ae44d8ee3fc99570adca2f3e647e50df59fde2786403", "checked_on": "2026-11-02", "reference": "Aviso municipal FDEL, prazo 20/10/2025" }
|
||||
],
|
||||
"draft": {
|
||||
"title": "Fundo de Desenvolvimento Económico Local — FDEL",
|
||||
"kind": "fund",
|
||||
"summary": "Apoio reembolsável a iniciativas locais. Extracto informativo; consultar as condições completas. Não confirma candidaturas actualmente abertas.",
|
||||
"manager_name": "Gestão distrital/autárquica; tutelas previstas no Decreto",
|
||||
"source_url": "https://mpd.gov.mz/wp-content/uploads/2025/10/BR_43_I_SERIE_2025.pdf",
|
||||
"source_reference": "Decreto 4/2025; BR I/43, 05/03/2025, pp.157–160; Regulamento: arts.2,13,14,18",
|
||||
"source_checked_on": "2026-11-02",
|
||||
"source_published_on": "2025-03-05",
|
||||
"source_status": "identified",
|
||||
"coverage": "national",
|
||||
"coverage_text": "Nacional; cada chamada tem condições próprias.",
|
||||
"territory_ids": [],
|
||||
"sectors_scope": "unknown",
|
||||
"sectors_text": "Áreas do art.13; cadastro sectorial por associar.",
|
||||
"sector_ids": [],
|
||||
"resource_ids": [],
|
||||
"criteria": [
|
||||
{ "code": "nationality-individual", "question": "Tem nacionalidade moçambicana?", "applies_to": "individual", "expected": "yes", "source_reference": "Decreto n.º 4/2025, art. 3", "explanation": "Condição declarada; não substitui a apreciação competente." },
|
||||
{ "code": "economic-viability", "question": "O projecto apresenta elementos de viabilidade económica?", "applies_to": "all", "expected": "yes", "source_reference": "Decreto n.º 4/2025, art. 3; Regulamento, art. 13", "explanation": "A avaliação do projecto cabe às entidades competentes." }
|
||||
],
|
||||
"windows": [
|
||||
{
|
||||
"code": "tete-municipal-2025",
|
||||
"title": "Cidade de Tete — chamada municipal de 2025",
|
||||
"mode": "dated",
|
||||
"end_on": "2025-10-20",
|
||||
"coverage": "unknown",
|
||||
"coverage_text": "Âmbito municipal da Cidade de Tete; referência cartográfica por associar. Não corresponde a toda a província.",
|
||||
"territory_ids": [],
|
||||
"source_url": "https://cmct.gov.mz/fundo-de-desenvolvimento-economico-local-fdel/",
|
||||
"source_reference": "Aviso municipal FDEL, prazo 20/10/2025",
|
||||
"checked_on": "2026-11-02",
|
||||
"application_url": "https://cmct.gov.mz/anexo-5-plano-de-negocio/",
|
||||
"criteria": [
|
||||
{ "code": "tete-nuit", "question": "Dispõe de NUIT?", "applies_to": "all", "expected": "yes", "source_reference": "Aviso municipal, Requisitos", "explanation": "Documentação indicada para esta chamada histórica." },
|
||||
{ "code": "tete-identity", "question": "Dispõe de cópia do BI?", "applies_to": "individual", "expected": "yes", "source_reference": "Aviso municipal, Candidatos individuais", "explanation": "Aplica-se a pessoas singulares nesta chamada." },
|
||||
{ "code": "tete-registration", "question": "A entidade dispõe de comprovativo de registo legal?", "applies_to": "entity", "expected": "yes", "source_reference": "Aviso municipal, Entidades", "explanation": "Aplica-se às entidades indicadas no aviso." },
|
||||
{ "code": "tete-idoneity", "question": "Dispõe de atestado de idoneidade emitido pela sede do bairro?", "applies_to": "individual", "expected": "yes", "source_reference": "Aviso municipal, Candidatos individuais", "explanation": "Documento indicado no aviso." },
|
||||
{ "code": "tete-national-entity", "question": "A entidade é constituída por cidadãos nacionais?", "applies_to": "entity", "expected": "yes", "source_reference": "Aviso municipal, Entidades", "explanation": "Condição específica desta chamada." }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('investment_notifications', function (Blueprint $table) {
|
||||
$table->uuid('submission_id')->nullable()->change();
|
||||
$table->foreignId('opportunity_id')->nullable()->constrained('opportunities')->restrictOnDelete();
|
||||
});
|
||||
DB::statement('ALTER TABLE investment_notifications ADD CONSTRAINT investment_notification_origin CHECK ((submission_id IS NOT NULL)::integer + (opportunity_id IS NOT NULL)::integer = 1)');
|
||||
Schema::create('investment_alert_preferences', function (Blueprint $table) {
|
||||
$table->uuid('id')->unique();
|
||||
$table->foreignId('user_id')->primary()->constrained('users')->restrictOnDelete();
|
||||
$table->unsignedInteger('version');
|
||||
$table->boolean('enabled')->default(false);
|
||||
$table->string('frequency');
|
||||
$table->string('channel')->default('in_app');
|
||||
$table->text('criteria');
|
||||
$table->timestampTz('consented_at')->nullable();
|
||||
$table->timestampTz('next_run_at')->nullable();
|
||||
$table->timestampsTz();
|
||||
$table->index(['enabled', 'next_run_at']);
|
||||
});
|
||||
DB::statement("ALTER TABLE investment_alert_preferences ADD CHECK (frequency IN ('as_available','daily','weekly')), ADD CHECK (channel = 'in_app'), ADD CHECK (NOT enabled OR consented_at IS NOT NULL)");
|
||||
Schema::create('investment_alert_seen', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignId('opportunity_id')->constrained('opportunities')->restrictOnDelete();
|
||||
$table->foreignUuid('notification_id')->nullable()->constrained('investment_notifications')->restrictOnDelete();
|
||||
$table->timestampTz('observed_at')->useCurrent();
|
||||
$table->primary(['user_id', 'opportunity_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::table('investment_alert_preferences')->exists() || DB::table('investment_alert_seen')->exists()
|
||||
|| DB::table('investment_notifications')->whereNotNull('opportunity_id')->exists()) {
|
||||
throw new RuntimeException('Preserve alert preferences and notification history before rollback.');
|
||||
}
|
||||
Schema::drop('investment_alert_seen');
|
||||
Schema::drop('investment_alert_preferences');
|
||||
DB::statement('ALTER TABLE investment_notifications DROP CONSTRAINT investment_notification_origin');
|
||||
Schema::table('investment_notifications', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('opportunity_id');
|
||||
$table->uuid('submission_id')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('investment_alert_preferences', function (Blueprint $table) {
|
||||
$table->jsonb('sources')->default('["opportunities"]');
|
||||
});
|
||||
DB::statement("ALTER TABLE investment_alert_preferences ADD CONSTRAINT investment_alert_sources CHECK (jsonb_typeof(sources)='array' AND jsonb_array_length(sources) BETWEEN 1 AND 2 AND sources <@ '[\"opportunities\",\"tenders\"]'::jsonb)");
|
||||
Schema::table('investment_notifications', function (Blueprint $table) {
|
||||
$table->foreignUuid('tender_version_id')->nullable()->constrained('portal_tender_versions')->restrictOnDelete();
|
||||
});
|
||||
DB::statement('ALTER TABLE investment_notifications DROP CONSTRAINT investment_notification_origin');
|
||||
DB::statement('ALTER TABLE investment_notifications ADD CONSTRAINT investment_notification_origin CHECK ((submission_id IS NOT NULL)::integer + (opportunity_id IS NOT NULL)::integer + (tender_version_id IS NOT NULL)::integer = 1)');
|
||||
Schema::create('investment_tender_alert_seen', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignUuid('tender_version_id')->constrained('portal_tender_versions')->restrictOnDelete();
|
||||
$table->foreignUuid('notification_id')->nullable()->constrained('investment_notifications')->restrictOnDelete();
|
||||
$table->timestampTz('observed_at')->useCurrent();
|
||||
$table->primary(['user_id', 'tender_version_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::table('investment_tender_alert_seen')->exists() || DB::table('investment_notifications')->whereNotNull('tender_version_id')->exists()
|
||||
|| DB::table('investment_alert_preferences')->whereJsonContains('sources', 'tenders')->exists()) {
|
||||
throw new RuntimeException('Preserve tender alert preferences and notification history before rollback.');
|
||||
}
|
||||
Schema::drop('investment_tender_alert_seen');
|
||||
DB::statement('ALTER TABLE investment_notifications DROP CONSTRAINT investment_notification_origin');
|
||||
Schema::table('investment_notifications', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('tender_version_id');
|
||||
});
|
||||
DB::statement('ALTER TABLE investment_notifications ADD CONSTRAINT investment_notification_origin CHECK ((submission_id IS NOT NULL)::integer + (opportunity_id IS NOT NULL)::integer = 1)');
|
||||
DB::statement('ALTER TABLE investment_alert_preferences DROP CONSTRAINT investment_alert_sources');
|
||||
Schema::table('investment_alert_preferences', function (Blueprint $table) {
|
||||
$table->dropColumn('sources');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('funding_programmes', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('code', 80)->unique();
|
||||
$table->unsignedInteger('version')->default(1);
|
||||
$table->jsonb('draft');
|
||||
$table->uuid('published_version_id')->nullable();
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->timestampsTz();
|
||||
});
|
||||
Schema::create('funding_programme_versions', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->foreignUuid('programme_id')->constrained('funding_programmes')->restrictOnDelete();
|
||||
$table->unsignedInteger('version');
|
||||
$table->jsonb('payload');
|
||||
$table->text('reason');
|
||||
$table->foreignId('actor_id')->constrained('users')->restrictOnDelete();
|
||||
$table->timestampTz('published_at')->useCurrent();
|
||||
$table->unique(['programme_id', 'version']);
|
||||
});
|
||||
Schema::create('funding_programme_interests', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignUuid('programme_id')->constrained('funding_programmes')->restrictOnDelete();
|
||||
$table->foreignUuid('version_id')->constrained('funding_programme_versions')->restrictOnDelete();
|
||||
$table->timestampTz('saved_at')->useCurrent();
|
||||
$table->timestampTz('removed_at')->nullable();
|
||||
$table->primary(['user_id', 'programme_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::table('funding_programmes')->exists() || DB::table('funding_programme_versions')->exists() || DB::table('funding_programme_interests')->exists()) {
|
||||
throw new RuntimeException('Preserve funding programmes, published versions and saved interests before rollback.');
|
||||
}
|
||||
Schema::drop('funding_programme_interests');
|
||||
Schema::drop('funding_programme_versions');
|
||||
Schema::drop('funding_programmes');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
DB::statement('ALTER TABLE investment_alert_preferences DROP CONSTRAINT investment_alert_sources');
|
||||
DB::statement("ALTER TABLE investment_alert_preferences ADD CONSTRAINT investment_alert_sources CHECK (jsonb_typeof(sources)='array' AND jsonb_array_length(sources) BETWEEN 1 AND 3 AND sources <@ '[\"opportunities\",\"tenders\",\"funding\"]'::jsonb)");
|
||||
Schema::table('investment_notifications', function (Blueprint $table) {
|
||||
$table->foreignUuid('funding_version_id')->nullable()->constrained('funding_programme_versions')->restrictOnDelete();
|
||||
});
|
||||
DB::statement('ALTER TABLE investment_notifications DROP CONSTRAINT investment_notification_origin');
|
||||
DB::statement('ALTER TABLE investment_notifications ADD CONSTRAINT investment_notification_origin CHECK ((submission_id IS NOT NULL)::integer + (opportunity_id IS NOT NULL)::integer + (tender_version_id IS NOT NULL)::integer + (funding_version_id IS NOT NULL)::integer = 1)');
|
||||
Schema::create('investment_funding_alert_seen', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignUuid('funding_version_id')->constrained('funding_programme_versions')->restrictOnDelete();
|
||||
$table->foreignUuid('notification_id')->nullable()->constrained('investment_notifications')->restrictOnDelete();
|
||||
$table->timestampTz('observed_at')->useCurrent();
|
||||
$table->primary(['user_id', 'funding_version_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::table('investment_funding_alert_seen')->exists() || DB::table('investment_notifications')->whereNotNull('funding_version_id')->exists()
|
||||
|| DB::table('investment_alert_preferences')->whereJsonContains('sources', 'funding')->exists()) {
|
||||
throw new RuntimeException('Preserve funding alert preferences and notification history before rollback.');
|
||||
}
|
||||
Schema::drop('investment_funding_alert_seen');
|
||||
DB::statement('ALTER TABLE investment_notifications DROP CONSTRAINT investment_notification_origin');
|
||||
Schema::table('investment_notifications', fn (Blueprint $table) => $table->dropConstrainedForeignId('funding_version_id'));
|
||||
DB::statement('ALTER TABLE investment_notifications ADD CONSTRAINT investment_notification_origin CHECK ((submission_id IS NOT NULL)::integer + (opportunity_id IS NOT NULL)::integer + (tender_version_id IS NOT NULL)::integer = 1)');
|
||||
DB::statement('ALTER TABLE investment_alert_preferences DROP CONSTRAINT investment_alert_sources');
|
||||
DB::statement("ALTER TABLE investment_alert_preferences ADD CONSTRAINT investment_alert_sources CHECK (jsonb_typeof(sources)='array' AND jsonb_array_length(sources) BETWEEN 1 AND 2 AND sources <@ '[\"opportunities\",\"tenders\"]'::jsonb)");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user