Refactor ticket validity handling and improve tests
- Updated tests for Accommodation, Entry, Food, Merchandise, and Sale controllers to use soft deletes for variants and ensure proper inventory counts. - Enhanced ticket generation logic to resolve validity from soft-deleted catalog sources. - Introduced a new TicketValidityResolver service to manage ticket validity based on event dates and variant definitions. - Removed unnecessary database assertions and improved the clarity of validity checks in tests. - Added comprehensive tests for the new TicketValidityResolver service, ensuring correct handling of event dates and multi-select options. - Cleaned up unused code and assertions in existing tests for better maintainability.
This commit is contained in:
@@ -161,8 +161,9 @@ class CreateDesfilePuraTendenciaTenantTest extends TestCase
|
||||
$this->assertSame('Entrada', $catalogItem->nombre);
|
||||
$this->assertSame('tracked', $catalogItem->inventory_policy);
|
||||
$this->assertSame(1, $catalogItem->has_tickets);
|
||||
$this->assertSame('one_per_unit', $catalogItem->ticket_generation_policy);
|
||||
$this->assertSame($eventDate->validity_time_id, $catalogItem->validity_time_id);
|
||||
$this->assertDatabaseHas('variant_event_dates', [
|
||||
'event_date_id' => $eventDate->id,
|
||||
]);
|
||||
$this->assertDatabaseHas('catalog_items_attachments', [
|
||||
'catalog_item_id' => $catalogItem->id,
|
||||
'variant_id' => null,
|
||||
|
||||
Reference in New Issue
Block a user