fix(sva): when there were resolved corrections and a pending correction

This commit is contained in:
Colin Darie 2024-09-24 12:48:09 +02:00
parent cae524b6bd
commit b50d42fbb4
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
2 changed files with 15 additions and 1 deletions

View file

@ -59,7 +59,7 @@ class SVASVRDecisionDateCalculatorService
end
def latest_correction_date
correction_date dossier.corrections.max_by(&:resolved_at)
correction_date dossier.corrections.max_by { _1.resolved_at || Time.current }
end
def calculate_correction_delay(start_date)