Implementa reforcos orcamentais com aprovacao independente

This commit is contained in:
2026-10-28 15:03:49 +02:00
parent c41628d738
commit 153ba2c1af
24 changed files with 1023 additions and 25 deletions
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('budget_reinforcements', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->constrained()->restrictOnDelete();
$table->foreignId('budget_id')->constrained()->restrictOnDelete();
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
$table->foreignId('reviewed_by')->nullable()->constrained('users')->restrictOnDelete();
$table->string('reference', 100);
$table->string('payload_hash', 64);
$table->bigInteger('amount_minor');
$table->text('reason');
$table->string('status')->default('pending');
$table->text('review_reason')->nullable();
$table->timestamp('reviewed_at')->nullable();
$table->timestamps();
$table->unique(['tenant_id', 'reference']);
});
}
public function down(): void
{
throw new LogicException('Preservar dotações, reforços e decisões.');
}
};