feat(ticketing): resolve validity in tenant timezone
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user