feat(entry): add validation for single non-replaced variant in EntryResource and update tests

This commit is contained in:
2026-09-16 10:08:39 -03:00
parent e6b5da366c
commit 708037677a
3 changed files with 21 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ class EntryService
->where('tenant_code', $tenant->codigo)
->whereHas('category', fn ($query) => $query->where('nombre', 'Entradas'))
->with([
'variants' => fn ($query) => $query->whereNull('replaced_by_variant_id'),
'variants.inventory',
'variants.eventDate',
'variants.eventDates',