massive improvements to tests, streamlined and synced migrations, fixed a lot of wrong or old table field references. implemented a lot of pages in react for website frontend

This commit is contained in:
Codex Agent
2025-09-30 21:09:52 +02:00
parent 21c9391e2c
commit d1733686a6
114 changed files with 2867 additions and 2411 deletions

View File

@@ -0,0 +1,62 @@
<?php
namespace Database\Factories;
use App\Models\Package;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class PackageFactory extends Factory
{
protected $model = Package::class;
public function definition(): array
{
$name = $this->faker->word();
return [
'name' => $name,
'slug' => Str::slug($name . '-' . uniqid()),
'description' => $this->faker->sentence(),
'price' => $this->faker->randomFloat(2, 0, 100),
'max_photos' => $this->faker->numberBetween(100, 1000),
'max_guests' => $this->faker->numberBetween(50, 500),
'gallery_days' => $this->faker->numberBetween(7, 30),
'max_events_per_year' => $this->faker->numberBetween(1, 10),
'features' => json_encode([
'photo_likes_enabled' => $this->faker->boolean(),
'event_checklist' => $this->faker->boolean(),
'custom_domain' => $this->faker->boolean(),
'advanced_analytics' => $this->faker->boolean(),
]),
'type' => $this->faker->randomElement(['endcustomer', 'reseller']),
];
}
public function free(): static
{
return $this->state(fn (array $attributes) => [
'price' => 0,
]);
}
public function paid(): static
{
return $this->state(fn (array $attributes) => [
'price' => $this->faker->randomFloat(2, 5, 100),
]);
}
public function endcustomer(): static
{
return $this->state(fn (array $attributes) => [
'type' => 'endcustomer',
]);
}
public function reseller(): static
{
return $this->state(fn (array $attributes) => [
'type' => 'reseller',
]);
}
}

View File

@@ -26,7 +26,7 @@ class TenantFactory extends Factory
'is_active' => true,
'is_suspended' => false,
'settings_updated_at' => now(),
'settings' => [
'settings' => json_encode([
'branding' => [
'logo_url' => null,
'primary_color' => '#3B82F6',
@@ -42,7 +42,7 @@ class TenantFactory extends Factory
'custom_domain' => null,
'contact_email' => $contactEmail,
'event_default_type' => 'general',
],
]),
];
}

View File

@@ -25,7 +25,12 @@ class UserFactory extends Factory
{
return [
'name' => fake()->name(),
'username' => fake()->unique()->userName(),
'email' => fake()->unique()->safeEmail(),
'first_name' => fake()->firstName(),
'last_name' => fake()->lastName(),
'address' => fake()->streetAddress(),
'phone' => fake()->phoneNumber(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),