🔥 **Cleanup:** Removed BookCase and OrangePill models, factories, migrations, and related references. Added tests for new service and meetup creation flows. Updated PHPUnit settings and browser-specific configurations.

This commit is contained in:
BT
2026-05-02 22:00:26 +01:00
parent 63aed880e1
commit 04e3e30fcf
54 changed files with 3440 additions and 298 deletions
-37
View File
@@ -1,37 +0,0 @@
<?php
namespace Database\Factories;
use App\Models\BookCase;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<BookCase>
*/
class BookCaseFactory extends Factory
{
protected $model = BookCase::class;
public function definition(): array
{
return [
'title' => 'Bitcoin Bücherregal '.fake()->unique()->numberBetween(1, 99999),
'latitude' => fake()->latitude(47.0, 55.0),
'longitude' => fake()->longitude(5.0, 16.0),
'address' => fake()->streetAddress().', '.fake()->postcode().' '.fake()->city(),
'type' => fake()->randomElement(['public', 'private']),
'open' => fake()->randomElement(['24/7', 'Mo-Fr 09:00-18:00', 'Wochenenden', null]),
'comment' => fake()->boolean(60) ? fake()->sentence() : null,
'contact' => fake()->boolean(50) ? fake()->email() : null,
'bcz' => null,
'digital' => fake()->boolean(20),
'icontype' => 'default',
'deactivated' => false,
'deactreason' => '',
'entrytype' => fake()->randomElement(['public', 'private']),
'homepage' => fake()->boolean(40) ? fake()->url() : null,
'created_by' => User::factory(),
];
}
}
-29
View File
@@ -1,29 +0,0 @@
<?php
namespace Database\Factories;
use App\Models\BookCase;
use App\Models\OrangePill;
use App\Models\User;
use Database\Factories\Helpers\NostrHelper;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<OrangePill>
*/
class OrangePillFactory extends Factory
{
protected $model = OrangePill::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'book_case_id' => BookCase::factory(),
'date' => fake()->dateTimeBetween('-1 year', 'now'),
'amount' => fake()->numberBetween(1, 21),
'comment' => fake()->boolean(60) ? fake()->sentence() : null,
'nostr_status' => NostrHelper::fakeNostrEventStatus(),
];
}
}
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/
@@ -12,8 +13,9 @@ return new class extends Migration {
{
Schema::table('users', function (Blueprint $table) {
$table->json('lnbits')
->default('{"read_key":null,"url":null,"wallet_id":null}')
->change();
->nullable()
->default('{"read_key":null,"url":null,"wallet_id":null}')
->change();
});
}
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
DB::table('media')
->whereIn('model_type', [
'App\\Models\\OrangePill',
'App\\Models\\BookCase',
])
->delete();
Schema::dropIfExists('orange_pills');
Schema::dropIfExists('book_cases');
}
public function down(): void
{
throw new RuntimeException(
'OrangePill and BookCase features were removed permanently; this migration is not reversible.'
);
}
};
-11
View File
@@ -3,7 +3,6 @@
namespace Database\Seeders;
use App\Models\BitcoinEvent;
use App\Models\BookCase;
use App\Models\Category;
use App\Models\City;
use App\Models\Country;
@@ -19,7 +18,6 @@ use App\Models\LibraryItem;
use App\Models\LoginKey;
use App\Models\Meetup;
use App\Models\MeetupEvent;
use App\Models\OrangePill;
use App\Models\Participant;
use App\Models\Podcast;
use App\Models\ProjectProposal;
@@ -67,9 +65,6 @@ class DatabaseSeeder extends Seeder
$lecturers = Lecturer::factory()->count(15)
->recycle($users)
->create();
$bookCases = BookCase::factory()->count(25)
->recycle($users)
->create();
SelfHostedService::factory()->count(10)
->recycle($users)
->create();
@@ -117,12 +112,6 @@ class DatabaseSeeder extends Seeder
->recycle($lecturers)
->recycle($users)
->create();
OrangePill::withoutEvents(function () use ($users, $bookCases) {
OrangePill::factory()->count(50)
->recycle($users)
->recycle($bookCases)
->create();
});
$proposals = ProjectProposal::factory()->count(8)
->recycle($users)
->create();