Class: SavedClaim::EducationBenefits::VA10203
- Inherits:
-
SavedClaim::EducationBenefits
- Object
- ActiveRecord::Base
- ApplicationRecord
- SavedClaim
- SavedClaim::EducationBenefits
- SavedClaim::EducationBenefits::VA10203
- Includes:
- SentryLogging
- Defined in:
- app/models/saved_claim/education_benefits/va_10203.rb
Defined Under Namespace
Classes: Submit10203EVSSError
Instance Method Summary collapse
- #after_submit(user) ⇒ Object
- #create_stem_automated_decision ⇒ Object
- #email_sent(sco_email_sent) ⇒ Object
- #get_user_poa ⇒ Object
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Methods inherited from SavedClaim::EducationBenefits
form_class, #in_progress_form_id
Methods inherited from SavedClaim
add_form_and_validation, #confirmation_number, #form_is_string, #form_matches_schema, #form_must_be_string, #open_struct_form, #parsed_form, #process_attachments!, #submit_to_structured_data_services!, #submitted_at, #to_pdf, #update_form
Methods inherited from ApplicationRecord
descendants_using_encryption, lockbox_options, #timestamp_attributes_for_update_in_model, #valid?
Instance Method Details
#after_submit(user) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/models/saved_claim/education_benefits/va_10203.rb', line 12 def after_submit(user) @user = user if @user.present? @gi_bill_status = get_gi_bill_status create_stem_automated_decision end email_sent(false) send_confirmation_email if Flipper.enabled?(:form21_10203_confirmation_email) if @user.present? && FeatureFlipper.send_email? education_benefits_claim.education_stem_automated_decision.update(confirmation_email_sent_at: Time.zone.now) = @user.(:evss, :access?) if EducationForm::SendSchoolCertifyingOfficialsEmail.perform_async(id, less_than_six_months?, get_facility_code) end end end |
#create_stem_automated_decision ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/models/saved_claim/education_benefits/va_10203.rb', line 35 def create_stem_automated_decision logger.info "EDIPI available for submit STEM claim id=#{education_benefits_claim.id}: #{@user.edipi.present?}" education_benefits_claim.build_education_stem_automated_decision( user_uuid: @user.uuid, user_account: @user.user_account, auth_headers_json: EVSS::AuthHeaders.new(@user).to_h.to_json, poa: get_user_poa, remaining_entitlement: ).save end |
#email_sent(sco_email_sent) ⇒ Object
47 48 49 50 |
# File 'app/models/saved_claim/education_benefits/va_10203.rb', line 47 def email_sent(sco_email_sent) update_form('scoEmailSent', sco_email_sent) save end |
#get_user_poa ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'app/models/saved_claim/education_benefits/va_10203.rb', line 52 def get_user_poa # stem_automated_decision feature disables EVSS call for POA which will be removed in a future PR return nil if Flipper.enabled?(:stem_automated_decision, @user) @user.power_of_attorney.present? ? true : nil rescue => e log_exception_to_sentry(Submit10203EVSSError.new("Failed to retrieve VSOSearch data: #{e.}")) nil end |