feat: initial commit - Band Management application

This commit is contained in:
2026-01-06 03:11:46 +01:00
commit 34e12e00b3
24543 changed files with 3991790 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\Customer;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Customer>
*/
final class CustomerFactory extends Factory
{
protected $model = Customer::class;
public function definition(): array
{
$type = fake()->randomElement(['individual', 'company']);
return [
'name' => fake()->name(),
'company_name' => $type === 'company' ? fake()->company() : null,
'type' => $type,
'email' => fake()->optional()->safeEmail(),
'phone' => fake()->optional()->phoneNumber(),
'address' => fake()->optional()->streetAddress(),
'city' => fake()->optional()->city(),
'postal_code' => fake()->optional()->postcode(),
'country' => 'NL',
'notes' => fake()->optional()->paragraph(),
'is_portal_enabled' => fake()->boolean(20),
];
}
public function individual(): static
{
return $this->state(fn () => [
'type' => 'individual',
'company_name' => null,
]);
}
public function company(): static
{
return $this->state(fn () => [
'type' => 'company',
'company_name' => fake()->company(),
]);
}
public function withPortal(): static
{
return $this->state(fn () => ['is_portal_enabled' => true]);
}
}

View File

@@ -0,0 +1,103 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Enums\EventStatus;
use App\Enums\EventVisibility;
use App\Models\Customer;
use App\Models\Event;
use App\Models\Location;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Event>
*/
final class EventFactory extends Factory
{
protected $model = Event::class;
public function definition(): array
{
$startTime = fake()->time('H:i');
$endTime = fake()->optional()->time('H:i');
return [
'title' => fake()->sentence(3),
'description' => fake()->optional()->paragraph(),
'event_date' => fake()->dateTimeBetween('+1 week', '+6 months'),
'start_time' => $startTime,
'end_time' => $endTime,
'fee' => fake()->optional()->randomFloat(2, 100, 5000),
'currency' => 'EUR',
'status' => fake()->randomElement(EventStatus::cases()),
'visibility' => EventVisibility::Members,
'notes' => fake()->optional()->paragraph(),
'created_by' => User::factory(),
];
}
public function draft(): static
{
return $this->state(fn () => ['status' => EventStatus::Draft]);
}
public function pending(): static
{
return $this->state(fn () => ['status' => EventStatus::Pending]);
}
public function confirmed(): static
{
return $this->state(fn () => ['status' => EventStatus::Confirmed]);
}
public function completed(): static
{
return $this->state(fn () => ['status' => EventStatus::Completed]);
}
public function cancelled(): static
{
return $this->state(fn () => ['status' => EventStatus::Cancelled]);
}
public function withLocation(): static
{
return $this->state(fn () => ['location_id' => Location::factory()]);
}
public function withCustomer(): static
{
return $this->state(fn () => ['customer_id' => Customer::factory()]);
}
public function upcoming(): static
{
return $this->state(fn () => [
'event_date' => fake()->dateTimeBetween('+1 day', '+1 month'),
'status' => EventStatus::Confirmed,
]);
}
public function past(): static
{
return $this->state(fn () => [
'event_date' => fake()->dateTimeBetween('-6 months', '-1 day'),
'status' => EventStatus::Completed,
]);
}
public function privateEvent(): static
{
return $this->state(fn () => ['visibility' => EventVisibility::Private]);
}
public function publicEvent(): static
{
return $this->state(fn () => ['visibility' => EventVisibility::Public]);
}
}

View File

@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Enums\RsvpStatus;
use App\Models\Event;
use App\Models\EventInvitation;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<EventInvitation>
*/
final class EventInvitationFactory extends Factory
{
protected $model = EventInvitation::class;
public function definition(): array
{
return [
'event_id' => Event::factory(),
'user_id' => User::factory(),
'rsvp_status' => RsvpStatus::Pending,
'rsvp_note' => null,
'rsvp_responded_at' => null,
'invited_at' => now(),
];
}
public function pending(): static
{
return $this->state(fn () => [
'rsvp_status' => RsvpStatus::Pending,
'rsvp_responded_at' => null,
]);
}
public function available(): static
{
return $this->state(fn () => [
'rsvp_status' => RsvpStatus::Available,
'rsvp_responded_at' => now(),
]);
}
public function unavailable(): static
{
return $this->state(fn () => [
'rsvp_status' => RsvpStatus::Unavailable,
'rsvp_responded_at' => now(),
]);
}
public function tentative(): static
{
return $this->state(fn () => [
'rsvp_status' => RsvpStatus::Tentative,
'rsvp_responded_at' => now(),
'rsvp_note' => fake()->sentence(),
]);
}
}

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\Location;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Location>
*/
final class LocationFactory extends Factory
{
protected $model = Location::class;
public function definition(): array
{
return [
'name' => fake()->company() . ' ' . fake()->randomElement(['Theater', 'Hall', 'Arena', 'Club', 'Venue']),
'address' => fake()->streetAddress(),
'city' => fake()->city(),
'postal_code' => fake()->postcode(),
'country' => 'NL',
'latitude' => fake()->optional()->latitude(),
'longitude' => fake()->optional()->longitude(),
'capacity' => fake()->optional()->numberBetween(50, 2000),
'contact_name' => fake()->optional()->name(),
'contact_email' => fake()->optional()->safeEmail(),
'contact_phone' => fake()->optional()->phoneNumber(),
'notes' => fake()->optional()->paragraph(),
];
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}