feat(tickets): enhance AdminAppTicketIndexRequest and AdminAppTicketService with additional filters and update tests for ticket filtering functionality

This commit is contained in:
2026-08-31 11:06:30 -03:00
parent 38341b2bda
commit 9175df1d7f
4 changed files with 234 additions and 4 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Domains\Ticket\Requests;
use App\Domains\Ticket\Models\Ticket;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class AdminAppTicketIndexRequest extends FormRequest
{
@@ -16,6 +18,19 @@ class AdminAppTicketIndexRequest extends FormRequest
{
return [
'q' => ['sometimes', 'nullable', 'string', 'max:255'],
'category' => ['sometimes', 'nullable', 'string', 'max:255'],
'product' => ['sometimes', 'nullable', 'string', 'max:255'],
'type' => ['sometimes', 'nullable', 'string', 'max:255'],
'date' => ['sometimes', 'nullable', 'date_format:Y-m-d'],
'status' => [
'sometimes',
'nullable',
Rule::in([
Ticket::STATUS_ACTIVE,
Ticket::STATUS_USED,
Ticket::STATUS_EXPIRED,
]),
],
'page' => ['sometimes', 'integer', 'min:1'],
'per_page' => ['sometimes', 'integer', 'min:1', 'max:100'],
];