- Tenant-Admin-PWA: Neues /event-admin/welcome Onboarding mit WelcomeHero, Packages-, Order-Summary- und Event-Setup-Pages, Zustandsspeicher, Routing-Guard und Dashboard-CTA für Erstnutzer; Filament-/admin-Login via Custom-View behoben.
- Brand/Theming: Marketing-Farb- und Typographievariablen in `resources/css/app.css` eingeführt, AdminLayout, Dashboardkarten und Onboarding-Komponenten entsprechend angepasst; Dokumentation (`docs/todo/tenant-admin-onboarding-fusion.md`, `docs/changes/...`) aktualisiert. - Checkout & Payments: Checkout-, PayPal-Controller und Tests für integrierte Stripe/PayPal-Flows sowie Paket-Billing-Abläufe überarbeitet; neue PayPal SDK-Factory und Admin-API-Helper (`resources/js/admin/api.ts`) schaffen Grundlage für Billing/Members/Tasks-Seiten. - DX & Tests: Neue Playwright/E2E-Struktur (docs/testing/e2e.md, `tests/e2e/tenant-onboarding-flow.test.ts`, Utilities), E2E-Tenant-Seeder und zusätzliche Übersetzungen/Factories zur Unterstützung der neuen Flows. - Marketing-Kommunikation: Automatische Kontakt-Bestätigungsmail (`ContactConfirmation` + Blade-Template) implementiert; Guest-PWA unter `/event` erreichbar. - Nebensitzung: Blogsystem gefixt und umfassenden BlogPostSeeder für Beispielinhalte angelegt.
This commit is contained in:
26
database/factories/PackagePurchaseFactory.php
Normal file
26
database/factories/PackagePurchaseFactory.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Package;
|
||||
use App\Models\PackagePurchase;
|
||||
use App\Models\Tenant;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class PackagePurchaseFactory extends Factory
|
||||
{
|
||||
protected $model = PackagePurchase::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'tenant_id' => Tenant::factory(),
|
||||
'package_id' => Package::factory(),
|
||||
'provider_id' => $this->faker->uuid(),
|
||||
'price' => $this->faker->randomFloat(2, 0, 500),
|
||||
'purchased_at' => now(),
|
||||
'type' => 'endcustomer_event',
|
||||
'metadata' => ['source' => 'factory'],
|
||||
];
|
||||
}
|
||||
}
|
||||
31
database/factories/TenantPackageFactory.php
Normal file
31
database/factories/TenantPackageFactory.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Package;
|
||||
use App\Models\Tenant;
|
||||
use App\Models\TenantPackage;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class TenantPackageFactory extends Factory
|
||||
{
|
||||
protected $model = TenantPackage::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'tenant_id' => Tenant::factory(),
|
||||
'package_id' => Package::factory(),
|
||||
'price' => $this->faker->randomFloat(2, 0, 500),
|
||||
'purchased_at' => now(),
|
||||
'expires_at' => now()->addYear(),
|
||||
'used_events' => 0,
|
||||
'active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function inactive(): self
|
||||
{
|
||||
return $this->state(fn () => ['active' => false]);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ class UserFactory extends Factory
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
protected static ?string $password = null;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
@@ -23,15 +23,17 @@ class UserFactory extends Factory
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$firstName = $this->faker->firstName();
|
||||
$lastName = $this->faker->lastName();
|
||||
|
||||
return [
|
||||
'first_name' => fake()->firstName(),
|
||||
'last_name' => fake()->lastName(),
|
||||
'username' => fake()->unique()->userName(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'first_name' => fake()->firstName(),
|
||||
'last_name' => fake()->lastName(),
|
||||
'address' => fake()->streetAddress(),
|
||||
'phone' => fake()->phoneNumber(),
|
||||
'name' => trim("{$firstName} {$lastName}"),
|
||||
'first_name' => $firstName,
|
||||
'last_name' => $lastName,
|
||||
'username' => $this->faker->unique()->userName(),
|
||||
'email' => $this->faker->unique()->safeEmail(),
|
||||
'address' => $this->faker->streetAddress(),
|
||||
'phone' => $this->faker->phoneNumber(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
|
||||
@@ -253,9 +253,7 @@ return new class extends Migration
|
||||
if (Schema::hasTable('event_credits_ledger')) {
|
||||
Schema::dropIfExists('event_credits_ledger');
|
||||
}
|
||||
if (Schema::hasTable('event_purchases')) {
|
||||
Schema::dropIfExists('event_purchases');
|
||||
}
|
||||
// Keep legacy event_purchases table for compatibility with existing flows/resources.
|
||||
if (Schema::hasTable('purchase_history') && DB::table('package_purchases')->count() > 0) { // Only drop if new data exists
|
||||
Schema::dropIfExists('purchase_history');
|
||||
}
|
||||
@@ -333,4 +331,4 @@ return new class extends Migration
|
||||
Schema::dropIfExists('packages');
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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
|
||||
{
|
||||
if (! Schema::hasTable('event_purchases')) {
|
||||
Schema::create('event_purchases', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tenant_id')->constrained()->cascadeOnDelete();
|
||||
$table->unsignedInteger('events_purchased')->default(1);
|
||||
$table->decimal('amount', 10, 2)->default(0);
|
||||
$table->string('currency', 3)->default('EUR');
|
||||
$table->string('provider', 32);
|
||||
$table->string('external_receipt_id')->nullable()->index();
|
||||
$table->string('status', 32)->default('pending');
|
||||
$table->timestamp('purchased_at')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['tenant_id', 'purchased_at']);
|
||||
});
|
||||
}
|
||||
|
||||
if (! Schema::hasTable('event_credits_ledger')) {
|
||||
Schema::create('event_credits_ledger', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tenant_id')->constrained()->cascadeOnDelete();
|
||||
$table->integer('delta');
|
||||
$table->string('reason', 64);
|
||||
$table->foreignId('related_purchase_id')->nullable()->constrained('event_purchases')->nullOnDelete();
|
||||
$table->text('note')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['tenant_id', 'created_at']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (app()->environment('local', 'testing')) {
|
||||
Schema::dropIfExists('event_purchases');
|
||||
Schema::dropIfExists('event_credits_ledger');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
if (! Schema::hasColumn('users', 'name')) {
|
||||
$table->string('name')->nullable()->after('id');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (app()->environment('local', 'testing')) {
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('users', 'name')) {
|
||||
$table->dropColumn('name');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -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('blog_posts', function (Blueprint $table) {
|
||||
$table->boolean('is_published')->default(false)->after('published_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('blog_posts', function (Blueprint $table) {
|
||||
$table->dropColumn('is_published');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('blog_posts', function (Blueprint $table) {
|
||||
$table->string('meta_title')->nullable()->after('content');
|
||||
$table->text('meta_description')->nullable()->after('meta_title');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('blog_posts', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
1278
database/seeders/BlogPostSeeder.php
Normal file
1278
database/seeders/BlogPostSeeder.php
Normal file
File diff suppressed because it is too large
Load Diff
56
database/seeders/E2ETenantSeeder.php
Normal file
56
database/seeders/E2ETenantSeeder.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Tenant;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class E2ETenantSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
= config('testing.e2e_tenant_email', env('E2E_TENANT_EMAIL', 'tenant-e2e@example.com'));
|
||||
= config('testing.e2e_tenant_password', env('E2E_TENANT_PASSWORD', 'password123'));
|
||||
|
||||
= User::firstOrNew(['email' => ]);
|
||||
->fill([
|
||||
'name' => ->name ?? 'E2E Tenant Admin',
|
||||
'first_name' => ->first_name ?? 'E2E',
|
||||
'last_name' => ->last_name ?? 'Admin',
|
||||
'role' => 'tenant_admin',
|
||||
'pending_purchase' => false,
|
||||
]);
|
||||
|
||||
->password = Hash::make();
|
||||
->email_verified_at = now();
|
||||
->save();
|
||||
|
||||
= Tenant::firstOrNew(['user_id' => ->id]);
|
||||
->fill([
|
||||
'name' => ->name ?? 'E2E Test Tenant',
|
||||
'slug' => ->slug ?? Str::slug('e2e-tenant-' . ->id),
|
||||
'email' => ,
|
||||
'is_active' => true,
|
||||
'is_suspended' => false,
|
||||
'event_credits_balance' => ->event_credits_balance ?? 1,
|
||||
'subscription_status' => ->subscription_status ?? 'active',
|
||||
'settings' => ->settings ?? [
|
||||
'branding' => [
|
||||
'logo_url' => null,
|
||||
'primary_color' => '#ef476f',
|
||||
'secondary_color' => '#ffd166',
|
||||
'font_family' => 'Montserrat, sans-serif',
|
||||
],
|
||||
'features' => [
|
||||
'photo_likes_enabled' => true,
|
||||
],
|
||||
'contact_email' => ,
|
||||
'event_default_type' => 'general',
|
||||
],
|
||||
]);
|
||||
->save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user