feat(event): add effective date resolution for rescheduled events and update tests

This commit is contained in:
2026-09-16 14:27:35 -03:00
parent 9aa0c1f3b9
commit f8a3296821
7 changed files with 96 additions and 25 deletions

View File

@@ -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
{