*/ final class ArtistEngagementFactory extends Factory { /** @return array */ public function definition(): array { return [ // organisation_id is set by the observer from the artist; // factory leaves it null and lets the observer denormalise. 'artist_id' => Artist::factory(), 'event_id' => Event::factory(), 'booking_status' => ArtistEngagementStatus::Draft, 'fee_currency' => 'EUR', 'buma_applicable' => true, 'buma_percentage' => 7.00, 'buma_handled_by' => 'organisation', 'vat_applicable' => true, 'vat_percentage' => 21.00, 'payment_status' => 'none', 'crew_count' => 0, 'guests_count' => 0, 'advancing_completed_count' => 0, 'advancing_total_count' => 0, ]; } public function draft(): static { return $this->state(fn () => ['booking_status' => ArtistEngagementStatus::Draft]); } public function requested(): static { return $this->state(fn () => [ 'booking_status' => ArtistEngagementStatus::Requested, 'requested_at' => now(), ]); } public function option(): static { return $this->state(fn () => [ 'booking_status' => ArtistEngagementStatus::Option, 'option_expires_at' => now()->addDays(14), ]); } public function offered(): static { return $this->state(fn () => ['booking_status' => ArtistEngagementStatus::Offered]); } public function confirmed(): static { return $this->state(fn () => ['booking_status' => ArtistEngagementStatus::Confirmed]); } public function contracted(): static { return $this->state(fn () => [ 'booking_status' => ArtistEngagementStatus::Contracted, 'fee_amount' => fake()->randomFloat(2, 500, 25000), 'portal_token' => (string) Str::ulid(), ]); } public function cancelled(): static { return $this->state(fn () => ['booking_status' => ArtistEngagementStatus::Cancelled]); } }