|
|
|
@ -30,11 +30,16 @@ class Form::Subsection
|
|
|
|
|
|
|
|
|
|
qs = applicable_questions(case_log) |
|
|
|
|
return :not_started if qs.all? { |question| case_log[question.id].blank? } |
|
|
|
|
return :completed if qs.all? { |question| case_log[question.id].present? } |
|
|
|
|
return :completed if qs.all? { |question| case_log[question.id].present? } && !invalidated?(case_log) |
|
|
|
|
|
|
|
|
|
:in_progress |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def invalidated?(case_log) |
|
|
|
|
applicable_questions(case_log).map(&:id).include?("gdpr_acceptance") && |
|
|
|
|
case_log["gdpr_acceptance"] == "No" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def is_incomplete?(case_log) |
|
|
|
|
%i[not_started in_progress].include?(status(case_log)) |
|
|
|
|
end |
|
|
|
|