over naar uuids, policies, predefined mutations aan kunnen passen
linter / quality (push) Failing after 1m5s
tests / ci (8.4) (push) Failing after 1m7s
tests / ci (8.5) (push) Failing after 1m5s
tests / ci (8.3) (push) Failing after 12m5s

This commit is contained in:
Daan Meijer
2026-06-21 23:09:38 +02:00
parent 06e5600447
commit 1e0782385b
46 changed files with 1287 additions and 160 deletions
@@ -18,7 +18,7 @@ return new class extends Migration
$table->string('type');
$table->integer('amount');
$table->text('description')->nullable();
$table->string('status')->default('pending');
$table->string('status')->default('pending'); // pending, approved, rejected, voided
$table->timestamps();
});
}
@@ -13,10 +13,11 @@ return new class extends Migration
{
Schema::create('predefined_mutations', function (Blueprint $table) {
$table->id();
$table->foreignId('ledger_id')->constrained()->cascadeOnDelete();
$table->foreignId('dynamic_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->text('description')->nullable();
$table->integer('amount');
$table->string('type')->default('reward');
$table->timestamps();
});
}
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('ledgers', function (Blueprint $table) {
$table->string('status')->default('open');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('ledgers', function (Blueprint $table) {
$table->dropColumn('status');
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('mutations', function (Blueprint $table) {
$table->string('status')->default('pending')->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('mutations', function (Blueprint $table) {
$table->string('status')->default('pending')->change();
});
}
};
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('dynamics', function (Blueprint $table) {
$table->uuid('uuid')->after('id')->nullable();
});
// Populate existing rows with UUIDs
\App\Models\Dynamic::all()->each(function ($model) {
$model->uuid = \Illuminate\Support\Str::uuid();
$model->save();
});
Schema::table('dynamics', function (Blueprint $table) {
$table->uuid('uuid')->unique()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('dynamics', function (Blueprint $table) {
$table->dropColumn('uuid');
});
}
};
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('ledgers', function (Blueprint $table) {
$table->uuid('uuid')->after('id')->nullable();
});
// Populate existing rows with UUIDs
\App\Models\Ledger::all()->each(function ($model) {
$model->uuid = \Illuminate\Support\Str::uuid();
$model->save();
});
Schema::table('ledgers', function (Blueprint $table) {
$table->uuid('uuid')->unique()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('ledgers', function (Blueprint $table) {
$table->dropColumn('uuid');
});
}
};
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('mutations', function (Blueprint $table) {
$table->uuid('uuid')->after('id')->nullable();
});
// Populate existing rows with UUIDs
\App\Models\Mutation::all()->each(function ($model) {
$model->uuid = \Illuminate\Support\Str::uuid();
$model->save();
});
Schema::table('mutations', function (Blueprint $table) {
$table->uuid('uuid')->unique()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('mutations', function (Blueprint $table) {
$table->dropColumn('uuid');
});
}
};
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('predefined_mutations', function (Blueprint $table) {
$table->uuid('uuid')->after('id')->nullable();
});
// Populate existing rows with UUIDs
\App\Models\PredefinedMutation::all()->each(function ($model) {
$model->uuid = \Illuminate\Support\Str::uuid();
$model->save();
});
Schema::table('predefined_mutations', function (Blueprint $table) {
$table->uuid('uuid')->unique()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('predefined_mutations', function (Blueprint $table) {
$table->dropColumn('uuid');
});
}
};
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->uuid('uuid')->after('id')->nullable();
});
// Populate existing rows with UUIDs
\App\Models\User::all()->each(function ($model) {
$model->uuid = \Illuminate\Support\Str::uuid();
$model->save();
});
Schema::table('users', function (Blueprint $table) {
$table->uuid('uuid')->unique()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('uuid');
});
}
};