Refactor entry reservation handling by generalizing ticket reservations
- 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.
This commit is contained in:
34
tests/Unit/Ticket/EntryReservationTest.php
Normal file
34
tests/Unit/Ticket/EntryReservationTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Ticket;
|
||||
|
||||
use App\Domains\Ticketing\Ticket\Enums\EntryReservationPaymentType;
|
||||
use App\Domains\Ticketing\Ticket\Models\EntryReservation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class EntryReservationTest extends TestCase
|
||||
{
|
||||
public function test_it_exposes_the_available_payment_types(): void
|
||||
{
|
||||
$this->assertSame([
|
||||
['value' => 'sin_cargo', 'label' => 'Sin cargo'],
|
||||
['value' => 'otro_metodo', 'label' => 'Otro método'],
|
||||
], EntryReservationPaymentType::options());
|
||||
}
|
||||
|
||||
public function test_it_defines_the_requested_fillable_fields(): void
|
||||
{
|
||||
$reservation = new EntryReservation;
|
||||
|
||||
$this->assertSame([
|
||||
'catalog_item_id',
|
||||
'variant_id',
|
||||
'ticket_id',
|
||||
'inventory_id',
|
||||
'batch_id',
|
||||
'fecha_reserva',
|
||||
'importe',
|
||||
'tipo_pago',
|
||||
], $reservation->getFillable());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user