- Renamed `desfile_entry_reservations` to `entry_reservations` and `desfile_reservation_batches` to `reservation_batches`. - Updated models, services, and requests to use the new `EntryReservation` model from the `Ticket` domain instead of the deleted `Desfile` model. - Introduced a new `EntryReservationPaymentType` enum to manage payment types. - Modified database migrations to ensure data integrity during the transition. - Updated tests to reflect changes in the database schema and model relationships. - Ensured that existing functionality remains intact while improving code organization and clarity.
25 lines
695 B
PHP
25 lines
695 B
PHP
<?php
|
|
|
|
namespace App\Domains\Ticketing\Desfile\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 === 'desfile_pura_tendencia';
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'tipo_pago' => ['sometimes', 'nullable', Rule::enum(EntryReservationPaymentType::class)],
|
|
'page' => ['sometimes', 'integer', 'min:1'],
|
|
'per_page' => ['sometimes', 'integer', 'min:1', 'max:100'],
|
|
];
|
|
}
|
|
}
|