@@ -183,10 +183,13 @@ class RequisitionWorkflow
|
||||
*/
|
||||
public function audit(User $user, string $action, ?Requisition $requisition, ?array $before, array $after): void
|
||||
{
|
||||
if (app(RequisitionExpiryRun::class)->tenantId() !== null) {
|
||||
$after += ['execution' => app(RequisitionExpiryRun::class)->evidence()];
|
||||
}
|
||||
AuditLog::query()->create([
|
||||
'tenant_id' => $user->tenant_id, 'user_id' => $user->id,
|
||||
'requisition_id' => $requisition?->id, 'action' => $action,
|
||||
'ip_address' => app(ReplenishmentRun::class)->tenantId() === null ? request()->ip() : null, 'before' => $before, 'after' => $after + (app(ReplenishmentRun::class)->tenantId() === null ? [] : ['execution' => app(ReplenishmentRun::class)->evidence()]),
|
||||
'ip_address' => app(ReplenishmentRun::class)->tenantId() === null && app(RequisitionExpiryRun::class)->tenantId() === null ? request()->ip() : null, 'before' => $before, 'after' => $after + (app(ReplenishmentRun::class)->tenantId() === null ? [] : ['execution' => app(ReplenishmentRun::class)->evidence()]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user