fix(staff): preserve scanner history on deletion
This commit is contained in:
@@ -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> */
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user