add notes/remark and refactor round-trip
PHP Tests / php-tests (push) Has been cancelled

This commit is contained in:
Nyan Lin Paing
2026-08-22 21:43:41 +07:00
parent 894352b43f
commit fa908cdcaf
46 changed files with 1679 additions and 182 deletions
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Staff-curated flag for surfacing a route as "popular" on the customer
* side filterable via the routes index endpoint's `popular` param.
*/
public function up(): void
{
Schema::table('ev_routes', function (Blueprint $table) {
$table->boolean('is_popular')->default(false)->after('is_active');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('ev_routes', function (Blueprint $table) {
$table->dropColumn('is_popular');
});
}
};
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Round trip is no longer a flag on the route a round-trip booking now
* explicitly supplies a `return_ev_route_id`, validated server-side as
* the true reverse of the outbound route (`EvRoute::isReverseOf`), so
* this flag has no remaining purpose (domain.md §2b).
*/
public function up(): void
{
Schema::table('ev_routes', function (Blueprint $table) {
$table->dropColumn('is_round_trip');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('ev_routes', function (Blueprint $table) {
$table->boolean('is_round_trip')->default(false);
});
}
};
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* "Popular routes" is being reworked from scratch to match the
* client's actual logic (details TBD) the blunt is_popular flag
* shipped in 2026_08_20_010000 didn't align with it, so it's removed
* rather than kept around unused.
*/
public function up(): void
{
Schema::table('ev_routes', function (Blueprint $table) {
$table->dropColumn('is_popular');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('ev_routes', function (Blueprint $table) {
$table->boolean('is_popular')->default(false);
});
}
};