feat: person tags system - org-level skills with self-reported and organiser-assigned sources
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
44
api/database/factories/PersonTagFactory.php
Normal file
44
api/database/factories/PersonTagFactory.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Organisation;
|
||||
use App\Models\PersonTag;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<PersonTag>
|
||||
*/
|
||||
final class PersonTagFactory extends Factory
|
||||
{
|
||||
protected $model = PersonTag::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'organisation_id' => Organisation::factory(),
|
||||
'name' => fake()->unique()->randomElement([
|
||||
'Tapper', 'EHBO', 'Kassa ervaring', 'Barhoofd', 'Beveiliging',
|
||||
'Duits', 'Engels', 'Frans', 'Spaans', 'Italiaans',
|
||||
'Heftruck', 'VCA', 'BHV', 'Geluidstechniek', 'Lichttechniek',
|
||||
'Podiummanager', 'Runner', 'Barista', 'Chauffeur', 'Fotograaf',
|
||||
'Gastheer', 'Logistiek', 'Catering', 'Decoratie', 'Schoonmaak',
|
||||
'Ticketing', 'Marketing', 'Social media', 'Communicatie', 'Grafisch ontwerp',
|
||||
'Video', 'Drone piloot', 'Horeca', 'Kassamedewerker', 'Backstage',
|
||||
'Artiestencoördinator', 'Parkeerplaats', 'Camping', 'Infopunt', 'Kinderanimatie',
|
||||
]),
|
||||
'category' => fake()->randomElement(['Vaardigheid', 'Taal', 'Certificaat', null]),
|
||||
'icon' => fake()->randomElement(['tabler-beer', 'tabler-first-aid-kit', 'tabler-language', null]),
|
||||
'color' => fake()->optional()->hexColor(),
|
||||
'is_active' => true,
|
||||
'sort_order' => fake()->numberBetween(0, 10),
|
||||
];
|
||||
}
|
||||
|
||||
public function inactive(): static
|
||||
{
|
||||
return $this->state(fn () => ['is_active' => false]);
|
||||
}
|
||||
}
|
||||
43
api/database/factories/UserOrganisationTagFactory.php
Normal file
43
api/database/factories/UserOrganisationTagFactory.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Organisation;
|
||||
use App\Models\PersonTag;
|
||||
use App\Models\User;
|
||||
use App\Models\UserOrganisationTag;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<UserOrganisationTag>
|
||||
*/
|
||||
final class UserOrganisationTagFactory extends Factory
|
||||
{
|
||||
protected $model = UserOrganisationTag::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory(),
|
||||
'organisation_id' => Organisation::factory(),
|
||||
'person_tag_id' => PersonTag::factory(),
|
||||
'source' => fake()->randomElement(['self_reported', 'organiser_assigned']),
|
||||
'assigned_by_user_id' => null,
|
||||
'proficiency' => fake()->optional()->randomElement(['beginner', 'experienced', 'expert']),
|
||||
'notes' => null,
|
||||
'assigned_at' => now(),
|
||||
];
|
||||
}
|
||||
|
||||
public function selfReported(): static
|
||||
{
|
||||
return $this->state(fn () => ['source' => 'self_reported']);
|
||||
}
|
||||
|
||||
public function organiserAssigned(): static
|
||||
{
|
||||
return $this->state(fn () => ['source' => 'organiser_assigned']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user