From 748b104a201d1da2993db870f8b8c88fe1871bef Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Wed, 8 Apr 2026 18:31:30 +0100 Subject: [PATCH 1/4] Add stand reservation plans and VAA role Introduce StandReservationPlan model and StandReservationPlanStatus enum to manage reservation plan submissions, approvals, and imported reservations. Add migration to create the stand_reservation_plans table with payload, submit/approve metadata, status, and imported_reservations JSON. Add VAA role key to RoleKeys and a migration to create the Virtual Airline Administration role. --- app/Models/Stand/StandReservationPlan.php | 42 +++++++++++++++++++ .../Stand/StandReservationPlanStatus.php | 12 ++++++ app/Models/User/RoleKeys.php | 1 + ...0_create_stand_reservation_plans_table.php | 32 ++++++++++++++ .../2026_04_08_000100_add_vaa_role.php | 20 +++++++++ 5 files changed, 107 insertions(+) create mode 100644 app/Models/Stand/StandReservationPlan.php create mode 100644 app/Models/Stand/StandReservationPlanStatus.php create mode 100644 database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php create mode 100644 database/migrations/2026_04_08_000100_add_vaa_role.php diff --git a/app/Models/Stand/StandReservationPlan.php b/app/Models/Stand/StandReservationPlan.php new file mode 100644 index 000000000..5c23d3faa --- /dev/null +++ b/app/Models/Stand/StandReservationPlan.php @@ -0,0 +1,42 @@ + 'array', + 'submitted_by' => 'integer', + 'submitted_at' => 'datetime', + 'approved_by' => 'integer', + 'approved_at' => 'datetime', + 'status' => StandReservationPlanStatus::class, + 'imported_reservations' => 'array', + ]; + + public function submittedBy(): BelongsTo + { + return $this->belongsTo(User::class, 'submitted_by'); + } + + public function approvedBy(): BelongsTo + { + return $this->belongsTo(User::class, 'approved_by'); + } +} \ No newline at end of file diff --git a/app/Models/Stand/StandReservationPlanStatus.php b/app/Models/Stand/StandReservationPlanStatus.php new file mode 100644 index 000000000..9d011ab76 --- /dev/null +++ b/app/Models/Stand/StandReservationPlanStatus.php @@ -0,0 +1,12 @@ +id(); + $table->string('name'); + $table->string('contact_email'); + $table->json('payload'); + $table->unsignedBigInteger('submitted_by')->nullable(); + $table->timestamp('submitted_at')->nullable(); + $table->unsignedBigInteger('approved_by')->nullable(); + $table->timestamp('approved_at')->nullable(); + $table->string('status')->default(StandReservationPlanStatus::DRAFT->value); + $table->json('imported_reservations')->nullable(); + $table->timestamps(); + + $table->foreign('submitted_by')->references('id')->on('user')->nullOnDelete(); + $table->foreign('approved_by')->references('id')->on('user')->nullOnDelete(); + }); + } + + public function down(): void + { + Schema::dropIfExists('stand_reservation_plans'); + } +}; \ No newline at end of file diff --git a/database/migrations/2026_04_08_000100_add_vaa_role.php b/database/migrations/2026_04_08_000100_add_vaa_role.php new file mode 100644 index 000000000..b7249e1cf --- /dev/null +++ b/database/migrations/2026_04_08_000100_add_vaa_role.php @@ -0,0 +1,20 @@ + RoleKeys::VAA->value, + 'description' => 'Virtual Airline Administration', + ]); + } + + public function down(): void + { + Role::where('key', RoleKeys::VAA->value)->delete(); + } +}; \ No newline at end of file From d82bde1b9d94a043374da5f16cafdc8b598ba427 Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Wed, 8 Apr 2026 18:34:54 +0100 Subject: [PATCH 2/4] formatting --- app/Models/Stand/StandReservationPlan.php | 1 + app/Models/Stand/StandReservationPlanStatus.php | 1 + ...04_08_000000_create_stand_reservation_plans_table.php | 9 ++++++--- database/migrations/2026_04_08_000100_add_vaa_role.php | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Models/Stand/StandReservationPlan.php b/app/Models/Stand/StandReservationPlan.php index 5c23d3faa..fb05e16fd 100644 --- a/app/Models/Stand/StandReservationPlan.php +++ b/app/Models/Stand/StandReservationPlan.php @@ -39,4 +39,5 @@ public function approvedBy(): BelongsTo { return $this->belongsTo(User::class, 'approved_by'); } + } \ No newline at end of file diff --git a/app/Models/Stand/StandReservationPlanStatus.php b/app/Models/Stand/StandReservationPlanStatus.php index 9d011ab76..499e7f1b1 100644 --- a/app/Models/Stand/StandReservationPlanStatus.php +++ b/app/Models/Stand/StandReservationPlanStatus.php @@ -9,4 +9,5 @@ enum StandReservationPlanStatus: string case APPROVED = 'approved'; case REJECTED = 'rejected'; case IMPORTED = 'imported'; + } \ No newline at end of file diff --git a/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php b/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php index 714710c7d..0e51b6443 100644 --- a/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php +++ b/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php @@ -7,14 +7,17 @@ return new class extends Migration { public function up(): void - Schema::create('stand_reservation_plans', function (Blueprint $table): void { + { + + + Schema::create('stand_reservation_plans', function (Blueprint $table): void { $table->id(); $table->string('name'); $table->string('contact_email'); $table->json('payload'); - $table->unsignedBigInteger('submitted_by')->nullable(); + $table->unsignedInteger('submitted_by')->nullable(); $table->timestamp('submitted_at')->nullable(); - $table->unsignedBigInteger('approved_by')->nullable(); + $table->unsignedInteger('approved_by')->nullable(); $table->timestamp('approved_at')->nullable(); $table->string('status')->default(StandReservationPlanStatus::DRAFT->value); $table->json('imported_reservations')->nullable(); diff --git a/database/migrations/2026_04_08_000100_add_vaa_role.php b/database/migrations/2026_04_08_000100_add_vaa_role.php index b7249e1cf..473201aca 100644 --- a/database/migrations/2026_04_08_000100_add_vaa_role.php +++ b/database/migrations/2026_04_08_000100_add_vaa_role.php @@ -17,4 +17,5 @@ public function down(): void { Role::where('key', RoleKeys::VAA->value)->delete(); } + }; \ No newline at end of file From 6413e93e8d20dbad71296db8b1f561490acd41fa Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Wed, 8 Apr 2026 18:52:29 +0100 Subject: [PATCH 3/4] fix formatting --- app/Models/Stand/StandReservationPlan.php | 3 +-- app/Models/Stand/StandReservationPlanStatus.php | 3 +-- ...6_04_08_000000_create_stand_reservation_plans_table.php | 6 ++---- database/migrations/2026_04_08_000100_add_vaa_role.php | 7 ++++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/Models/Stand/StandReservationPlan.php b/app/Models/Stand/StandReservationPlan.php index fb05e16fd..0cbcda7b9 100644 --- a/app/Models/Stand/StandReservationPlan.php +++ b/app/Models/Stand/StandReservationPlan.php @@ -39,5 +39,4 @@ public function approvedBy(): BelongsTo { return $this->belongsTo(User::class, 'approved_by'); } - -} \ No newline at end of file +} diff --git a/app/Models/Stand/StandReservationPlanStatus.php b/app/Models/Stand/StandReservationPlanStatus.php index 499e7f1b1..6cf172da4 100644 --- a/app/Models/Stand/StandReservationPlanStatus.php +++ b/app/Models/Stand/StandReservationPlanStatus.php @@ -9,5 +9,4 @@ enum StandReservationPlanStatus: string case APPROVED = 'approved'; case REJECTED = 'rejected'; case IMPORTED = 'imported'; - -} \ No newline at end of file +} diff --git a/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php b/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php index 0e51b6443..586625800 100644 --- a/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php +++ b/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php @@ -5,11 +5,9 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up(): void { - - Schema::create('stand_reservation_plans', function (Blueprint $table): void { $table->id(); $table->string('name'); @@ -32,4 +30,4 @@ public function down(): void { Schema::dropIfExists('stand_reservation_plans'); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2026_04_08_000100_add_vaa_role.php b/database/migrations/2026_04_08_000100_add_vaa_role.php index 473201aca..85d46d090 100644 --- a/database/migrations/2026_04_08_000100_add_vaa_role.php +++ b/database/migrations/2026_04_08_000100_add_vaa_role.php @@ -4,7 +4,7 @@ use App\Models\User\RoleKeys; use Illuminate\Database\Migrations\Migration; -return new class extends Migration { +return new class () extends Migration { public function up(): void { Role::create([ @@ -17,5 +17,6 @@ public function down(): void { Role::where('key', RoleKeys::VAA->value)->delete(); } - -}; \ No newline at end of file + + +}; From a27f26f4c6528de63f4f985ca046661f11f06ac8 Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Wed, 8 Apr 2026 18:56:48 +0100 Subject: [PATCH 4/4] final formatting fix --- ...2026_04_08_000000_create_stand_reservation_plans_table.php | 2 +- database/migrations/2026_04_08_000100_add_vaa_role.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php b/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php index 586625800..117bb435b 100644 --- a/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php +++ b/database/migrations/2026_04_08_000000_create_stand_reservation_plans_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration { public function up(): void { Schema::create('stand_reservation_plans', function (Blueprint $table): void { diff --git a/database/migrations/2026_04_08_000100_add_vaa_role.php b/database/migrations/2026_04_08_000100_add_vaa_role.php index 85d46d090..9da2e56ad 100644 --- a/database/migrations/2026_04_08_000100_add_vaa_role.php +++ b/database/migrations/2026_04_08_000100_add_vaa_role.php @@ -4,7 +4,7 @@ use App\Models\User\RoleKeys; use Illuminate\Database\Migrations\Migration; -return new class () extends Migration { +return new class() extends Migration { public function up(): void { Role::create([ @@ -17,6 +17,4 @@ public function down(): void { Role::where('key', RoleKeys::VAA->value)->delete(); } - - };