feat: implement delete functionality for accommodations, entries, foods, and merchandise; enhance related services and tests

This commit is contained in:
2026-08-10 11:33:05 -03:00
parent 4aaa66dc38
commit 2693df2cbf
14 changed files with 263 additions and 0 deletions

View File

@@ -168,6 +168,35 @@ class EntryControllerTest extends TestCase
]);
}
public function test_it_deletes_an_entry_and_its_inventory(): void
{
$tenant = $this->createFiestaTenant();
$this->createEventDateAttribute($tenant);
$eventDate = $tenant->eventDates()->create([
'date' => '2026-10-09',
'time_start' => '00:00',
'time_end' => '23:59',
]);
Sanctum::actingAs($this->createAdminAppUser($tenant));
$entryId = $this->postJson('/api/v1/adminapp/tenant/entries', [
'entries' => [[
'title' => 'Entrada diaria',
'description' => null,
'event_date_ids' => [$eventDate->id],
'stock' => 100,
'price' => 5000,
]],
])->assertOk()->json('data.0.id');
$this->deleteJson("/api/v1/adminapp/tenant/entries/{$entryId}")
->assertNoContent();
$this->assertDatabaseCount('catalog_items', 0);
$this->assertDatabaseCount('variantes', 0);
$this->assertDatabaseCount('inventories', 0);
}
public function test_dates_must_belong_to_the_authenticated_tenant(): void
{
$tenant = $this->createFiestaTenant();