refactor(backend): reorganize domains into Core, Commerce, Ticketing and Shared

This commit is contained in:
2026-09-18 10:14:02 -03:00
parent 4659c1049d
commit 1241e1f7e8
425 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Domains\Ticket\Resources;
use App\Domains\Ticket\Models\Ticket;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin Ticket */
class TicketResource extends JsonResource
{
/** @return array<string, mixed> */
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'tenant_code' => $this->tenant_code,
'ticket' => $this->ticket,
'status' => $this->status,
'status_label' => $this->status_label,
'refund' => $this->whenLoaded('refund', fn (): ?array => $this->refund === null ? null : [
'type' => $this->refund->type,
'type_label' => $this->refund->typeLabel(),
'amount' => $this->refund->amount,
'created_at' => $this->refund->created_at,
]),
'name' => $this->name,
'description' => $this->description,
'client' => $this->user?->nombre_apellido,
'category' => $this->sourceCatalogItem?->category?->nombre,
'source_catalog_item_id' => $this->source_catalog_item_id,
'source_variant_id' => $this->source_variant_id,
'starts_at' => $this->getEffectiveStartsAt(),
'expires_at' => $this->getEffectiveExpiresAt(),
'used_at' => $this->used_at,
'scanner_user_id' => $this->scanner_user_id,
'is_valid' => $this->is_valid,
'is_expired' => $this->is_expired,
'is_used' => $this->is_used,
];
}
}