- 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.
27 lines
829 B
PHP
27 lines
829 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 StoreEntryReservationsRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()?->tenant_codigo === 'desfile_pura_tendencia';
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'idempotency_key' => ['required', 'uuid'],
|
|
'rows' => ['required', 'array', 'min:1', 'max:100'],
|
|
'rows.*' => ['required', 'array:variant_id,tipo_pago'],
|
|
'rows.*.variant_id' => ['required', 'integer', 'min:1', 'distinct'],
|
|
'rows.*.tipo_pago' => ['required', Rule::enum(EntryReservationPaymentType::class)],
|
|
];
|
|
}
|
|
}
|