Class: V1::HigherLevelReviewsController

Inherits:
AppealsBaseControllerV1 show all
Defined in:
app/controllers/v1/higher_level_reviews_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::VERSION_STATUS

Constants included from SignIn::Authentication

SignIn::Authentication::BEARER_PATTERN

Constants included from ExceptionHandling

ExceptionHandling::SKIP_SENTRY_EXCEPTION_TYPES

Instance Method Summary collapse

Methods inherited from ApplicationController

#clear_saved_form, #cors_preflight, #routing_error

Methods included from Traceable

#set_trace_tags

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

Methods included from SignIn::Authentication

#authenticate, #authenticate_service_account, #load_user

Methods included from Headers

#block_unknown_hosts, #set_app_info_headers

Methods included from AuthenticationAndSSOConcerns

#authenticate, #clear_session, #extend_session!, #load_user, #log_sso_info, #render_unauthorized, #reset_session, #set_api_cookie!, #set_session_expiration_header, #sso_logging_info, #validate_inbound_login_params, #validate_session

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/controllers/v1/higher_level_reviews_controller.rb', line 16

def create
  hlr_response_body = decision_review_service
                      .create_higher_level_review(request_body: request_body_hash, user: @current_user)
                      .body
   = hlr_response_body.dig('data', 'id')
  ActiveRecord::Base.transaction do
    AppealSubmission.create!(user_uuid: @current_user.uuid, user_account: @current_user.,
                             type_of_appeal: 'HLR', submitted_appeal_uuid:)
    # Clear in-progress form since submit was successful
    InProgressForm.form_for_user('20-0996', current_user)&.destroy!
  end
  render json: hlr_response_body
rescue => e
  request = begin
    { body: request_body_hash }
  rescue
    request_body_debug_data
  end

  log_exception_to_personal_information_log(
    e, error_class: error_class(method: 'create', exception_class: e.class), request:
  )
  raise
end

#showObject



7
8
9
10
11
12
13
14
# File 'app/controllers/v1/higher_level_reviews_controller.rb', line 7

def show
  render json: decision_review_service.get_higher_level_review(params[:id]).body
rescue => e
  log_exception_to_personal_information_log(
    e, error_class: error_class(method: 'show', exception_class: e.class), id: params[:id]
  )
  raise
end