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:
2026-10-02 11:03:00 -03:00
parent 856b9a6706
commit 47b2e8e030
27 changed files with 442 additions and 103 deletions

View File

@@ -99,7 +99,7 @@ class AdminAppDesfileEntryReservationFormControllerTest extends TestCase
]);
}
if ($state === 'administrative') {
$variant->desfileEntryReservations()->create([
$variant->entryReservations()->create([
'fecha_reserva' => now(), 'importe' => 0, 'tipo_pago' => 'sin_cargo',
]);
}
@@ -111,7 +111,7 @@ class AdminAppDesfileEntryReservationFormControllerTest extends TestCase
->assertOk()->assertJsonCount(1, 'data.variants')
->assertJsonPath('data.variants.0.id', $availableId)
->assertJsonPath('data.fields.3.options', [['value' => '1', 'label' => '1']]);
$this->assertDatabaseCount('desfile_entry_reservations', 1);
$this->assertDatabaseCount('entry_reservations', 1);
$this->assertSame(1, (int) Inventory::query()->sum('reserved_stock'));
}