feat(ticketing): add entry reservations management for admin app
- Introduced new routes for entry reservations in admin app, including form, index, store, and download functionalities. - Created a migration to add the "Reserva de Tickets" menu item to the admin app. - Updated MenuSeeder to include the new menu item for ticket reservations. - Developed a PDF view for entry reservations. - Implemented tests for the EntryReservationController and EntryReservationService to ensure proper functionality and access control. - Refactored test setup to use a dedicated schema creation trait for better isolation and maintainability.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Ticketing\Ticket\Requests;
|
||||
|
||||
use App\Shared\Rules\ValidTimezone;
|
||||
|
||||
class ExportEntryReservationsRequest extends IndexEntryReservationsRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [...parent::rules(), 'timezone' => ['required', 'string', new ValidTimezone]];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Ticketing\Ticket\Requests;
|
||||
|
||||
use App\Domains\Ticketing\Ticket\Enums\EntryReservationPaymentType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class IndexEntryReservationsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()?->tenant_codigo === 'onticket';
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'catalog_item_id' => ['sometimes', 'nullable', 'integer', 'min:1'],
|
||||
'variant_id' => ['sometimes', 'nullable', 'integer', 'min:1'],
|
||||
'tipo_pago' => ['sometimes', 'nullable', Rule::enum(EntryReservationPaymentType::class)],
|
||||
'page' => ['sometimes', 'integer', 'min:1'],
|
||||
'per_page' => ['sometimes', 'integer', 'min:1', 'max:100'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Ticketing\Ticket\Requests;
|
||||
|
||||
use App\Domains\Ticketing\Ticket\Enums\EntryReservationPaymentType;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreEntryReservationsRequest extends IndexEntryReservationsRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'idempotency_key' => ['required', 'uuid'],
|
||||
'rows' => ['required', 'array', 'list', 'min:1', 'max:100'],
|
||||
'rows.*' => ['required', 'array:catalog_item_id,variant_id,tipo_pago'],
|
||||
'rows.*.catalog_item_id' => ['required', 'integer', 'min:1'],
|
||||
'rows.*.variant_id' => ['sometimes', 'nullable', 'integer', 'min:1'],
|
||||
'rows.*.tipo_pago' => ['required', Rule::enum(EntryReservationPaymentType::class)],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user