feat(event): add effective date resolution for rescheduled events and update tests
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Domains\Event\Models;
|
||||
|
||||
use App\Domains\Catalog\Models\Variant;
|
||||
use App\Domains\Event\Enums\EventDateStatus;
|
||||
use App\Domains\Event\Services\EffectiveEventDateResolver;
|
||||
use App\Domains\Event\Services\EventDateTextFormatter;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticket\Enums\ValidityTimeType;
|
||||
@@ -80,6 +81,11 @@ class EventDate extends Model
|
||||
return $this->belongsTo(self::class, 'rescheduled_to_event_date_id');
|
||||
}
|
||||
|
||||
public function effectiveDate(): ?self
|
||||
{
|
||||
return app(EffectiveEventDateResolver::class)->resolve($this);
|
||||
}
|
||||
|
||||
/** @return HasMany<EventDate, $this> */
|
||||
public function rescheduledFrom(): HasMany
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user