ArtistEngagementStatus::class, 'fee_type' => FeeType::class, 'buma_handled_by' => BumaHandledBy::class, 'payment_status' => PaymentStatus::class, 'buma_applicable' => 'boolean', 'vat_applicable' => 'boolean', 'deal_breakdown' => 'array', 'deposit_due_date' => 'date', 'balance_due_date' => 'date', 'crew_count' => 'integer', 'guests_count' => 'integer', 'requested_at' => 'datetime', 'option_expires_at' => 'datetime', 'advance_open_from' => 'datetime', 'advance_open_to' => 'datetime', 'advancing_completed_count' => 'integer', 'advancing_total_count' => 'integer', ]; } public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logOnly([ 'booking_status', 'fee_amount', 'fee_currency', 'fee_type', 'buma_applicable', 'buma_percentage', 'buma_handled_by', 'vat_applicable', 'vat_percentage', 'project_leader_id', 'option_expires_at', 'payment_status', ]) ->logOnlyDirty() ->dontLogIfAttributesChangedOnly(['updated_at']) ->useLogName('artist_engagement'); } public function tapActivity(Activity $activity, string $eventName): void { $properties = $activity->properties?->toArray() ?? []; $properties['organisation_id'] = $this->organisation_id; $properties['event_id'] = $this->event_id; $activity->properties = collect($properties); } public function organisation(): BelongsTo { return $this->belongsTo(Organisation::class); } public function artist(): BelongsTo { return $this->belongsTo(Artist::class); } public function event(): BelongsTo { return $this->belongsTo(Event::class); } public function projectLeader(): BelongsTo { return $this->belongsTo(User::class, 'project_leader_id'); } public function performances(): HasMany { return $this->hasMany(Performance::class, 'engagement_id'); } public function advanceSections(): HasMany { return $this->hasMany(AdvanceSection::class, 'engagement_id'); } }