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

@@ -13,8 +13,8 @@ use App\Domains\Core\Authorization\Enums\RoleCode;
use App\Domains\Core\Menu\Models\Menu;
use App\Domains\Core\Tenant\Models\AdminWebsiteType;
use App\Domains\Core\Tenant\Models\Tenant;
use App\Domains\Ticketing\Desfile\Enums\EntryReservationPaymentType;
use App\Domains\Ticketing\Desfile\Models\EntryReservation;
use App\Domains\Ticketing\Ticket\Enums\EntryReservationPaymentType;
use App\Domains\Ticketing\Ticket\Models\EntryReservation;
use App\Domains\Ticketing\Ticket\Models\Ticket;
use App\Domains\Ticketing\Ticket\Models\TicketRefund;
use App\Shared\Attachable\Enums\AttachmentType;

View File

@@ -72,7 +72,7 @@ class AdminAppTicketEventScopeTest extends TestCase
$table->unsignedBigInteger('purchase_item_id');
$table->decimal('amount', 12, 2);
});
Schema::create('desfile_entry_reservations', function (Blueprint $table): void {
Schema::create('entry_reservations', function (Blueprint $table): void {
$table->id();
$table->unsignedBigInteger('ticket_id');
$table->softDeletes();

View File

@@ -0,0 +1,24 @@
<?php
namespace Tests\Feature\Ticket;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Schema;
use Tests\TestCase;
class EntryReservationSchemaTest extends TestCase
{
use RefreshDatabase;
public function test_the_entry_reservations_table_has_the_requested_columns(): void
{
$this->assertTrue(Schema::hasColumns('entry_reservations', [
'id',
'catalog_item_id',
'variant_id',
'fecha_reserva',
'importe',
'tipo_pago',
]));
}
}