Class: SavedClaim::DisabilityCompensation
- Inherits:
-
SavedClaim
- Object
- ActiveRecord::Base
- ApplicationRecord
- SavedClaim
- SavedClaim::DisabilityCompensation
- Defined in:
- app/models/saved_claim/disability_compensation.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Form526AllClaim, Form526IncreaseOnly
Instance Attribute Summary collapse
-
#form_hash ⇒ Object
Returns the value of attribute form_hash.
Class Method Summary collapse
Instance Method Summary collapse
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 Attribute Details
#form_hash ⇒ Object
Returns the value of attribute form_hash.
12 13 14 |
# File 'app/models/saved_claim/disability_compensation.rb', line 12 def form_hash @form_hash end |
Class Method Details
.from_hash(hash) ⇒ Object
18 19 20 21 22 |
# File 'app/models/saved_claim/disability_compensation.rb', line 18 def self.from_hash(hash) saved_claim = new(form: hash['form526'].to_json) saved_claim.form_hash = hash saved_claim end |
Instance Method Details
#to_submission_data(user) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/models/saved_claim/disability_compensation.rb', line 24 def to_submission_data(user) form4142 = EVSS::DisabilityCompensationForm::Form4142.new(user, @form_hash.deep_dup).translate form526 = @form_hash.deep_dup form526_uploads = form526['form526'].delete('attachments') dis_form = EVSS::DisabilityCompensationForm::DataTranslationAllClaim.new(user, form526, form4142.present?).translate { Form526Submission::FORM_526 => dis_form, Form526Submission::FORM_526_UPLOADS => form526_uploads, Form526Submission::FORM_4142 => form4142, Form526Submission::FORM_0781 => EVSS::DisabilityCompensationForm::Form0781.new(user, @form_hash.deep_dup).translate, Form526Submission::FORM_8940 => EVSS::DisabilityCompensationForm::Form8940.new(user, @form_hash.deep_dup).translate, 'flashes' => BGS::DisabilityCompensationFormFlashes.new(user, @form_hash.deep_dup).translate }.to_json end |