*/ public function rules(): array { $event = $this->route('event'); $organisationId = $event instanceof Event ? $event->organisation_id : null; $bookingStatus = $this->input('booking_status'); return [ 'artist_id' => [ 'required', 'string', 'max:30', Rule::exists('artists', 'id')->where('organisation_id', $organisationId), ], 'booking_status' => ['required', Rule::enum(ArtistEngagementStatus::class)], 'project_leader_id' => ['nullable', 'string', 'max:30', 'exists:users,id'], 'fee_amount' => ['nullable', 'numeric', 'min:0', 'max:9999999.99', new ContractRequiresFee($bookingStatus)], 'fee_currency' => ['nullable', 'string', 'size:3', Rule::in(['EUR', 'USD', 'GBP'])], 'fee_type' => ['nullable', Rule::enum(FeeType::class)], 'buma_applicable' => ['nullable', 'boolean'], 'buma_percentage' => ['nullable', 'numeric', 'min:0', 'max:100'], 'buma_handled_by' => ['nullable', Rule::enum(BumaHandledBy::class)], 'vat_applicable' => ['nullable', 'boolean'], 'vat_percentage' => ['nullable', 'numeric', 'min:0', 'max:100'], 'deal_breakdown' => ['nullable', 'array'], 'deposit_percentage' => ['nullable', 'numeric', 'min:0', 'max:100'], 'deposit_due_date' => ['nullable', 'date'], 'balance_due_date' => ['nullable', 'date'], 'payment_status' => ['nullable', Rule::enum(PaymentStatus::class)], 'crew_count' => ['nullable', 'integer', 'min:0', 'max:200'], 'guests_count' => ['nullable', 'integer', 'min:0', 'max:1000'], 'requested_at' => ['nullable', 'date'], 'option_expires_at' => ['nullable', 'date', new OptionExpiresInFuture($bookingStatus)], 'advance_open_from' => ['nullable', 'date'], 'advance_open_to' => ['nullable', 'date', 'after_or_equal:advance_open_from'], 'notes' => ['nullable', 'string', 'max:2000'], ]; } }