diff --git a/app/jobs/fs/validate_message_draft_result_job.rb b/app/jobs/fs/validate_message_draft_result_job.rb index ce0ebea2..bfdfb3bc 100644 --- a/app/jobs/fs/validate_message_draft_result_job.rb +++ b/app/jobs/fs/validate_message_draft_result_job.rb @@ -14,9 +14,13 @@ def perform(message_draft, location_header, fs_client: FsEnvironment.fs_client) message_draft.metadata[:validation_errors] = { result: response[:body]['result'], errors: response[:body]['problems']&.select { |problem| problem['level'] == 'error' }&.map{ |problem| problem['message'] }, - warnings: response[:body]['problems']&.select { |problem| problem['level'] == 'warning' }&.map{ |problem| problem['message'] } + warnings: response[:body]['problems']&.select { |problem| problem['level'] == 'warning' }&.map{ |problem| problem['message'] }, } - message_draft.add_cascading_tag(message_draft.tenant.submission_error_tag) + + diff = response[:body]['problems']&.select { |problem| problem['level'] == 'diff' } + Rails.logger.info("Message draft DIFF: #{diff.map{ |problem| problem['message']}.join(', ')}") if diff.any? + + message_draft.add_cascading_tag(message_draft.tenant.submission_error_tag) if message_draft.metadata[:validation_errors][:errors].any? || message_draft.metadata[:validation_errors][:warnings].any? end message_draft.save