feat(ticket): add TicketController, TicketResource, and related routes with tests

This commit is contained in:
2026-07-21 14:56:17 -03:00
parent 38f74739da
commit e1a67fd9f3
5 changed files with 170 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?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,
'name' => $this->name,
'description' => $this->description,
'source_catalog_item_id' => $this->source_catalog_item_id,
'source_variant_id' => $this->source_variant_id,
'starts_at' => $this->starts_at,
'expires_at' => $this->expires_at,
'used_at' => $this->used_at,
'is_valid' => $this->is_valid,
'is_expired' => $this->is_expired,
'is_used' => $this->is_used,
];
}
}