feat(ticketing): resolve validity in tenant timezone

This commit is contained in:
2026-09-21 15:19:09 -03:00
parent f4de2ff5b2
commit 3e3b3bfac0
17 changed files with 354 additions and 45 deletions

View File

@@ -5,7 +5,6 @@ namespace App\Domains\Ticketing\Event\Resources;
use App\Domains\Commerce\Catalog\Enums\InventoryPolicy;
use App\Domains\Commerce\Catalog\Models\CatalogItem;
use App\Domains\Commerce\Catalog\Models\Variant;
use Illuminate\Support\Carbon;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -29,10 +28,7 @@ class PublicEventResource extends JsonResource
return null;
}
return Carbon::parse(
$first->date->format('Y-m-d').' '.$first->time_start,
config('app.event_timezone'),
)->toISOString();
return $first->startsAt()->toISOString();
}),
'dates' => $this->whenLoaded('dates', fn () => $this->dates->map(fn ($date): array => [
'id' => $date->id,
@@ -52,8 +48,7 @@ class PublicEventResource extends JsonResource
'description' => $item->descripcion,
'price' => $item->precio,
'image' => $item->attachments->first()?->getTemporaryUrl(1440),
'requires_selection' => $item->itemAttributes->contains(fn ($attribute): bool =>
$attribute->show_in_selector && $attribute->attribute?->codigo !== 'event_date'),
'requires_selection' => $item->itemAttributes->contains(fn ($attribute): bool => $attribute->show_in_selector && $attribute->attribute?->codigo !== 'event_date'),
'maximum_quantity' => $item->inventory_policy === InventoryPolicy::Unlimited
? null
: $item->availableStock(),