Class: EVSS::Dependents::Service
- Inherits:
-
Service
- Object
- Common::Client::Base
- Service
- EVSS::Dependents::Service
- Defined in:
- lib/evss/dependents/service.rb
Overview
Proxy Service for Dependents Caseflow.
Constant Summary collapse
- STATSD_KEY_PREFIX =
'api.evss.dependents'
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#clean_form(form) ⇒ Object
Cleans in-flight form using form hash.
-
#retrieve ⇒ Faraday::Response
Fetches user info from the retrieve endpoint.
-
#save(form) ⇒ Object
Saves in-flight form using form hash.
-
#submit(form, form_id) ⇒ Hash
Submits 686 form with form ID.
-
#validate(form) ⇒ Object
Validates in-flight form using form hash.
Methods inherited from Service
#headers, #initialize, #perform, service_is_up?
Methods included from Common::Client::Concerns::Monitoring
Methods inherited from Common::Client::Base
configuration, #raise_backend_exception
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Constructor Details
This class inherits a constructor from EVSS::Service
Instance Method Details
#clean_form(form) ⇒ Object
Cleans in-flight form using form hash.
36 37 38 39 40 |
# File 'lib/evss/dependents/service.rb', line 36 def clean_form(form) with_monitoring_and_error_handling do perform(:post, 'inflightform/cleanForm', form.to_json, headers).body end end |
#retrieve ⇒ Faraday::Response
Fetches user info from the retrieve endpoint.
24 25 26 27 28 |
# File 'lib/evss/dependents/service.rb', line 24 def retrieve with_monitoring_and_error_handling do perform(:get, 'load/retrieve') end end |
#save(form) ⇒ Object
Saves in-flight form using form hash.
60 61 62 63 64 |
# File 'lib/evss/dependents/service.rb', line 60 def save(form) with_monitoring_and_error_handling do perform(:post, 'inflightform/saveForm', form.to_json, headers).body end end |
#submit(form, form_id) ⇒ Hash
Submits 686 form with form ID
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/evss/dependents/service.rb', line 73 def submit(form, form_id) form['submitProcess']['application']['draftFormId'] = form_id change_evss_times!(form) with_monitoring_and_error_handling do res = perform( :post, 'form686submission/submit', form.to_xml(root: 'submit686Request'), 'Content-Type' => 'application/xml' ) Hash.from_xml(res.body) end end |
#validate(form) ⇒ Object
Validates in-flight form using form hash.
48 49 50 51 52 |
# File 'lib/evss/dependents/service.rb', line 48 def validate(form) with_monitoring_and_error_handling do perform(:post, 'inflightform/validateForm', form.to_json, headers).body end end |