fix(staff): preserve scanner history on deletion

This commit is contained in:
2026-09-03 09:58:08 -03:00
parent c2233389d0
commit ddb8c3743f
6 changed files with 91 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ class Ticket extends Model
/** @return BelongsTo<User, $this> */
public function scannerUser(): BelongsTo
{
return $this->belongsTo(User::class, 'scanner_user_id');
return $this->belongsTo(User::class, 'scanner_user_id')->withTrashed();
}
/** @return BelongsTo<PurchaseItem, $this> */

View File

@@ -293,6 +293,7 @@ class AdminAppTicketService
'id' => 'tickets.id',
'amount' => $this->purchaseItemColumnQuery('precio_unitario'),
'scanned_by' => User::query()
->withTrashed()
->select('nombre_apellido')
->whereColumn('users.id', 'tickets.scanner_user_id'),
'product' => $tenant->codigo === 'fiesta_futbol_infantil'