diff --git a/Gemfile.lock b/Gemfile.lock index af57e7cd71b..36bdbc2b9bf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -243,8 +243,8 @@ GEM attr_extras (7.1.0) awesome_print (1.9.2) aws-eventstream (1.3.0) - aws-partitions (1.913.0) - aws-sdk-core (3.191.6) + aws-partitions (1.914.0) + aws-sdk-core (3.192.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) @@ -252,8 +252,8 @@ GEM aws-sdk-kms (1.79.0) aws-sdk-core (~> 3, >= 3.191.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.146.1) - aws-sdk-core (~> 3, >= 3.191.0) + aws-sdk-s3 (1.147.0) + aws-sdk-core (~> 3, >= 3.192.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.8) aws-sdk-sns (1.72.0) @@ -815,7 +815,7 @@ GEM psych (>= 4.0.0) redis (5.2.0) redis-client (>= 0.22.0) - redis-client (0.22.0) + redis-client (0.22.1) connection_pool redis-namespace (1.11.0) redis (>= 4) @@ -874,7 +874,7 @@ GEM rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-sidekiq (4.1.0) + rspec-sidekiq (4.2.0) rspec-core (~> 3.0) rspec-expectations (~> 3.0) rspec-mocks (~> 3.0) diff --git a/app/controllers/v0/profile/direct_deposits_controller.rb b/app/controllers/v0/profile/direct_deposits_controller.rb index 4d4f6b92316..942a666f594 100644 --- a/app/controllers/v0/profile/direct_deposits_controller.rb +++ b/app/controllers/v0/profile/direct_deposits_controller.rb @@ -88,7 +88,7 @@ def control_info_params end def send_confirmation_email - VANotifyDdEmailJob.send_to_emails(current_user.all_emails, 'comp_and_pen') + VANotifyDdEmailJob.send_to_emails(current_user.all_emails) end end end diff --git a/app/sidekiq/education_form/templates/10203.erb b/app/sidekiq/education_form/templates/10203.erb index bad27173e61..cb756cfd5b1 100644 --- a/app/sidekiq/education_form/templates/10203.erb +++ b/app/sidekiq/education_form/templates/10203.erb @@ -2,11 +2,7 @@ CH33 *START* <%= form_identifier %> -<% if Settings.vsp_environment.eql?('production') -%> -JUN 2020 -<% else -%> OMB Control #: 2900-0878 -<% end -%> APPLICATION FOR EDITH NOURSE ROGERS STEM SCHOLARSHIP @@ -73,10 +69,6 @@ Applicant has POA: <%= yesno(@stem_automated_decision.poa) %> Applicant School Email Address: <%= @applicant.schoolEmailAddress %> Applicant School ID: <%= @applicant.schoolStudentId %> -<% if Settings.vsp_environment.eql?('production') -%> - Certification and Signature of Applicant -Signature of Applicant Date -<% else -%> <% if @applicant.isActiveDuty -%> As an active-duty service member, you have consulted with an Education Service Officer (ESO) regarding your education program. @@ -86,5 +78,4 @@ Signature of Applicant Date <% end -%> -<% end -%> <%= parse_with_template_path('footer') %> diff --git a/app/sidekiq/va_notify_dd_email_job.rb b/app/sidekiq/va_notify_dd_email_job.rb index 6a1dcdc4121..1f8a81c0697 100644 --- a/app/sidekiq/va_notify_dd_email_job.rb +++ b/app/sidekiq/va_notify_dd_email_job.rb @@ -10,7 +10,7 @@ class VANotifyDdEmailJob STATSD_ERROR_NAME = 'worker.direct_deposit_confirmation_email.error' STATSD_SUCCESS_NAME = 'worker.direct_deposit_confirmation_email.success' - def self.send_to_emails(user_emails, dd_type) + def self.send_to_emails(user_emails, dd_type = nil) if user_emails.present? user_emails.each do |email| perform_async(email, dd_type) @@ -25,9 +25,9 @@ def self.send_to_emails(user_emails, dd_type) end end - def perform(email, dd_type) + def perform(email, dd_type = nil) notify_client = VaNotify::Service.new(Settings.vanotify.services.va_gov.api_key) - template_type = "direct_deposit_#{dd_type.to_sym == :ch33 ? 'edu' : 'comp_pen'}" + template_type = template_type(dd_type) template_id = Settings.vanotify.services.va_gov.template_id.public_send(template_type) notify_client.send_email( @@ -39,6 +39,13 @@ def perform(email, dd_type) handle_errors(e) end + def template_type(dd_type) + return 'direct_deposit_edu' if dd_type&.to_sym == :ch33 + return 'direct_deposit_comp_pen' if dd_type&.to_sym == :comp_pen + + 'direct_deposit' + end + def handle_errors(ex) VANotifyDdEmailJob.log_exception_to_sentry(ex) StatsD.increment(STATSD_ERROR_NAME) diff --git a/config/betamocks/services_config.yml b/config/betamocks/services_config.yml index d0d17e6763f..0c8d6f0e546 100644 --- a/config/betamocks/services_config.yml +++ b/config/betamocks/services_config.yml @@ -9,6 +9,18 @@ :path: <%= "/#{Settings.ask_va_api.crm_api.veis_api_path}/ping" %> :file_path: "/ask_va/dynamics_api" :response_delay: 15 + - :method: :get + :path: "/veis/api/btsss/travelclaim/api/v1/Sample/ping" + :file_path: "/travel_pay/ping/default" + :response_delay: 0.3 + - :method: :get + :path: "/veis/api/btsss/travelclaim/api/v1/Sample/authorized-ping" + :file_path: "/travel_pay/ping/default" + :response_delay: 0.3 + - :method: :post + :path: "/veis/api/btsss/travelclaim/api/v1/Auth/access-token" + :file_path: "/travel_pay/token/default" + :response_delay: 0.3 - :method: :post :path: <%= "/#{Settings.ask_va_api.crm_api.veis_api_path}/inquiries/new" %> :file_path: "/ask_va/crm_api/post_inquiries/default" @@ -22,6 +34,10 @@ :path: <%= "/#{Settings.ask_va_api.crm_api.tenant_id}/oauth2/v2.0/token" %> :file_path: "/ask_va/token/default" :response_delay: 0.3 + - :method: :post + :path: <%= "/#{Settings.travel_pay.veis.tenant_id}/oauth2/token" %> + :file_path: "/travel_pay/token/default" + :response_delay: 0.3 - :name: 'carma' :base_uri: <%= "#{URI(Settings['salesforce-carma'].url).host}:#{URI(Settings['salesforce-carma'].url).port}" %> diff --git a/config/settings.yml b/config/settings.yml index 88fac504297..4ca4465d021 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -1281,6 +1281,7 @@ vanotify: in_progress_reminder_email_generic: fake_template_id covid_vaccine_registration: fake_template_id covid_vaccine_expanded_registration: fake_template_id + direct_deposit: direct_deposit_template_id direct_deposit_edu: edu_template_id direct_deposit_comp_pen: comp_pen_template_id login_reactivation_email: reactivation_email_test_b @@ -1666,6 +1667,7 @@ brd: travel_pay: + mock: true veis: client_id: ~ client_secret: ~ diff --git a/db/migrate/20240416155611_drop_pega_tables.rb b/db/migrate/20240416155611_drop_pega_tables.rb new file mode 100644 index 00000000000..91de41886dd --- /dev/null +++ b/db/migrate/20240416155611_drop_pega_tables.rb @@ -0,0 +1,5 @@ +class DropPegaTables < ActiveRecord::Migration[7.1] + def change + drop_table :pega_tables, if_exists: true + end +end diff --git a/db/migrate/20240416155705_create_ivc_champva_forms.rb b/db/migrate/20240416155705_create_ivc_champva_forms.rb new file mode 100644 index 00000000000..6033e53cd27 --- /dev/null +++ b/db/migrate/20240416155705_create_ivc_champva_forms.rb @@ -0,0 +1,18 @@ +class CreateIvcChampvaForms < ActiveRecord::Migration[7.1] + def change + create_table :ivc_champva_forms do |t| + t.string :email + t.string :first_name + t.string :last_name + t.string :form_number + t.string :file_name + t.uuid :form_uuid + t.string :s3_status + t.string :pega_status + + t.timestamps + end + + add_index :ivc_champva_forms, :email, unique: true + end +end \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index b07838a80dc..37c2815618e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -822,6 +822,20 @@ t.index ["edipi"], name: "index_invalid_letter_address_edipis_on_edipi" end + create_table "ivc_champva_forms", force: :cascade do |t| + t.string "email" + t.string "first_name" + t.string "last_name" + t.string "form_number" + t.string "file_name" + t.uuid "form_uuid" + t.string "s3_status" + t.string "pega_status" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["email"], name: "index_ivc_champva_forms_on_email", unique: true + end + create_table "maintenance_windows", id: :serial, force: :cascade do |t| t.string "pagerduty_id" t.string "external_service" @@ -890,23 +904,6 @@ t.index ["va_profile_id", "dismissed"], name: "show_onsite_notifications_index" end - create_table "pega_tables", force: :cascade do |t| - t.uuid "uuid" - t.string "veteranfirstname" - t.string "veteranmiddlename" - t.string "veteranlastname" - t.string "applicantfirstname" - t.string "applicantmiddlename" - t.string "applicantlastname" - t.jsonb "response" - t.string "filenumber" - t.string "doctype" - t.datetime "date_created" - t.datetime "date_completed" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "pension_ipf_notifications", force: :cascade do |t| t.text "payload_ciphertext" t.text "encrypted_kms_key" diff --git a/lib/saml/post_url_service.rb b/lib/saml/post_url_service.rb index d16313784d4..b91b651d8e0 100644 --- a/lib/saml/post_url_service.rb +++ b/lib/saml/post_url_service.rb @@ -63,8 +63,7 @@ def tou_declined_logout_redirect_url end def terms_of_use_redirect_url - application = @tracker&.payload_attr(:application) || 'vaweb' - if enabled_tou_clients.include?(application) + if terms_of_use_enabled_application Rails.logger.info('Redirecting to /terms-of-use', type: :ssoe) add_query(terms_of_use_url, { redirect_url: login_redirect_url }) else @@ -79,6 +78,32 @@ def ssoe_slo_url private + def terms_of_use_enabled_application + cache_key = "terms_of_use_redirect_user_#{user.uuid}" + cached_application = retrieve_and_delete_terms_of_use_redirect_user(cache_key) + current_application = @tracker&.payload_attr(:application) + write_terms_of_use_redirect_user(cache_key, current_application) if should_cache_application?(current_application) + terms_of_use_redirect_enabled?(cached_application, current_application) + end + + def terms_of_use_redirect_enabled?(cached_application, current_application) + enabled_tou_clients.include?(cached_application || current_application || 'vaweb') + end + + def should_cache_application?(application) + enabled_tou_clients.include?(application) + end + + def retrieve_and_delete_terms_of_use_redirect_user(cache_key) + application = Rails.cache.read(cache_key) + Rails.cache.delete(cache_key) + application + end + + def write_terms_of_use_redirect_user(cache_key, application) + Rails.cache.write(cache_key, application, expires_in: 5.minutes) + end + def terms_of_use_url if Settings.review_instance_slug.present? "http://#{Settings.review_instance_slug}.review.vetsgov-internal/terms-of-use" diff --git a/modules/appeals_api/app/services/appeals_api/remove_pii.rb b/modules/appeals_api/app/services/appeals_api/remove_pii.rb index 39fd91d8673..c9626c78e1c 100644 --- a/modules/appeals_api/app/services/appeals_api/remove_pii.rb +++ b/modules/appeals_api/app/services/appeals_api/remove_pii.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'ddtrace' + module AppealsApi class RemovePii include SentryLogging @@ -15,13 +17,20 @@ def initialize(form_type:) end def run! - validate_form_type! + Datadog::Tracing.trace("#{self.class.name} - #{form_type}") do + validate_form_type! - result = remove_pii! + result = remove_pii! - log_failure_to_sentry if records_were_not_cleared(result) + if result.blank? && records_to_be_expunged.present? + ids = records_to_be_expunged.pluck(:id) + msg = "Failed to remove expired #{form_type} PII from records" + Rails.logger.error(msg, ids) + AppealsApi::Slack::Messager.new({ msg:, ids: }).notify! + end - result + result + end end private @@ -49,17 +58,5 @@ def records_to_be_expunged .pii_expunge_policy end end - - def records_were_not_cleared(result) - result.blank? && records_to_be_expunged.present? - end - - def log_failure_to_sentry - log_message_to_sentry( - "Failed to expunge PII from #{form_type} (modules/appeals_api)", - :error, - ids: records_to_be_expunged.pluck(:id) - ) - end end end diff --git a/modules/appeals_api/spec/services/appeals_api/remove_pii_spec.rb b/modules/appeals_api/spec/services/appeals_api/remove_pii_spec.rb index 8599a4838f5..62d9785c9e6 100644 --- a/modules/appeals_api/spec/services/appeals_api/remove_pii_spec.rb +++ b/modules/appeals_api/spec/services/appeals_api/remove_pii_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'rails_helper' -require AppealsApi::Engine.root.join('spec', 'spec_helper.rb') def update_appeal_status(appeal, status, code: nil, detail: nil) # At the time of writing, the `update_status` method for each appeal model involves kicking off a sidekiq job to @@ -159,6 +158,32 @@ def create_misc_appeals = create_appeals + misc_appeal_types.map { |f| FactoryBo expect { AppealsApi::RemovePii.new(form_type: 'Invalid').run! }.to raise_error(ArgumentError) end + context 'when the removal fails' do + let!(:appeals) do + Timecop.freeze(100.days.ago) do + status = 'complete' + [create(:supplemental_claim, status:), create(:supplemental_claim_v0, status:)] + end + end + + before do + instance = AppealsApi::RemovePii.new(form_type: AppealsApi::SupplementalClaim) + msg = 'Failed to remove expired AppealsApi::SupplementalClaim PII from records' + expect(Rails.logger).to receive(:error).with(msg, appeals.map(&:id)) + expect_any_instance_of(AppealsApi::Slack::Messager).to receive(:notify!) + allow(instance).to receive(:remove_pii!).and_return [] + instance.run! + end + + it 'logs an error and the IDs of records whose PII failed to be removed' do + appeals.each do |appeal| + appeal.reload + expect(appeal.auth_headers).to be_present + expect(appeal.form_data).to be_present + end + end + end + it 'removes PII from HLR records needing PII removal' do day_old_has_pii_v2 = create :higher_level_review_v2, status: 'complete' day_old_has_pii_v2.update updated_at: 1.day.ago @@ -271,13 +296,5 @@ def create_misc_appeals = create_appeals + misc_appeal_types.map { |f| FactoryBo expect(week_old_has_pii_error.reload.form_data_ciphertext).to be_present end end - - it 'sends a message to sentry if the removal failed.' do - allow_any_instance_of(AppealsApi::RemovePii).to receive(:records_were_not_cleared).and_return(true) - service = AppealsApi::RemovePii.new(form_type: AppealsApi::NoticeOfDisagreement) - expect(service).to receive(:log_failure_to_sentry) - - service.run! - end end end diff --git a/modules/ask_va_api/app/lib/ask_va_api/correspondences/creator.rb b/modules/ask_va_api/app/lib/ask_va_api/correspondences/creator.rb index 09d91f58cda..8e22434a394 100644 --- a/modules/ask_va_api/app/lib/ask_va_api/correspondences/creator.rb +++ b/modules/ask_va_api/app/lib/ask_va_api/correspondences/creator.rb @@ -29,7 +29,7 @@ def default_service def post_data(payload: {}) endpoint = "inquiries/#{inquiry_id}/reply/new" - response = service.call(endpoint:, payload:) + response = service.call(endpoint:, method: :post, payload:) handle_response_data(response) end diff --git a/modules/claims_api/app/swagger/claims_api/v2/swagger.json b/modules/claims_api/app/swagger/claims_api/v2/swagger.json deleted file mode 100644 index 83418ddde00..00000000000 --- a/modules/claims_api/app/swagger/claims_api/v2/swagger.json +++ /dev/null @@ -1,8690 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "Benefits Claims", - "version": "v2", - "description": "## Background\n\nThe Benefits Claims API Version 2 lets internal consumers: \n\n- Retrieve existing claim information, including status, by claim ID\n- Automatically establish an Intent To File (21-0966) in VBMS\n- Automatically establish a disability compensation claim (21-526EZ) in VBMS\n- Digitally submit supporting documentation for disability compensation claims\n\nAdditional functionality will be added over time.\n\nYou should use the [Benefits Claims API Version 1](https://developer.va.gov/explore/benefits/docs/claims?version=current) if: \n\n- You are a consumer outside of VA and do not have the necessary VA agreements to use this API, and/or\n- You want automatic establishment of power of attorney (21-22 or 21-22a)\n \n## Technical Overview\n\nThis API accepts a payload of requests and responses with the payload identifying the claim and Veteran. Responses provide the submission’s processing status. Responses also provide a unique ID which can be used with the appropriate GET endpoint to return detailed, end-to-end claims status tracking. \n\nEnd-to-end claims tracking provides the status of claims as they move through the submission process, but does not return whether the claim was approved or denied. \n\n### Claim statuses\n\nClaims are first submitted by this API and then established in Veterans Benefits Management System (VBMS). A 200 response means that the claim was successfully submitted by the API. It does not mean VA has received the claim. Use the appropriate GET endpoint and the ID returned with your submission response to confirm the status of the submission. Statuses are:\n\n- Pending - the claim is successfully submitted to Lighthouse\n- Errored - the submission encountered upstream errors\n- Canceled - the claim was identified as a duplicate or another issue caused the claim to be canceled. For duplicate claims, the tracking of the claim's progress happens under a different Claim ID . \n\nOther statuses this API returns align with the [VA.gov](http://va.gov/) [claim status descriptions](https://www.va.gov/resources/what-your-claim-status-means/), which are:\n\n- Claim received\n- Initial review\n- Evidence gathering, review, and decision\n- Preparation for notification\n- Complete\n\n### Finding a Veteran's unique VA ID\n\nThis API uses a unique Veteran identifier to identify the subject of each API request. This Veteran identifier can be retrieved by passing the Veteran’s first name, last name, DOB, and SSN to the ‘/veteran-id’ endpoint. This identifier should then be used as the Veteran ID parameter in request URLs.\n\nNote: though Veteran identifiers are typically static, they may change over time. If a specific Veteran ID suddenly responds with a ‘404 not found’ error, the identifier may have changed. It’s a good idea to periodically check the identifier for each Veteran.\n\n### Authentication and authorization\n\nThe authentication model for the Benefits Claims Version 2 is based on OAuth 2.0 / OpenID Connect and supports the [client credentials grant](https://developer.va.gov/explore/authorization/docs/client-credentials?api=claims).\n\n**Important**: To get production access, you must either work for VA or have specific VA agreements in place. If you have questions, [contact us](https://developer.va.gov/support/contact-us).\n\n### Test data for sandbox environment use\n\nWe use mock [test data in the sandbox environment](https://github.com/department-of-veterans-affairs/vets-api-clients/blob/master/test_accounts.md). Sandbox test data and test users for the Benefits Claims API are valid for all versions of the API.\n" - }, - "tags": [ - { - "name": "Veteran Identifier", - "description": "Allows authenticated veterans and veteran representatives to retrieve a veteran's id." - }, - { - "name": "Claims", - "description": "Allows authenticated and authorized users to access claims data for a given Veteran. No data is returned if the user is not authenticated and authorized.\n" - }, - { - "name": "5103 Waiver", - "description": "Allows authenticated and authorized users to file a 5103 Notice Response on a claim." - }, - { - "name": "Intent to File", - "description": "Allows authenticated and authorized users to automatically establish an Intent to File (21-0966) in VBMS.\n" - }, - { - "name": "Disability Compensation Claims", - "description": "Allows authenticated and authorized users to automatically establish a Disability Compensation Claim (21-526EZ) in VBMS\n" - } - ], - "components": { - "securitySchemes": { - "bearer_token": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" - }, - "productionOauth": { - "type": "oauth2", - "description": "This API uses OAuth 2 with the authorization code grant flow. [More info](https://developer.va.gov/explore/authorization?api=claims)", - "flows": { - "authorizationCode": { - "authorizationUrl": "https://api.va.gov/oauth2/authorization", - "tokenUrl": "https://api.va.gov/oauth2/token", - "scopes": { - "system/claim.read": "Retrieve claim data", - "system/claim.write": "Submit claim data" - } - } - } - }, - "sandboxOauth": { - "type": "oauth2", - "description": "This API uses OAuth 2 with the authorization code grant flow. [More info](https://developer.va.gov/explore/authorization?api=claims)", - "flows": { - "authorizationCode": { - "authorizationUrl": "https://sandbox-api.va.gov/oauth2/authorization", - "tokenUrl": "https://sandbox-api.va.gov/oauth2/token", - "scopes": { - "system/claim.read": "Retrieve claim data", - "system/claim.write": "Submit claim data" - } - } - } - } - } - }, - "paths": { - "/veteran-id:find": { - "post": { - "summary": "Retrieve Veteran ID.", - "tags": [ - "Veteran Identifier" - ], - "operationId": "postVeteranId", - "security": [ - { - "productionOauth": [ - "system/claim.read" - ] - }, - { - "sandboxOauth": [ - "system/claim.read" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Allows authenticated and authorized users to retrieve a Veteran's ID.", - "parameters": [ - - ], - "responses": { - "201": { - "description": "Veteran's unique identifier", - "content": { - "application/json": { - "example": { - "id": "1012667145V762142" - }, - "schema": { - "additionalProperties": false, - "properties": { - "id": { - "type": "string", - "example": "1012667145V762142" - } - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "invalid value for SSN", - "detail": "blank is not valid for SSN" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Resource not found", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Resource not found", - "detail": "Resource not found" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "ssn", - "birthdate", - "firstName", - "lastName" - ], - "properties": { - "ssn": { - "type": "string", - "example": "796130115", - "description": "SSN of Veteran being represented" - }, - "firstName": { - "type": "string", - "example": "Tamara", - "description": "First name of Veteran being represented" - }, - "lastName": { - "type": "string", - "example": "Ellis", - "description": "Last name of Veteran being represented" - }, - "birthdate": { - "type": "string", - "example": "1967-06-19", - "description": "Date of birth of Veteran being represented, in iso8601 format" - } - }, - "example": { - "ssn": "796130115", - "firstName": "Tamara", - "lastName": "Ellis", - "birthdate": "1967-06-19" - } - } - } - }, - "required": true - } - } - }, - "/veterans/{veteranId}/claims": { - "get": { - "summary": "Find all benefits claims for a Veteran.", - "tags": [ - "Claims" - ], - "operationId": "findClaims", - "security": [ - { - "productionOauth": [ - "system/claim.read" - ] - }, - { - "sandboxOauth": [ - "system/claim.read" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Retrieves all claims for Veteran.", - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "claim response", - "content": { - "application/json": { - "example": { - "data": [ - { - "id": "555555555", - "type": "claim", - "attributes": { - "baseEndProductCode": "400", - "claimDate": "2017-05-02", - "claimPhaseDates": { - "phaseChangeDate": "2017-10-18" - }, - "claimType": "Compensation", - "closeDate": "2017-10-18", - "decisionLetterSent": false, - "developmentLetterSent": false, - "documentsNeeded": false, - "endProductCode": "404", - "evidenceWaiverSubmitted5103": false, - "lighthouseId": null, - "status": "COMPLETE" - } - } - ] - }, - "schema": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "required": [ - "id", - "type", - "attributes" - ], - "additionalProperties": false, - "description": "Claim details", - "properties": { - "id": { - "type": "string", - "nullable": true, - "description": "Claim ID in VBMS. If a claim was submitted with Lighthouse and not successfully established upstream, it could have a null claimId.", - "example": "600131328" - }, - "type": { - "type": "string", - "example": "claim" - }, - "attributes": { - "type": "object", - "required": [ - "baseEndProductCode", - "claimType", - "claimDate", - "claimPhaseDates", - "closeDate", - "developmentLetterSent", - "decisionLetterSent", - "documentsNeeded", - "endProductCode", - "evidenceWaiverSubmitted5103", - "lighthouseId", - "status" - ], - "properties": { - "baseEndProductCode": { - "type": "string", - "description": "Base end product code for claim", - "example": "400" - }, - "claimType": { - "type": "string", - "description": "Name of claim type", - "example": "Compensation" - }, - "claimDate": { - "format": "date", - "type": "string", - "description": "Date in YYYY-MM-DD the claim was first filed", - "example": "2018-06-04" - }, - "claimPhaseDates": { - "type": "object", - "properties": { - "phaseChangeDate": { - "format": "date", - "type": "string", - "description": "The date that the claim changed to its current phase", - "example": "2017-10-18" - } - } - }, - "closeDate": { - "format": "date", - "type": "string", - "description": "Date claim was closed", - "example": "2019-09-04" - }, - "developmentLetterSent": { - "type": "boolean", - "description": "If true, a development letter has been sent to the claimant regarding a benefit claim", - "example": "false" - }, - "decisionLetterSent": { - "type": "boolean", - "description": "If true, a decision letter has been sent to the claimant regarding a benefit claim", - "example": "false" - }, - "documentsNeeded": { - "type": "boolean", - "description": "If true, the claim requires additional documents to be submitted", - "example": "false" - }, - "endProductCode": { - "type": "string", - "description": "End product code of claim" - }, - "evidenceWaiverSubmitted5103": { - "type": "boolean", - "nullable": true, - "description": "If true, indicates a decision has been requested and/or a Waiver 5103 has been submitted", - "example": "false" - }, - "lighthouseId": { - "type": "string", - "nullable": true, - "description": "Claim ID in Lighthouse", - "example": "0BAEFC26-1CE4-4046-9B3C-3071055603DB" - }, - "status": { - "type": "string", - "description": "Status of claim", - "enum": [ - "PENDING", - "CLAIM_RECEIVED", - "INITIAL_REVIEW", - "EVIDENCE_GATHERING_REVIEW_DECISION", - "PREPARATION_FOR_NOTIFICATION", - "COMPLETE", - "ERRORED", - "CANCELED" - ] - } - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/veterans/{veteranId}/claims/{id}": { - "get": { - "summary": "Find claim by ID", - "tags": [ - "Claims" - ], - "operationId": "findClaimById", - "security": [ - { - "productionOauth": [ - "system/claim.read" - ] - }, - { - "sandboxOauth": [ - "system/claim.read" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Retrieves a specific claim for a Veteran", - "parameters": [ - { - "name": "id", - "in": "path", - "example": "1234", - "description": "The ID of the claim being requested", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "claim response", - "content": { - "application/json": { - "example": { - "data": { - "id": "555555555", - "type": "claim", - "attributes": { - "claimTypeCode": "400PREDSCHRG", - "claimDate": "2017-05-02", - "claimPhaseDates": { - "phaseChangeDate": "2017-10-18", - "currentPhaseBack": false, - "latestPhaseType": "COMPLETE", - "previousPhases": { - "phase7CompleteDate": "2017-10-18" - } - }, - "claimType": "Compensation", - "closeDate": "2017-10-18", - "contentions": [ - { - "name": "abnormal heart (New)" - }, - { - "name": "abscess kidney (New)" - }, - { - "name": "encephalitis lethargica residuals (New)" - }, - { - "name": "dracunculiasis (New)" - }, - { - "name": "gingivitis (New)" - }, - { - "name": "abnormal weight loss (New)" - }, - { - "name": "groin condition (New)" - }, - { - "name": "metritis (New)" - } - ], - "decisionLetterSent": false, - "developmentLetterSent": false, - "documentsNeeded": false, - "endProductCode": "404", - "evidenceWaiverSubmitted5103": false, - "errors": [ - - ], - "jurisdiction": "National Work Queue", - "lighthouseId": null, - "maxEstClaimDate": null, - "minEstClaimDate": null, - "status": "COMPLETE", - "submitterApplicationCode": "EBN", - "submitterRoleCode": "VET", - "supportingDocuments": [ - { - "documentId": "{54EF0C16-A9E7-4C3F-B876-B2C7BEC1F834}", - "documentTypeLabel": "Medical", - "originalFileName": null, - "trackedItemId": null, - "uploadDate": null - } - ], - "tempJurisdiction": null, - "trackedItems": [ - { - "closedDate": "2021-06-04", - "description": null, - "displayName": "21-4142a", - "overdue": false, - "receivedDate": null, - "requestedDate": "2021-05-05", - "status": "NO_LONGER_REQUIRED", - "suspenseDate": "2021-06-04", - "id": 293440, - "uploadsAllowed": false - }, - { - "closedDate": "2021-06-04", - "description": null, - "displayName": "Employment info needed", - "overdue": false, - "receivedDate": null, - "requestedDate": "2021-05-05", - "status": "NO_LONGER_REQUIRED", - "suspenseDate": "2021-06-04", - "id": 293443, - "uploadsAllowed": false - }, - { - "closedDate": "2021-06-04", - "description": null, - "displayName": "Accidental injury - 21-4176 needed", - "overdue": false, - "receivedDate": null, - "requestedDate": "2021-05-05", - "status": "NO_LONGER_REQUIRED", - "suspenseDate": "2021-06-04", - "id": 293444, - "uploadsAllowed": false - }, - { - "closedDate": "2021-06-04", - "description": null, - "displayName": "Buddy mentioned - No complete address", - "overdue": false, - "receivedDate": null, - "requestedDate": "2021-05-05", - "status": "NO_LONGER_REQUIRED", - "suspenseDate": "2021-06-04", - "id": 293446, - "uploadsAllowed": false - } - ] - } - } - }, - "schema": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "id", - "type", - "attributes" - ], - "additionalProperties": false, - "description": "Claim with some details for the given Veteran info", - "properties": { - "id": { - "type": "string", - "nullable": true, - "description": "Claim ID in VBMS. If a claim was submitted with Lighthouse and not successfully established upstream, it could have a null claimId.", - "example": "600131328" - }, - "type": { - "type": "string", - "example": "evss_claims" - }, - "attributes": { - "type": "object", - "additionalProperties": false, - "required": [ - "claimTypeCode", - "claimDate", - "claimPhaseDates", - "claimType", - "closeDate", - "contentions", - "decisionLetterSent", - "developmentLetterSent", - "documentsNeeded", - "endProductCode", - "evidenceWaiverSubmitted5103", - "errors", - "jurisdiction", - "lighthouseId", - "maxEstClaimDate", - "minEstClaimDate", - "status", - "submitterApplicationCode", - "submitterRoleCode", - "supportingDocuments", - "tempJurisdiction", - "trackedItems" - ], - "properties": { - "claimTypeCode": { - "type": "string", - "description": "Type Code of benefit claim", - "example": "400PREDSCHRG" - }, - "claimType": { - "type": "string", - "description": "Name of claim type", - "example": "Compensation" - }, - "contentions": { - "type": "array", - "description": "The contentions being submitted with a claim", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "abscess kidney (New)" - } - } - } - }, - "claimDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "The date a claim was filed", - "example": "2017-10-18" - }, - "claimPhaseDates": { - "type": "object", - "properties": { - "currentPhaseBack": { - "type": "boolean", - "description": "Indicates whether the current phase is moving backward." - }, - "latestPhaseType": { - "type": "string", - "enum": [ - "CLAIM_RECEIVED", - "UNDER_REVIEW", - "GATHERING_OF_EVIDENCE", - "REVIEW_OF_EVIDENCE", - "PREPARATION_FOR_DECISION", - "PENDING_DECISION_APPROVAL", - "PREPARATION_FOR_NOTIFICATION", - "COMPLETE" - ], - "nullable": true, - "description": "The most current phase for the claim" - }, - "phaseChangeDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "The date that the claim changed to its current phase", - "example": "2017-10-18" - }, - "previousPhases": { - "type": "object", - "properties": { - "phase1CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the claim received phase.", - "example": "2017-10-18" - }, - "phase2CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the initial review phase.", - "example": "2017-10-18" - }, - "phase3CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the gathering of evidence phase.", - "example": "2017-10-18" - }, - "phase4CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the reviewing of evidence phase.", - "example": "2017-10-18" - }, - "phase5CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the preparation for decision phase.", - "example": "2017-10-18" - }, - "phase6CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the pending decision approval phase.", - "example": "2017-10-18" - }, - "phase7CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the preparation for notification phase.", - "example": "2017-10-18" - }, - "phase8CompleteDate": { - "format": "date", - "type": "string", - "description": "Completed date of the completed phase.", - "example": "2017-10-18" - } - } - } - } - }, - "closeDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "Date claim was closed", - "example": "2019-09-04" - }, - "decisionLetterSent": { - "type": "boolean", - "description": "If true, a decision letter has been sent to the claimant regarding a benefit claim" - }, - "developmentLetterSent": { - "type": "boolean", - "description": "If true, a development letter has been sent to the claimant regarding a benefit claim" - }, - "documentsNeeded": { - "type": "boolean", - "description": "If true, the claim requires additional documents to be submitted" - }, - "endProductCode": { - "type": "string", - "description": "End product code of claim", - "example": "930" - }, - "evidenceWaiverSubmitted5103": { - "type": "boolean", - "nullable": true, - "description": "If true, indicates a decision has been requested and/or a Waiver 5103 has been submitted", - "example": "false" - }, - "errors": { - "type": "array", - "description": "Error details if claim is in an errored state.", - "items": { - "properties": { - "detail": { - "type": "string", - "example": "Something happened" - }, - "source": { - "type": "string", - "example": "some/error/path" - } - } - } - }, - "jurisdiction": { - "type": "string", - "description": "Current station of jurisdiction" - }, - "lighthouseId": { - "type": "string", - "nullable": true, - "description": "Claim ID in Lighthouse", - "example": "0BAEFC26-1CE4-4046-9B3C-3071055603DB" - }, - "minEstClaimDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "Minimum Estimated Claim Completion Date", - "example": "2019-06-04" - }, - "maxEstClaimDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "Maximum Estimated Claim Completion Date", - "example": "2019-09-04" - }, - "status": { - "type": "string", - "description": "Status of claim", - "enum": [ - "PENDING", - "CLAIM_RECEIVED", - "INITIAL_REVIEW", - "EVIDENCE_GATHERING_REVIEW_DECISION", - "PREPARATION_FOR_NOTIFICATION", - "COMPLETE", - "ERRORED", - "CANCELED" - ] - }, - "submitterApplicationCode": { - "type": "string", - "description": "Application Code of benefit claim submitter", - "example": "EBN" - }, - "submitterRoleCode": { - "type": "string", - "description": "Role Code of benefit claim submitter", - "example": "VET" - }, - "supportingDocuments": { - "type": "array", - "description": "Information regarding any supported documents attached to a claim", - "items": { - "properties": { - "documentId": { - "type": "string", - "description": "Unique identifier of document" - }, - "documentTypeLabel": { - "type": "string", - "nullable": true - }, - "originalFileName": { - "type": "string", - "description": "Name of document", - "nullable": true - }, - "trackedItemId": { - "type": "string", - "nullable": true - }, - "uploadDate": { - "format": "date", - "type": "string", - "description": "Date and time document was uploaded", - "nullable": true - } - } - } - }, - "tempJurisdiction": { - "type": "string", - "description": "Temporary jurisdiction of claim" - }, - "trackedItems": { - "type": "array", - "description": "", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "closedDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "Date the tracked item was closed", - "example": "2017-10-18" - }, - "description": { - "type": "string", - "nullable": true, - "description": "Description of the tracked item", - "example": "Buddy mentioned - No complete address" - }, - "requestedDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "Date the tracked item was requested", - "example": "2017-10-18" - }, - "id": { - "type": "integer", - "description": "ID of the tracked item", - "example": 293454 - }, - "displayName": { - "type": "string", - "nullable": true, - "description": "Description of the tracked item", - "example": "Buddy mentioned - No complete address" - }, - "receivedDate": { - "format": "date", - "type": "string", - "nullable": true, - "description": "Date the tracked item was received", - "example": "2017-10-18" - }, - "overdue": { - "type": "boolean", - "nullable": true, - "description": "True if the item is overdue", - "example": true - }, - "status": { - "type": "string", - "nullable": true, - "description": "Enum with the status of the tracked item", - "example": "NO_LONGER_REQUIRED", - "enum": [ - "ACCEPTED", - "INITIAL_REVIEW_COMPLETE", - "NEEDED_FROM_YOU", - "NEEDED_FROM_OTHERS", - "NO_LONGER_REQUIRED", - "SUBMITTED_AWAITING_REVIEW" - ] - }, - "suspenseDate": { - "format": "date", - "type": "string", - "nullable": true, - "example": "2017-10-18" - }, - "uploadsAllowed": { - "type": "boolean", - "example": true - } - } - } - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Resource not found", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Resource not found", - "detail": "Claim not found" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/veterans/{veteranId}/526": { - "post": { - "summary": "Submits form 526", - "tags": [ - "Disability Compensation Claims" - ], - "operationId": "post526Claim", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Automatically establishes a disability compensation claim (21-526EZ) in Veterans Benefits Management System (VBMS). \nThis endpoint generates a filled and electronically signed 526EZ form, establishes the disability claim in VBMS, and \nsubmits the form to the Veteran's eFolder.\n\nA 202 response indicates the API submission was accepted. The claim has not reached VBMS until it has a CLAIM_RECEIVED status. \nCheck claim status using the GET veterans/{veteranId}/claims/{id} endpoint.\n\n**A substantially complete 526EZ claim must include:**\n* Veteran's name\n* Sufficient service information for VA to verify the claimed service\n* At least one claimed disability or medical condition and how it relates to service\n* Veteran and/or Representative signature\n\n**Standard and fully developed claims (FDCs)**\n\n[Fully developed claims (FDCs)](https://www.va.gov/disability/how-to-file-claim/evidence-needed/fully-developed-claims/)\nare claims certified by the submitter to include all information needed for processing. These claims process faster \nthan claims submitted through the standard claim process. If a claim is certified for the FDC, but is missing needed information, \nit will be processed as a standard claim.\n\nTo certify a claim for the FDC process, set the claimProcessType to FDC_PROGRAM.\n", - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "202": { - "description": "Successful response with disability", - "content": { - "application/json": { - "example": { - "data": { - "id": "713e8c10-9e06-49ce-b311-dad87a00191a", - "type": "forms/526", - "attributes": { - "veteranIdentification": { - "currentVaEmployee": false, - "mailingAddress": { - "addressLine1": "1234 Couch Street", - "addressLine2": "Unit 4", - "addressLine3": "Room 1", - "city": "Portland", - "country": "USA", - "zipFirstFive": "41726", - "zipLastFour": "1234", - "state": "OR" - }, - "serviceNumber": "123456789", - "emailAddress": { - "email": "valid@somedomain.com", - "agreeToEmailRelatedToClaim": true - }, - "veteranNumber": { - "telephone": "5555555555", - "internationalTelephone": "+44 20 1234 5678" - } - }, - "serviceInformation": { - "servicePeriods": [ - { - "serviceBranch": "Public Health Service", - "activeDutyBeginDate": "2008-11-14", - "activeDutyEndDate": "2023-10-30", - "serviceComponent": "Active", - "separationLocationCode": "98282" - } - ], - "confinements": [ - { - "approximateBeginDate": "2018-06-04", - "approximateEndDate": "2018-07-04" - }, - { - "approximateBeginDate": "2020-06", - "approximateEndDate": "2020-07" - } - ], - "federalActivation": { - "anticipatedSeparationDate": "2023-12-22", - "activationDate": "2023-10-01" - }, - "reservesNationalGuardService": { - "obligationTermsOfService": { - "beginDate": "2019-06-04", - "endDate": "2020-06-04" - }, - "unitName": "National Guard Unit Name", - "unitAddress": "1243 pine court", - "component": "National Guard", - "unitPhone": { - "areaCode": "555", - "phoneNumber": "5555555" - }, - "receivingInactiveDutyTrainingPay": "YES" - }, - "alternateNames": [ - "john jacob", - "johnny smith" - ], - "servedInActiveCombatSince911": "NO" - }, - "disabilities": [ - { - "disabilityActionType": "NEW", - "name": "Traumatic Brain Injury", - "classificationCode": "9014", - "serviceRelevance": "ABCDEFG", - "approximateDate": "2018-03-11", - "ratedDisabilityId": "ABCDEFGHIJKLMNOPQRSTUVWX", - "diagnosticCode": 9020, - "secondaryDisabilities": [ - { - "name": "Post Traumatic Stress Disorder (PTSD) Combat - Mental Disorders", - "disabilityActionType": "SECONDARY", - "serviceRelevance": "ABCDEFGHIJKLMNOPQ", - "classificationCode": "9014", - "approximateDate": "2018-03-12", - "exposureOrEventOrInjury": "EXPOSURE" - } - ], - "isRelatedToToxicExposure": true, - "exposureOrEventOrInjury": "EXPOSURE" - }, - { - "disabilityActionType": "NEW", - "name": "Cancer - Musculoskeletal - Elbow", - "classificationCode": "9014", - "serviceRelevance": "ABCDEFG", - "approximateDate": "2018-03-02", - "ratedDisabilityId": "ABCDEFGHIJKLMNOPQRSTUVWX", - "diagnosticCode": 249470, - "isRelatedToToxicExposure": true, - "exposureOrEventOrInjury": "EXPOSURE" - }, - { - "disabilityActionType": "NEW", - "name": "Cancer - Musculoskeletal - Knee", - "classificationCode": "9014", - "serviceRelevance": "ABCDEFG", - "approximateDate": "2015", - "ratedDisabilityId": "ABCDEFGHIJKLMNOPQRSTUVWX", - "diagnosticCode": 249470, - "isRelatedToToxicExposure": true, - "exposureOrEventOrInjury": "EXPOSURE" - } - ], - "claimantCertification": true, - "claimProcessType": "STANDARD_CLAIM_PROCESS", - "changeOfAddress": { - "dates": { - "beginDate": "2023-06-04", - "endDate": "2023-12-04" - }, - "typeOfAddressChange": "TEMPORARY", - "addressLine1": "10 Peach St", - "addressLine2": "Unit 4", - "addressLine3": "Room 1", - "city": "Atlanta", - "zipFirstFive": "42220", - "zipLastFour": "9897", - "state": "GA", - "country": "USA" - }, - "homeless": { - "pointOfContact": "john stewart", - "pointOfContactNumber": { - "telephone": "5555555555", - "internationalTelephone": "+44 20 1234 5678" - }, - "currentlyHomeless": { - "homelessSituationOptions": "FLEEING_CURRENT_RESIDENCE", - "otherDescription": "ABCDEFGHIJKLM" - } - }, - "toxicExposure": { - "gulfWarHazardService": { - "servedInGulfWarHazardLocations": "YES", - "serviceDates": { - "beginDate": "2018-07", - "endDate": "2018-08" - } - }, - "herbicideHazardService": { - "servedInHerbicideHazardLocations": "YES", - "otherLocationsServed": "ABCDEFGHIJKLM", - "serviceDates": { - "beginDate": "2018-07", - "endDate": "2018-08" - } - }, - "additionalHazardExposures": { - "additionalExposures": [ - "ASBESTOS", - "SHIPBOARD_HAZARD_AND_DEFENSE" - ], - "specifyOtherExposures": "Other exposure details", - "exposureDates": { - "beginDate": "2018-07", - "endDate": "2018-08" - } - }, - "multipleExposures": [ - { - "exposureDates": { - "beginDate": "2012-12", - "endDate": "2013-07" - }, - "exposureLocation": "Guam", - "hazardExposedTo": "RADIATION" - } - ] - }, - "treatments": [ - { - "treatedDisabilityNames": [ - "Traumatic Brain Injury", - "Post Traumatic Stress Disorder (PTSD) Combat - Mental Disorders", - "Cancer - Musculoskeletal - Elbow" - ], - "center": { - "name": "Center One", - "state": "GA", - "city": "Decatur" - }, - "beginDate": "2009-03" - } - ], - "servicePay": { - "favorTrainingPay": true, - "favorMilitaryRetiredPay": false, - "receivingMilitaryRetiredPay": "NO", - "futureMilitaryRetiredPay": "YES", - "futureMilitaryRetiredPayExplanation": "ABCDEFGHIJKLMNOPQRSTUVW", - "militaryRetiredPay": { - "branchOfService": "Army", - "monthlyAmount": 840.75 - }, - "retiredStatus": "PERMANENT_DISABILITY_RETIRED_LIST", - "receivedSeparationOrSeverancePay": "NO", - "separationSeverancePay": { - "datePaymentReceived": "2022-03-12", - "branchOfService": "Naval Academy", - "preTaxAmountReceived": 379.25 - } - }, - "directDeposit": { - "accountType": "CHECKING", - "accountNumber": "ABCDEF", - "routingNumber": "123123123", - "financialInstitutionName": "Chase", - "noAccount": false - } - } - } - }, - "schema": { - "name": "data", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "id", - "type", - "attributes" - ], - "properties": { - "id": { - "type": "string", - "example": "7d0de77e-b7bd-4db7-a8d9-69a25482c80a" - }, - "type": { - "type": "string", - "example": "form/526" - }, - "attributes": { - "description": "Claims API 526 Schema", - "type": "object", - "additionalProperties": false, - "required": [ - "claimantCertification", - "claimProcessType", - "disabilities", - "serviceInformation", - "veteranIdentification" - ], - "properties": { - "claimProcessType": { - "type": "string", - "description": "Select type of claim program/process that applies to the Veteran.", - "enum": [ - "STANDARD_CLAIM_PROCESS", - "FDC_PROGRAM", - "BDD_PROGRAM" - ] - }, - "claimantCertification": { - "type": "boolean", - "description": "Claimant certifies and authorizes release of information.", - "default": false - }, - "veteranIdentification": { - "type": "object", - "additionalProperties": false, - "required": [ - "mailingAddress" - ], - "properties": { - "currentVaEmployee": { - "type": "boolean", - "description": "Set to true if Veteran is a VA employee.", - "default": false, - "nullable": true - }, - "serviceNumber": { - "type": "string", - "description": "Service identification number", - "nullable": true - }, - "emailAddress": { - "description": "Information associated with the Veteran's email address.", - "type": "object", - "nullable": true, - "properties": { - "email": { - "type": "string", - "pattern": "^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$", - "description": "The most current email address of the Veteran.", - "maxLength": 50, - "nullable": true - }, - "agreeToEmailRelatedToClaim": { - "type": "boolean", - "description": "Agreement to email information relating to this claim.", - "example": true, - "default": false, - "nullable": true - } - } - }, - "veteranNumber": { - "description": "If there is no phone number in VBMS for the Veteran, the exams will not be ordered. Including the phone number is recommended to avoid claim processing delays.", - "type": "object", - "nullable": true, - "properties": { - "telephone": { - "description": "Veteran's phone number.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "type": "string", - "description": "Veteran's international phone number.", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "mailingAddress": { - "type": "object", - "additionalProperties": false, - "required": [ - "addressLine1", - "city", - "state", - "zipFirstFive", - "country" - ], - "properties": { - "addressLine1": { - "description": "Address line 1 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's current mailing address. Must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{4}?$", - "example": "6789", - "nullable": true - }, - "state": { - "description": "State for the Veteran's current mailing address.", - "type": "string", - "pattern": "^[a-z,A-Z]{2}$", - "example": "OR" - } - } - } - } - }, - "changeOfAddress": { - "description": "If 'changeOfAddress' is included, the following attributes are required: 'typeOfAddressChange', 'dates.beginDate', 'addressLine1', 'city', 'state', 'country', 'zipFirstFive'.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "dates": { - "type": "object", - "properties": { - "beginDate": { - "description": "Begin date for the Veteran's new address.", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "type": "string", - "example": "2018-06-04" - }, - "endDate": { - "description": "Date in YYYY-MM-DD the changed address expires, if change is temporary.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-04" - } - } - }, - "typeOfAddressChange": { - "description": "Temporary or Permanent change of address. If 'TEMPORARY', 'beginDate' and 'endDate' are required.", - "type": "string", - "enum": [ - "TEMPORARY", - "PERMANENT" - ], - "example": "PERMANENT" - }, - "addressLine1": { - "description": "Address line 1 for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's new address. Value must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's new address.", - "type": "string", - "pattern": "^$|^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's new address.", - "type": "string", - "nullable": true, - "pattern": "^$|^\\d{4}?$", - "example": "6789" - }, - "state": { - "description": "State for the Veteran's new address.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR" - } - } - }, - "homeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "pointOfContact": { - "description": "Individual in direct contact with Veteran.", - "type": "string", - "nullable": true, - "minLength": 1, - "maxLength": 100, - "pattern": "^([-a-zA-Z0-9/']+( ?))*$", - "example": "Jane Doe" - }, - "pointOfContactNumber": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "telephone": { - "description": "Primary phone of point of contact.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "description": "International phone of point of contact.", - "type": "string", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "currentlyHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "homelessSituationOptions": { - "description": "Veteran's living situation.", - "type": "string", - "nullable": true, - "default": "other", - "enum": [ - "LIVING_IN_A_HOMELESS_SHELTER", - "NOT_CURRENTLY_IN_A_SHELTERED_ENVIRONMENT", - "STAYING_WITH_ANOTHER_PERSON", - "FLEEING_CURRENT_RESIDENCE", - "OTHER" - ], - "example": "FLEEING_CURRENT_RESIDENCE" - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'homelessSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - }, - "riskOfBecomingHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "livingSituationOptions": { - "type": "string", - "nullable": true, - "default": "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "enum": [ - "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "LEAVING_PUBLICLY_FUNDED_SYSTEM_OF_CARE", - "OTHER" - ] - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'livingSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - } - } - }, - "toxicExposure": { - "type": "object", - "nullable": true, - "properties": { - "gulfWarHazardService": { - "type": "object", - "nullable": true, - "description": "Toxic exposure related to the Gulf war.", - "properties": { - "servedInGulfWarHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following Gulf War hazard locations: Iraq; Kuwait; Saudi Arabia; the neutral zone between Iraq and Saudi Arabia; Bahrain; Qatar; the United Arab Emirates; Oman; Yemen; Lebanon; Somalia; Afghanistan; Israel; Egypt; Turkey; Syria; Jordan; Djibouti; Uzbekistan; the Gulf of Aden; the Gulf of Oman; the Persian Gulf; the Arabian Sea; and the Red Sea.", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "serviceDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - } - } - } - } - }, - "herbicideHazardService": { - "description": "Toxic exposure related to herbicide (Agent Orange) hazards.", - "type": "object", - "nullable": true, - "properties": { - "servedInHerbicideHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following herbicide/Agent Orange locations: Republic of Vietnam to include the 12 nautical mile territorial waters; Thailand at any United States or Royal Thai base; Laos; Cambodia at Mimot or Krek; Kampong Cham Province; Guam or American Samoa; or in the territorial waters thereof; Johnston Atoll or a ship that called at Johnston Atoll; Korean demilitarized zone; aboard (to include repeated operations and maintenance with) a C-123 aircraft known to have been used to spray an herbicide agent (during service in the Air Force and Air Force Reserves).", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "otherLocationsServed": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Other location(s) where Veteran served." - }, - "serviceDates": { - "description": "Date range for exposure in herbicide hazard location.", - "type": "object", - "nullable": true, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "additionalHazardExposures": { - "type": "object", - "nullable": true, - "description": "Additional hazardous exposures.", - "properties": { - "additionalExposures": { - "description": "Additional exposure incidents.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "enum": [ - "ASBESTOS", - "MUSTARD_GAS", - "RADIATION", - "SHIPBOARD_HAZARD_AND_DEFENSE", - "MILITARY_OCCUPATIONAL_SPECIALTY_RELATED_TOXIN", - "CONTAMINATED_WATER_AT_CAMP_LEJEUNE", - "OTHER" - ] - } - }, - "specifyOtherExposures": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Exposure to asbestos." - }, - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "multipleExposures": { - "type": "array", - "nullable": true, - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - }, - "exposureLocation": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Location where the exposure happened." - }, - "hazardExposedTo": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Hazard the Veteran was exposed to." - } - } - } - } - } - }, - "disabilities": { - "description": "Any current disabilities or symptoms the Veteran is claiming are related to their military service and/or are service-connected.", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "disabilityActionType", - "name" - ], - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury. If the disabilityActionType is 'NEW', the serviceRelevance is required.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "ratedDisabilityId": { - "description": "When submitting a contention with action type 'INCREASE', the previously rated disability id may be included.", - "type": "string", - "example": "1100583", - "nullable": true - }, - "diagnosticCode": { - "description": "If the disabilityActionType is 'NONE' or 'INCREASE', the diagnosticCode should correspond to an existing rated disability.", - "type": "integer", - "example": 9999, - "nullable": true - }, - "disabilityActionType": { - "description": "Action type requested for the disability. If 'INCREASE' or 'NONE', then 'ratedDisabilityId' and 'diagnosticCode' should be included. 'NONE' should be used when including a secondary disability.", - "type": "string", - "enum": [ - "NONE", - "NEW", - "INCREASE" - ], - "example": "NEW" - }, - "secondaryDisabilities": { - "description": "If secondaryDisability is included, the following attributes are required: 'secondaryDisability.name', 'secondaryDisability.disabilityActionType' and 'secondaryDisability.serviceRelevance'", - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "disabilityActionType": { - "description": "The status of the secondary disability.", - "type": "string", - "example": "SECONDARY", - "enum": [ - "SECONDARY" - ] - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "isRelatedToToxicExposure": { - "type": "boolean", - "description": "Is the disability related to toxic exposures? If true, related 'toxicExposure' must be included.", - "example": true, - "default": false, - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "treatments": { - "description": "Identifies the Service Treatment information of the Veteran.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "beginDate": { - "description": "Begin date for treatment. If treatment began from 2005 to present, you do not need to provide dates. Each treatment begin date must be after the first 'servicePeriod.activeDutyBeginDate'.", - "type": "string", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018", - "nullable": true - }, - "treatedDisabilityNames": { - "description": "Name(s) of disabilities treated in this time frame. Name must match 'name' of a disability included on this claim.", - "type": "array", - "nullable": true, - "maxItems": 101, - "items": { - "type": "string", - "additionalProperties": false, - "example": [ - "PTSD (post traumatic stress disorder)", - "Trauma" - ] - } - }, - "center": { - "description": "VA Medical Center(s) and Department of Defense Military Treatment Facilities where the Veteran received treatment after discharge for any claimed disabilities.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of facility Veteran was treated in. The /treatment-centers endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible treatment center names.", - "type": "string", - "nullable": true, - "pattern": "^$|(?!(?: )$)([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "Private Facility 2", - "maxLength": 100 - }, - "city": { - "description": "City of treatment facility.", - "type": "string", - "pattern": "^$|^([-a-zA-Z'.#]([-a-zA-Z'.# ])?)+$", - "example": "Portland", - "nullable": true - }, - "state": { - "description": "State of treatment facility.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR", - "nullable": true - } - } - } - } - } - }, - "serviceInformation": { - "type": "object", - "additionalProperties": false, - "required": [ - "servicePeriods" - ], - "properties": { - "servicePeriods": { - "description": "Identifies the Service dates and Branch the Veteran served in.", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "required": [ - "serviceBranch", - "serviceComponent" - ], - "properties": { - "serviceBranch": { - "description": "Branch of service during period. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "example": "Air Force" - }, - "serviceComponent": { - "type": "string", - "description": "", - "enum": [ - "Active", - "Reserves", - "National Guard" - ] - }, - "activeDutyBeginDate": { - "description": "Date started active duty.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "activeDutyEndDate": { - "description": "Date completed active duty. If in the future, 'separationLocationCode' is required.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "separationLocationCode": { - "description": "Location code for the facility the Veteran plans to separate from. Required if 'servicePeriod.activeDutyEndDate' is in the future. Code must match the values returned by the /intake-sites endpoint on the [Benefits reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "nullable": true, - "example": "98283" - } - } - } - }, - "confinements": { - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "additionalProperties": false, - "type": "object", - "properties": { - "approximateBeginDate": { - "description": "The approximateBeginDate must be after the earliest servicePeriod activeDutyBeginDate.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - }, - "approximateEndDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - } - } - } - }, - "federalActivation": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "anticipatedSeparationDate": { - "description": "Anticipated date of separation. Date must be in the future.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - }, - "activationDate": { - "description": "Date cannot be in the future and must be after the earliest servicePeriod.activeDutyBeginDate.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - } - } - }, - "reservesNationalGuardService": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "obligationTermsOfService": { - "type": "object", - "nullable": true, - "description": "If 'obligationTermsOfService' is included, the following attributes are required: 'beginDate ' and 'endDate'.", - "additionalProperties": false, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "endDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - } - } - }, - "component": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "Reserves", - "National Guard" - ] - }, - "unitName": { - "type": "string", - "nullable": true, - "pattern": "^$|([a-zA-Z0-9\\-'.,# ][a-zA-Z0-9\\-'.,# ]?)*$" - }, - "unitAddress": { - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "nullable": true - }, - "unitPhone": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "areaCode": { - "type": "string", - "nullable": true, - "maxLength": 3, - "pattern": "^$|^\\d{3}$", - "example": "555" - }, - "phoneNumber": { - "type": "string", - "nullable": true, - "maxLength": 20, - "example": "5555555" - } - } - }, - "receivingInactiveDutyTrainingPay": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "nullable": true, - "example": "YES" - } - } - }, - "alternateNames": { - "description": "List any other names under which the Veteran served, if applicable.", - "type": "array", - "nullable": true, - "maxItems": 100, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "examples": [ - "jane", - "janey lee", - "jane lee MacDonald" - ] - } - }, - "servedInActiveCombatSince911": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "description": "Did Veteran serve in a combat zone since 9-11-2001?", - "example": "YES", - "nullable": true - } - } - }, - "servicePay": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "favorTrainingPay": { - "description": "Is the Veteran waiving VA benefits to retain training pay? See item 28 on form 21-526EZ for more details. ", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "favorMilitaryRetiredPay": { - "description": "Is the Veteran waiving VA benefits to retain military retired pay? See item 26 on form 21-526EZ for more details.", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "receivingMilitaryRetiredPay": { - "description": "Is the Veteran receiving military retired pay?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPay": { - "description": "Will the Veteran receive military retired pay pay in future? \n If true, then 'futurePayExplanation' is required.", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPayExplanation": { - "description": "Explains why future pay will be received.", - "type": "string", - "example": "Will be retiring soon.", - "nullable": true - }, - "militaryRetiredPay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "monthlyAmount": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - }, - "retiredStatus": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "RETIRED", - "TEMPORARY_DISABILITY_RETIRED_LIST", - "PERMANENT_DISABILITY_RETIRED_LIST" - ] - }, - "receivedSeparationOrSeverancePay": { - "description": "Has the Veteran ever received separation pay, disability severance pay, or any other lump sum payment from their branch of service?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "separationSeverancePay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "datePaymentReceived": { - "description": "Approximate date separation pay was received. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-03-02 or 2018-03 or 2018" - }, - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "preTaxAmountReceived": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - } - } - }, - "directDeposit": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "description": "If direct deposit information is included, the following attributes are required: accountType, accountNumber, routingNumber.", - "properties": { - "accountType": { - "description": "Account type for the direct deposit.", - "type": "string", - "nullable": true, - "example": "CHECKING", - "enum": [ - "CHECKING", - "SAVINGS" - ] - }, - "accountNumber": { - "description": "Account number for the direct deposit.", - "pattern": "^(?:[a-zA-Z0-9]{4,17})?$", - "type": "string", - "nullable": true, - "example": "123123123123" - }, - "routingNumber": { - "description": "Routing number for the direct deposit.", - "type": "string", - "nullable": true, - "pattern": "^(?:\\d{9})?$", - "example": "123123123" - }, - "financialInstitutionName": { - "description": "Provide the name of the financial institution where the Veteran wants the direct deposit.", - "maxLength": 35, - "type": "string", - "nullable": true, - "example": "Some Bank" - }, - "noAccount": { - "type": "boolean", - "nullable": true, - "description": "Claimant certifies that they do not have an account with a financial institution or certified payment agent.", - "default": false - } - } - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "status": "401", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "status": { - "type": "string", - "description": "HTTP error status code" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Unprocessable entity", - "content": { - "application/json": { - "examples": { - "Violates JSON Schema": { - "value": { - "errors": [ - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key claimProcessType", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - }, - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key disabilities", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - }, - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key serviceInformation", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - }, - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key veteranIdentification", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - } - ] - } - }, - "Not a JSON Object": { - "value": { - "errors": [ - { - "title": "Unprocessable entity", - "status": "422", - "detail": "The request body is not a valid JSON object: This is not valid JSON", - "source": { - "pointer": null - } - } - ] - } - } - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "status", - "detail" - ], - "properties": { - "status": { - "type": "string", - "description": "HTTP error code" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "pointer": { - "type": "string" - } - }, - "title": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "attributes", - null - ], - "properties": { - "attributes": { - "$schema": "http://json-schema.org/draft-07/schema#", - "description": "Claims API 526 Schema", - "type": "object", - "additionalProperties": false, - "required": [ - "claimantCertification", - "claimProcessType", - "disabilities", - "serviceInformation", - "veteranIdentification" - ], - "properties": { - "claimProcessType": { - "type": "string", - "description": "Select type of claim program/process that applies to the Veteran.", - "enum": [ - "STANDARD_CLAIM_PROCESS", - "FDC_PROGRAM", - "BDD_PROGRAM" - ] - }, - "claimantCertification": { - "type": "boolean", - "description": "Claimant certifies and authorizes release of information.", - "default": false - }, - "veteranIdentification": { - "type": "object", - "additionalProperties": false, - "required": [ - "mailingAddress" - ], - "properties": { - "currentVaEmployee": { - "type": "boolean", - "description": "Set to true if Veteran is a VA employee.", - "default": false, - "nullable": true - }, - "serviceNumber": { - "type": "string", - "description": "Service identification number", - "nullable": true - }, - "emailAddress": { - "description": "Information associated with the Veteran's email address.", - "type": "object", - "nullable": true, - "properties": { - "email": { - "type": "string", - "pattern": "^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$", - "description": "The most current email address of the Veteran.", - "maxLength": 50, - "nullable": true - }, - "agreeToEmailRelatedToClaim": { - "type": "boolean", - "description": "Agreement to email information relating to this claim.", - "example": true, - "default": false, - "nullable": true - } - } - }, - "veteranNumber": { - "description": "If there is no phone number in VBMS for the Veteran, the exams will not be ordered. Including the phone number is recommended to avoid claim processing delays.", - "type": "object", - "nullable": true, - "properties": { - "telephone": { - "description": "Veteran's phone number.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "type": "string", - "description": "Veteran's international phone number.", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "mailingAddress": { - "type": "object", - "additionalProperties": false, - "required": [ - "addressLine1", - "city", - "state", - "zipFirstFive", - "country" - ], - "properties": { - "addressLine1": { - "description": "Address line 1 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's current mailing address. Must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{4}?$", - "example": "6789", - "nullable": true - }, - "state": { - "description": "State for the Veteran's current mailing address.", - "type": "string", - "pattern": "^[a-z,A-Z]{2}$", - "example": "OR" - } - } - } - } - }, - "changeOfAddress": { - "description": "If 'changeOfAddress' is included, the following attributes are required: 'typeOfAddressChange', 'dates.beginDate', 'addressLine1', 'city', 'state', 'country', 'zipFirstFive'.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "dates": { - "type": "object", - "properties": { - "beginDate": { - "description": "Begin date for the Veteran's new address.", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "type": "string", - "example": "2018-06-04" - }, - "endDate": { - "description": "Date in YYYY-MM-DD the changed address expires, if change is temporary.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-04" - } - } - }, - "typeOfAddressChange": { - "description": "Temporary or Permanent change of address. If 'TEMPORARY', 'beginDate' and 'endDate' are required.", - "type": "string", - "enum": [ - "TEMPORARY", - "PERMANENT" - ], - "example": "PERMANENT" - }, - "addressLine1": { - "description": "Address line 1 for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's new address. Value must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's new address.", - "type": "string", - "pattern": "^$|^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's new address.", - "type": "string", - "nullable": true, - "pattern": "^$|^\\d{4}?$", - "example": "6789" - }, - "state": { - "description": "State for the Veteran's new address.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR" - } - } - }, - "homeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "pointOfContact": { - "description": "Individual in direct contact with Veteran.", - "type": "string", - "nullable": true, - "minLength": 1, - "maxLength": 100, - "pattern": "^([-a-zA-Z0-9/']+( ?))*$", - "example": "Jane Doe" - }, - "pointOfContactNumber": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "telephone": { - "description": "Primary phone of point of contact.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "description": "International phone of point of contact.", - "type": "string", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "currentlyHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "homelessSituationOptions": { - "description": "Veteran's living situation.", - "type": "string", - "nullable": true, - "default": "other", - "enum": [ - "LIVING_IN_A_HOMELESS_SHELTER", - "NOT_CURRENTLY_IN_A_SHELTERED_ENVIRONMENT", - "STAYING_WITH_ANOTHER_PERSON", - "FLEEING_CURRENT_RESIDENCE", - "OTHER" - ], - "example": "FLEEING_CURRENT_RESIDENCE" - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'homelessSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - }, - "riskOfBecomingHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "livingSituationOptions": { - "type": "string", - "nullable": true, - "default": "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "enum": [ - "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "LEAVING_PUBLICLY_FUNDED_SYSTEM_OF_CARE", - "OTHER" - ] - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'livingSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - } - } - }, - "toxicExposure": { - "type": "object", - "nullable": true, - "properties": { - "gulfWarHazardService": { - "type": "object", - "nullable": true, - "description": "Toxic exposure related to the Gulf war.", - "properties": { - "servedInGulfWarHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following Gulf War hazard locations: Iraq; Kuwait; Saudi Arabia; the neutral zone between Iraq and Saudi Arabia; Bahrain; Qatar; the United Arab Emirates; Oman; Yemen; Lebanon; Somalia; Afghanistan; Israel; Egypt; Turkey; Syria; Jordan; Djibouti; Uzbekistan; the Gulf of Aden; the Gulf of Oman; the Persian Gulf; the Arabian Sea; and the Red Sea.", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "serviceDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - } - } - } - } - }, - "herbicideHazardService": { - "description": "Toxic exposure related to herbicide (Agent Orange) hazards.", - "type": "object", - "nullable": true, - "properties": { - "servedInHerbicideHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following herbicide/Agent Orange locations: Republic of Vietnam to include the 12 nautical mile territorial waters; Thailand at any United States or Royal Thai base; Laos; Cambodia at Mimot or Krek; Kampong Cham Province; Guam or American Samoa; or in the territorial waters thereof; Johnston Atoll or a ship that called at Johnston Atoll; Korean demilitarized zone; aboard (to include repeated operations and maintenance with) a C-123 aircraft known to have been used to spray an herbicide agent (during service in the Air Force and Air Force Reserves).", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "otherLocationsServed": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Other location(s) where Veteran served." - }, - "serviceDates": { - "description": "Date range for exposure in herbicide hazard location.", - "type": "object", - "nullable": true, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "additionalHazardExposures": { - "type": "object", - "nullable": true, - "description": "Additional hazardous exposures.", - "properties": { - "additionalExposures": { - "description": "Additional exposure incidents.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "enum": [ - "ASBESTOS", - "MUSTARD_GAS", - "RADIATION", - "SHIPBOARD_HAZARD_AND_DEFENSE", - "MILITARY_OCCUPATIONAL_SPECIALTY_RELATED_TOXIN", - "CONTAMINATED_WATER_AT_CAMP_LEJEUNE", - "OTHER" - ] - } - }, - "specifyOtherExposures": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Exposure to asbestos." - }, - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "multipleExposures": { - "type": "array", - "nullable": true, - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - }, - "exposureLocation": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Location where the exposure happened." - }, - "hazardExposedTo": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Hazard the Veteran was exposed to." - } - } - } - } - } - }, - "disabilities": { - "description": "Any current disabilities or symptoms the Veteran is claiming are related to their military service and/or are service-connected.", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "disabilityActionType", - "name" - ], - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury. If the disabilityActionType is 'NEW', the serviceRelevance is required.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "ratedDisabilityId": { - "description": "When submitting a contention with action type 'INCREASE', the previously rated disability id may be included.", - "type": "string", - "example": "1100583", - "nullable": true - }, - "diagnosticCode": { - "description": "If the disabilityActionType is 'NONE' or 'INCREASE', the diagnosticCode should correspond to an existing rated disability.", - "type": "integer", - "example": 9999, - "nullable": true - }, - "disabilityActionType": { - "description": "Action type requested for the disability. If 'INCREASE' or 'NONE', then 'ratedDisabilityId' and 'diagnosticCode' should be included. 'NONE' should be used when including a secondary disability.", - "type": "string", - "enum": [ - "NONE", - "NEW", - "INCREASE" - ], - "example": "NEW" - }, - "secondaryDisabilities": { - "description": "If secondaryDisability is included, the following attributes are required: 'secondaryDisability.name', 'secondaryDisability.disabilityActionType' and 'secondaryDisability.serviceRelevance'", - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "disabilityActionType": { - "description": "The status of the secondary disability.", - "type": "string", - "example": "SECONDARY", - "enum": [ - "SECONDARY" - ] - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "isRelatedToToxicExposure": { - "type": "boolean", - "description": "Is the disability related to toxic exposures? If true, related 'toxicExposure' must be included.", - "example": true, - "default": false, - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "treatments": { - "description": "Identifies the Service Treatment information of the Veteran.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "beginDate": { - "description": "Begin date for treatment. If treatment began from 2005 to present, you do not need to provide dates. Each treatment begin date must be after the first 'servicePeriod.activeDutyBeginDate'.", - "type": "string", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018", - "nullable": true - }, - "treatedDisabilityNames": { - "description": "Name(s) of disabilities treated in this time frame. Name must match 'name' of a disability included on this claim.", - "type": "array", - "nullable": true, - "maxItems": 101, - "items": { - "type": "string", - "additionalProperties": false, - "example": [ - "PTSD (post traumatic stress disorder)", - "Trauma" - ] - } - }, - "center": { - "description": "VA Medical Center(s) and Department of Defense Military Treatment Facilities where the Veteran received treatment after discharge for any claimed disabilities.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of facility Veteran was treated in. The /treatment-centers endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible treatment center names.", - "type": "string", - "nullable": true, - "pattern": "^$|(?!(?: )$)([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "Private Facility 2", - "maxLength": 100 - }, - "city": { - "description": "City of treatment facility.", - "type": "string", - "pattern": "^$|^([-a-zA-Z'.#]([-a-zA-Z'.# ])?)+$", - "example": "Portland", - "nullable": true - }, - "state": { - "description": "State of treatment facility.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR", - "nullable": true - } - } - } - } - } - }, - "serviceInformation": { - "type": "object", - "additionalProperties": false, - "required": [ - "servicePeriods" - ], - "properties": { - "servicePeriods": { - "description": "Identifies the Service dates and Branch the Veteran served in.", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "required": [ - "serviceBranch", - "serviceComponent" - ], - "properties": { - "serviceBranch": { - "description": "Branch of service during period. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "example": "Air Force" - }, - "serviceComponent": { - "type": "string", - "description": "", - "enum": [ - "Active", - "Reserves", - "National Guard" - ] - }, - "activeDutyBeginDate": { - "description": "Date started active duty.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "activeDutyEndDate": { - "description": "Date completed active duty. If in the future, 'separationLocationCode' is required.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "separationLocationCode": { - "description": "Location code for the facility the Veteran plans to separate from. Required if 'servicePeriod.activeDutyEndDate' is in the future. Code must match the values returned by the /intake-sites endpoint on the [Benefits reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "nullable": true, - "example": "98283" - } - } - } - }, - "confinements": { - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "additionalProperties": false, - "type": "object", - "properties": { - "approximateBeginDate": { - "description": "The approximateBeginDate must be after the earliest servicePeriod activeDutyBeginDate.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - }, - "approximateEndDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - } - } - } - }, - "federalActivation": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "anticipatedSeparationDate": { - "description": "Anticipated date of separation. Date must be in the future.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - }, - "activationDate": { - "description": "Date cannot be in the future and must be after the earliest servicePeriod.activeDutyBeginDate.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - } - } - }, - "reservesNationalGuardService": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "obligationTermsOfService": { - "type": "object", - "nullable": true, - "description": "If 'obligationTermsOfService' is included, the following attributes are required: 'beginDate ' and 'endDate'.", - "additionalProperties": false, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "endDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - } - } - }, - "component": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "Reserves", - "National Guard" - ] - }, - "unitName": { - "type": "string", - "nullable": true, - "pattern": "^$|([a-zA-Z0-9\\-'.,# ][a-zA-Z0-9\\-'.,# ]?)*$" - }, - "unitAddress": { - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "nullable": true - }, - "unitPhone": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "areaCode": { - "type": "string", - "nullable": true, - "maxLength": 3, - "pattern": "^$|^\\d{3}$", - "example": "555" - }, - "phoneNumber": { - "type": "string", - "nullable": true, - "maxLength": 20, - "example": "5555555" - } - } - }, - "receivingInactiveDutyTrainingPay": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "nullable": true, - "example": "YES" - } - } - }, - "alternateNames": { - "description": "List any other names under which the Veteran served, if applicable.", - "type": "array", - "nullable": true, - "maxItems": 100, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "examples": [ - "jane", - "janey lee", - "jane lee MacDonald" - ] - } - }, - "servedInActiveCombatSince911": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "description": "Did Veteran serve in a combat zone since 9-11-2001?", - "example": "YES", - "nullable": true - } - } - }, - "servicePay": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "favorTrainingPay": { - "description": "Is the Veteran waiving VA benefits to retain training pay? See item 28 on form 21-526EZ for more details. ", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "favorMilitaryRetiredPay": { - "description": "Is the Veteran waiving VA benefits to retain military retired pay? See item 26 on form 21-526EZ for more details.", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "receivingMilitaryRetiredPay": { - "description": "Is the Veteran receiving military retired pay?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPay": { - "description": "Will the Veteran receive military retired pay pay in future? \n If true, then 'futurePayExplanation' is required.", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPayExplanation": { - "description": "Explains why future pay will be received.", - "type": "string", - "example": "Will be retiring soon.", - "nullable": true - }, - "militaryRetiredPay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "monthlyAmount": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - }, - "retiredStatus": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "RETIRED", - "TEMPORARY_DISABILITY_RETIRED_LIST", - "PERMANENT_DISABILITY_RETIRED_LIST" - ] - }, - "receivedSeparationOrSeverancePay": { - "description": "Has the Veteran ever received separation pay, disability severance pay, or any other lump sum payment from their branch of service?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "separationSeverancePay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "datePaymentReceived": { - "description": "Approximate date separation pay was received. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-03-02 or 2018-03 or 2018" - }, - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "preTaxAmountReceived": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - } - } - }, - "directDeposit": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "description": "If direct deposit information is included, the following attributes are required: accountType, accountNumber, routingNumber.", - "properties": { - "accountType": { - "description": "Account type for the direct deposit.", - "type": "string", - "nullable": true, - "example": "CHECKING", - "enum": [ - "CHECKING", - "SAVINGS" - ] - }, - "accountNumber": { - "description": "Account number for the direct deposit.", - "pattern": "^(?:[a-zA-Z0-9]{4,17})?$", - "type": "string", - "nullable": true, - "example": "123123123123" - }, - "routingNumber": { - "description": "Routing number for the direct deposit.", - "type": "string", - "nullable": true, - "pattern": "^(?:\\d{9})?$", - "example": "123123123" - }, - "financialInstitutionName": { - "description": "Provide the name of the financial institution where the Veteran wants the direct deposit.", - "maxLength": 35, - "type": "string", - "nullable": true, - "example": "Some Bank" - }, - "noAccount": { - "type": "boolean", - "nullable": true, - "description": "Claimant certifies that they do not have an account with a financial institution or certified payment agent.", - "default": false - } - } - } - } - } - } - } - }, - "example": { - "data": { - "type": "form/526", - "attributes": { - "claimantCertification": true, - "claimProcessType": "STANDARD_CLAIM_PROCESS", - "veteranIdentification": { - "currentVaEmployee": false, - "mailingAddress": { - "addressLine1": "123 Main Street", - "addressLine2": "Unit 1", - "addressLine3": "Room 2", - "city": "Portland", - "country": "USA", - "zipFirstFive": "41726", - "zipLastFour": "1234", - "state": "OR" - }, - "serviceNumber": "123456789", - "emailAddress": { - "email": "valid@somedomain.com", - "agreeToEmailRelatedToClaim": true - }, - "veteranNumber": { - "telephone": "5555555555" - } - }, - "changeOfAddress": { - "dates": { - "beginDate": "2025-06-04", - "endDate": "2026-06-04" - }, - "typeOfAddressChange": "TEMPORARY", - "addressLine1": "456 Main Street", - "addressLine2": "Unit 3", - "addressLine3": "Room 4", - "city": "Atlanta", - "zipFirstFive": "42220", - "zipLastFour": "9897", - "state": "GA", - "country": "USA" - }, - "homeless": { - "pointOfContact": "John Doe", - "pointOfContactNumber": { - "telephone": "5555555555" - }, - "currentlyHomeless": { - "homelessSituationOptions": "OTHER", - "otherDescription": "Other living situation" - } - }, - "toxicExposure": { - "gulfWarHazardService": { - "servedInGulfWarHazardLocations": "YES", - "serviceDates": { - "beginDate": "1999-07", - "endDate": "2005-01" - } - }, - "herbicideHazardService": { - "servedInHerbicideHazardLocations": "YES", - "otherLocationsServed": "Guam", - "serviceDates": { - "beginDate": "2002-03", - "endDate": "2004-10" - } - }, - "additionalHazardExposures": { - "additionalExposures": [ - "ASBESTOS", - "SHIPBOARD_HAZARD_AND_DEFENSE" - ], - "specifyOtherExposures": "Other exposure details", - "exposureDates": { - "beginDate": "2011-07", - "endDate": "2013-10" - } - }, - "multipleExposures": [ - { - "exposureDates": { - "beginDate": "2012-12", - "endDate": "2013-07" - }, - "exposureLocation": "Guam", - "hazardExposedTo": "Hazard" - } - ] - }, - "disabilities": [ - { - "disabilityActionType": "NEW", - "name": "Hearing Loss", - "serviceRelevance": "Heavy equipment operator in service", - "approximateDate": "1988-07", - "isRelatedToToxicExposure": false, - "exposureOrEventOrInjury": "Noise" - } - ], - "treatments": [ - { - "treatedDisabilityNames": [ - "Hearing Loss" - ], - "center": { - "name": "Center One", - "state": "GA", - "city": "Decatur" - }, - "beginDate": "2009-04" - }, - { - "treatedDisabilityNames": [ - "Hearing Loss" - ], - "center": { - "name": "Center One", - "state": "GA", - "city": "Decatur" - }, - "beginDate": "2009-03" - } - ], - "serviceInformation": { - "servicePeriods": [ - { - "serviceBranch": "Air Force", - "activeDutyBeginDate": "2008-11-14", - "activeDutyEndDate": "2023-10-30", - "serviceComponent": "Active", - "separationLocationCode": "98282" - } - ], - "confinements": [ - { - "approximateBeginDate": "2016-06-11", - "approximateEndDate": "2016-09-11" - }, - { - "approximateBeginDate": "2019-06", - "approximateEndDate": "2019-07" - } - ], - "federalActivation": { - "anticipatedSeparationDate": "2023-12-03", - "activationDate": "2023-02-10" - }, - "reservesNationalGuardService": { - "obligationTermsOfService": { - "beginDate": "2016-11-24", - "endDate": "2017-11-17" - }, - "unitName": "National Guard Unit Name", - "unitAddress": "1243 pine court", - "component": "National Guard", - "unitPhone": { - "areaCode": "555", - "phoneNumber": "5555555" - }, - "receivingInactiveDutyTrainingPay": "YES" - }, - "servedInActiveCombatSince911": "NO" - }, - "servicePay": { - "favorTrainingPay": true, - "favorMilitaryRetiredPay": false, - "receivingMilitaryRetiredPay": "NO", - "futureMilitaryRetiredPay": "YES", - "futureMilitaryRetiredPayExplanation": "Explanation of future military retired pay", - "militaryRetiredPay": { - "branchOfService": "Army", - "monthlyAmount": 840.75 - }, - "retiredStatus": "PERMANENT_DISABILITY_RETIRED_LIST", - "receivedSeparationOrSeverancePay": "NO", - "separationSeverancePay": { - "datePaymentReceived": "2018-07-31", - "branchOfService": "Naval Academy", - "preTaxAmountReceived": 379.25 - } - }, - "directDeposit": { - "accountType": "CHECKING", - "accountNumber": "123123123123", - "routingNumber": "123456789", - "financialInstitutionName": "Chase", - "noAccount": false - } - } - } - } - } - } - }, - "required": true - } - } - }, - "/veterans/{veteranId}/526/validate": { - "post": { - "summary": "Validates a 526 claim form submission.", - "tags": [ - "Disability Compensation Claims" - ], - "operationId": "post526ClaimValidate", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Validates a request for a disability compensation claim submission (21-526EZ).\nThis endpoint can be used to test the request parameters for your /526 submission.\n", - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response with disability", - "content": { - "application/json": { - "example": { - "data": { - "type": "claims_api_auto_established_claim_validation", - "attributes": { - "status": "valid" - } - } - }, - "schema": { - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string" - }, - "attributes": { - "type": "object", - "additionalProperties": false, - "required": [ - "status" - ], - "properties": { - "status": { - "type": "string", - "enum": [ - "valid" - ], - "description": "Return whether or not whether or not the payload is valid" - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "status": "401", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "status": { - "type": "string", - "description": "HTTP error status code" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Unprocessable entity", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key claimProcessType", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - }, - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key disabilities", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - }, - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key serviceInformation", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - }, - { - "title": "Unprocessable entity", - "detail": "The property / did not contain the required key veteranIdentification", - "status": "422", - "source": { - "pointer": "data/attributes/" - } - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "status", - "detail" - ], - "properties": { - "status": { - "type": "string", - "description": "HTTP error code" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "pointer": { - "type": "string" - } - }, - "title": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "attributes", - null - ], - "properties": { - "attributes": { - "$schema": "http://json-schema.org/draft-07/schema#", - "description": "Claims API 526 Schema", - "type": "object", - "additionalProperties": false, - "required": [ - "claimantCertification", - "claimProcessType", - "disabilities", - "serviceInformation", - "veteranIdentification" - ], - "properties": { - "claimProcessType": { - "type": "string", - "description": "Select type of claim program/process that applies to the Veteran.", - "enum": [ - "STANDARD_CLAIM_PROCESS", - "FDC_PROGRAM", - "BDD_PROGRAM" - ] - }, - "claimantCertification": { - "type": "boolean", - "description": "Claimant certifies and authorizes release of information.", - "default": false - }, - "veteranIdentification": { - "type": "object", - "additionalProperties": false, - "required": [ - "mailingAddress" - ], - "properties": { - "currentVaEmployee": { - "type": "boolean", - "description": "Set to true if Veteran is a VA employee.", - "default": false, - "nullable": true - }, - "serviceNumber": { - "type": "string", - "description": "Service identification number", - "nullable": true - }, - "emailAddress": { - "description": "Information associated with the Veteran's email address.", - "type": "object", - "nullable": true, - "properties": { - "email": { - "type": "string", - "pattern": "^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$", - "description": "The most current email address of the Veteran.", - "maxLength": 50, - "nullable": true - }, - "agreeToEmailRelatedToClaim": { - "type": "boolean", - "description": "Agreement to email information relating to this claim.", - "example": true, - "default": false, - "nullable": true - } - } - }, - "veteranNumber": { - "description": "If there is no phone number in VBMS for the Veteran, the exams will not be ordered. Including the phone number is recommended to avoid claim processing delays.", - "type": "object", - "nullable": true, - "properties": { - "telephone": { - "description": "Veteran's phone number.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "type": "string", - "description": "Veteran's international phone number.", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "mailingAddress": { - "type": "object", - "additionalProperties": false, - "required": [ - "addressLine1", - "city", - "state", - "zipFirstFive", - "country" - ], - "properties": { - "addressLine1": { - "description": "Address line 1 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's current mailing address. Must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{4}?$", - "example": "6789", - "nullable": true - }, - "state": { - "description": "State for the Veteran's current mailing address.", - "type": "string", - "pattern": "^[a-z,A-Z]{2}$", - "example": "OR" - } - } - } - } - }, - "changeOfAddress": { - "description": "If 'changeOfAddress' is included, the following attributes are required: 'typeOfAddressChange', 'dates.beginDate', 'addressLine1', 'city', 'state', 'country', 'zipFirstFive'.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "dates": { - "type": "object", - "properties": { - "beginDate": { - "description": "Begin date for the Veteran's new address.", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "type": "string", - "example": "2018-06-04" - }, - "endDate": { - "description": "Date in YYYY-MM-DD the changed address expires, if change is temporary.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-04" - } - } - }, - "typeOfAddressChange": { - "description": "Temporary or Permanent change of address. If 'TEMPORARY', 'beginDate' and 'endDate' are required.", - "type": "string", - "enum": [ - "TEMPORARY", - "PERMANENT" - ], - "example": "PERMANENT" - }, - "addressLine1": { - "description": "Address line 1 for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's new address. Value must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's new address.", - "type": "string", - "pattern": "^$|^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's new address.", - "type": "string", - "nullable": true, - "pattern": "^$|^\\d{4}?$", - "example": "6789" - }, - "state": { - "description": "State for the Veteran's new address.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR" - } - } - }, - "homeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "pointOfContact": { - "description": "Individual in direct contact with Veteran.", - "type": "string", - "nullable": true, - "minLength": 1, - "maxLength": 100, - "pattern": "^([-a-zA-Z0-9/']+( ?))*$", - "example": "Jane Doe" - }, - "pointOfContactNumber": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "telephone": { - "description": "Primary phone of point of contact.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "description": "International phone of point of contact.", - "type": "string", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "currentlyHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "homelessSituationOptions": { - "description": "Veteran's living situation.", - "type": "string", - "nullable": true, - "default": "other", - "enum": [ - "LIVING_IN_A_HOMELESS_SHELTER", - "NOT_CURRENTLY_IN_A_SHELTERED_ENVIRONMENT", - "STAYING_WITH_ANOTHER_PERSON", - "FLEEING_CURRENT_RESIDENCE", - "OTHER" - ], - "example": "FLEEING_CURRENT_RESIDENCE" - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'homelessSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - }, - "riskOfBecomingHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "livingSituationOptions": { - "type": "string", - "nullable": true, - "default": "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "enum": [ - "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "LEAVING_PUBLICLY_FUNDED_SYSTEM_OF_CARE", - "OTHER" - ] - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'livingSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - } - } - }, - "toxicExposure": { - "type": "object", - "nullable": true, - "properties": { - "gulfWarHazardService": { - "type": "object", - "nullable": true, - "description": "Toxic exposure related to the Gulf war.", - "properties": { - "servedInGulfWarHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following Gulf War hazard locations: Iraq; Kuwait; Saudi Arabia; the neutral zone between Iraq and Saudi Arabia; Bahrain; Qatar; the United Arab Emirates; Oman; Yemen; Lebanon; Somalia; Afghanistan; Israel; Egypt; Turkey; Syria; Jordan; Djibouti; Uzbekistan; the Gulf of Aden; the Gulf of Oman; the Persian Gulf; the Arabian Sea; and the Red Sea.", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "serviceDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - } - } - } - } - }, - "herbicideHazardService": { - "description": "Toxic exposure related to herbicide (Agent Orange) hazards.", - "type": "object", - "nullable": true, - "properties": { - "servedInHerbicideHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following herbicide/Agent Orange locations: Republic of Vietnam to include the 12 nautical mile territorial waters; Thailand at any United States or Royal Thai base; Laos; Cambodia at Mimot or Krek; Kampong Cham Province; Guam or American Samoa; or in the territorial waters thereof; Johnston Atoll or a ship that called at Johnston Atoll; Korean demilitarized zone; aboard (to include repeated operations and maintenance with) a C-123 aircraft known to have been used to spray an herbicide agent (during service in the Air Force and Air Force Reserves).", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "otherLocationsServed": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Other location(s) where Veteran served." - }, - "serviceDates": { - "description": "Date range for exposure in herbicide hazard location.", - "type": "object", - "nullable": true, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "additionalHazardExposures": { - "type": "object", - "nullable": true, - "description": "Additional hazardous exposures.", - "properties": { - "additionalExposures": { - "description": "Additional exposure incidents.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "enum": [ - "ASBESTOS", - "MUSTARD_GAS", - "RADIATION", - "SHIPBOARD_HAZARD_AND_DEFENSE", - "MILITARY_OCCUPATIONAL_SPECIALTY_RELATED_TOXIN", - "CONTAMINATED_WATER_AT_CAMP_LEJEUNE", - "OTHER" - ] - } - }, - "specifyOtherExposures": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Exposure to asbestos." - }, - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "multipleExposures": { - "type": "array", - "nullable": true, - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - }, - "exposureLocation": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Location where the exposure happened." - }, - "hazardExposedTo": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Hazard the Veteran was exposed to." - } - } - } - } - } - }, - "disabilities": { - "description": "Any current disabilities or symptoms the Veteran is claiming are related to their military service and/or are service-connected.", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "disabilityActionType", - "name" - ], - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury. If the disabilityActionType is 'NEW', the serviceRelevance is required.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "ratedDisabilityId": { - "description": "When submitting a contention with action type 'INCREASE', the previously rated disability id may be included.", - "type": "string", - "example": "1100583", - "nullable": true - }, - "diagnosticCode": { - "description": "If the disabilityActionType is 'NONE' or 'INCREASE', the diagnosticCode should correspond to an existing rated disability.", - "type": "integer", - "example": 9999, - "nullable": true - }, - "disabilityActionType": { - "description": "Action type requested for the disability. If 'INCREASE' or 'NONE', then 'ratedDisabilityId' and 'diagnosticCode' should be included. 'NONE' should be used when including a secondary disability.", - "type": "string", - "enum": [ - "NONE", - "NEW", - "INCREASE" - ], - "example": "NEW" - }, - "secondaryDisabilities": { - "description": "If secondaryDisability is included, the following attributes are required: 'secondaryDisability.name', 'secondaryDisability.disabilityActionType' and 'secondaryDisability.serviceRelevance'", - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "disabilityActionType": { - "description": "The status of the secondary disability.", - "type": "string", - "example": "SECONDARY", - "enum": [ - "SECONDARY" - ] - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "isRelatedToToxicExposure": { - "type": "boolean", - "description": "Is the disability related to toxic exposures? If true, related 'toxicExposure' must be included.", - "example": true, - "default": false, - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "treatments": { - "description": "Identifies the Service Treatment information of the Veteran.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "beginDate": { - "description": "Begin date for treatment. If treatment began from 2005 to present, you do not need to provide dates. Each treatment begin date must be after the first 'servicePeriod.activeDutyBeginDate'.", - "type": "string", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018", - "nullable": true - }, - "treatedDisabilityNames": { - "description": "Name(s) of disabilities treated in this time frame. Name must match 'name' of a disability included on this claim.", - "type": "array", - "nullable": true, - "maxItems": 101, - "items": { - "type": "string", - "additionalProperties": false, - "example": [ - "PTSD (post traumatic stress disorder)", - "Trauma" - ] - } - }, - "center": { - "description": "VA Medical Center(s) and Department of Defense Military Treatment Facilities where the Veteran received treatment after discharge for any claimed disabilities.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of facility Veteran was treated in. The /treatment-centers endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible treatment center names.", - "type": "string", - "nullable": true, - "pattern": "^$|(?!(?: )$)([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "Private Facility 2", - "maxLength": 100 - }, - "city": { - "description": "City of treatment facility.", - "type": "string", - "pattern": "^$|^([-a-zA-Z'.#]([-a-zA-Z'.# ])?)+$", - "example": "Portland", - "nullable": true - }, - "state": { - "description": "State of treatment facility.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR", - "nullable": true - } - } - } - } - } - }, - "serviceInformation": { - "type": "object", - "additionalProperties": false, - "required": [ - "servicePeriods" - ], - "properties": { - "servicePeriods": { - "description": "Identifies the Service dates and Branch the Veteran served in.", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "required": [ - "serviceBranch", - "serviceComponent" - ], - "properties": { - "serviceBranch": { - "description": "Branch of service during period. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "example": "Air Force" - }, - "serviceComponent": { - "type": "string", - "description": "", - "enum": [ - "Active", - "Reserves", - "National Guard" - ] - }, - "activeDutyBeginDate": { - "description": "Date started active duty.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "activeDutyEndDate": { - "description": "Date completed active duty. If in the future, 'separationLocationCode' is required.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "separationLocationCode": { - "description": "Location code for the facility the Veteran plans to separate from. Required if 'servicePeriod.activeDutyEndDate' is in the future. Code must match the values returned by the /intake-sites endpoint on the [Benefits reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "nullable": true, - "example": "98283" - } - } - } - }, - "confinements": { - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "additionalProperties": false, - "type": "object", - "properties": { - "approximateBeginDate": { - "description": "The approximateBeginDate must be after the earliest servicePeriod activeDutyBeginDate.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - }, - "approximateEndDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - } - } - } - }, - "federalActivation": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "anticipatedSeparationDate": { - "description": "Anticipated date of separation. Date must be in the future.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - }, - "activationDate": { - "description": "Date cannot be in the future and must be after the earliest servicePeriod.activeDutyBeginDate.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - } - } - }, - "reservesNationalGuardService": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "obligationTermsOfService": { - "type": "object", - "nullable": true, - "description": "If 'obligationTermsOfService' is included, the following attributes are required: 'beginDate ' and 'endDate'.", - "additionalProperties": false, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "endDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - } - } - }, - "component": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "Reserves", - "National Guard" - ] - }, - "unitName": { - "type": "string", - "nullable": true, - "pattern": "^$|([a-zA-Z0-9\\-'.,# ][a-zA-Z0-9\\-'.,# ]?)*$" - }, - "unitAddress": { - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "nullable": true - }, - "unitPhone": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "areaCode": { - "type": "string", - "nullable": true, - "maxLength": 3, - "pattern": "^$|^\\d{3}$", - "example": "555" - }, - "phoneNumber": { - "type": "string", - "nullable": true, - "maxLength": 20, - "example": "5555555" - } - } - }, - "receivingInactiveDutyTrainingPay": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "nullable": true, - "example": "YES" - } - } - }, - "alternateNames": { - "description": "List any other names under which the Veteran served, if applicable.", - "type": "array", - "nullable": true, - "maxItems": 100, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "examples": [ - "jane", - "janey lee", - "jane lee MacDonald" - ] - } - }, - "servedInActiveCombatSince911": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "description": "Did Veteran serve in a combat zone since 9-11-2001?", - "example": "YES", - "nullable": true - } - } - }, - "servicePay": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "favorTrainingPay": { - "description": "Is the Veteran waiving VA benefits to retain training pay? See item 28 on form 21-526EZ for more details. ", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "favorMilitaryRetiredPay": { - "description": "Is the Veteran waiving VA benefits to retain military retired pay? See item 26 on form 21-526EZ for more details.", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "receivingMilitaryRetiredPay": { - "description": "Is the Veteran receiving military retired pay?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPay": { - "description": "Will the Veteran receive military retired pay pay in future? \n If true, then 'futurePayExplanation' is required.", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPayExplanation": { - "description": "Explains why future pay will be received.", - "type": "string", - "example": "Will be retiring soon.", - "nullable": true - }, - "militaryRetiredPay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "monthlyAmount": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - }, - "retiredStatus": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "RETIRED", - "TEMPORARY_DISABILITY_RETIRED_LIST", - "PERMANENT_DISABILITY_RETIRED_LIST" - ] - }, - "receivedSeparationOrSeverancePay": { - "description": "Has the Veteran ever received separation pay, disability severance pay, or any other lump sum payment from their branch of service?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "separationSeverancePay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "datePaymentReceived": { - "description": "Approximate date separation pay was received. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-03-02 or 2018-03 or 2018" - }, - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "preTaxAmountReceived": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - } - } - }, - "directDeposit": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "description": "If direct deposit information is included, the following attributes are required: accountType, accountNumber, routingNumber.", - "properties": { - "accountType": { - "description": "Account type for the direct deposit.", - "type": "string", - "nullable": true, - "example": "CHECKING", - "enum": [ - "CHECKING", - "SAVINGS" - ] - }, - "accountNumber": { - "description": "Account number for the direct deposit.", - "pattern": "^(?:[a-zA-Z0-9]{4,17})?$", - "type": "string", - "nullable": true, - "example": "123123123123" - }, - "routingNumber": { - "description": "Routing number for the direct deposit.", - "type": "string", - "nullable": true, - "pattern": "^(?:\\d{9})?$", - "example": "123123123" - }, - "financialInstitutionName": { - "description": "Provide the name of the financial institution where the Veteran wants the direct deposit.", - "maxLength": 35, - "type": "string", - "nullable": true, - "example": "Some Bank" - }, - "noAccount": { - "type": "boolean", - "nullable": true, - "description": "Claimant certifies that they do not have an account with a financial institution or certified payment agent.", - "default": false - } - } - } - } - } - } - } - }, - "example": { - "data": { - "type": "form/526", - "attributes": { - "claimantCertification": true, - "claimProcessType": "STANDARD_CLAIM_PROCESS", - "veteranIdentification": { - "currentVaEmployee": false, - "mailingAddress": { - "addressLine1": "123 Main Street", - "addressLine2": "Unit 1", - "addressLine3": "Room 2", - "city": "Portland", - "country": "USA", - "zipFirstFive": "41726", - "zipLastFour": "1234", - "state": "OR" - }, - "serviceNumber": "123456789", - "emailAddress": { - "email": "valid@somedomain.com", - "agreeToEmailRelatedToClaim": true - }, - "veteranNumber": { - "telephone": "5555555555" - } - }, - "changeOfAddress": { - "dates": { - "beginDate": "2025-06-04", - "endDate": "2026-06-04" - }, - "typeOfAddressChange": "TEMPORARY", - "addressLine1": "456 Main Street", - "addressLine2": "Unit 3", - "addressLine3": "Room 4", - "city": "Atlanta", - "zipFirstFive": "42220", - "zipLastFour": "9897", - "state": "GA", - "country": "USA" - }, - "homeless": { - "pointOfContact": "John Doe", - "pointOfContactNumber": { - "telephone": "5555555555" - }, - "currentlyHomeless": { - "homelessSituationOptions": "OTHER", - "otherDescription": "Other living situation" - } - }, - "toxicExposure": { - "gulfWarHazardService": { - "servedInGulfWarHazardLocations": "YES", - "serviceDates": { - "beginDate": "1999-07", - "endDate": "2005-01" - } - }, - "herbicideHazardService": { - "servedInHerbicideHazardLocations": "YES", - "otherLocationsServed": "Guam", - "serviceDates": { - "beginDate": "2002-03", - "endDate": "2004-10" - } - }, - "additionalHazardExposures": { - "additionalExposures": [ - "ASBESTOS", - "SHIPBOARD_HAZARD_AND_DEFENSE" - ], - "specifyOtherExposures": "Other exposure details", - "exposureDates": { - "beginDate": "2011-07", - "endDate": "2013-10" - } - }, - "multipleExposures": [ - { - "exposureDates": { - "beginDate": "2012-12", - "endDate": "2013-07" - }, - "exposureLocation": "Guam", - "hazardExposedTo": "Hazard" - } - ] - }, - "disabilities": [ - { - "disabilityActionType": "NEW", - "name": "Hearing Loss", - "serviceRelevance": "Heavy equipment operator in service", - "approximateDate": "1988-07", - "isRelatedToToxicExposure": false, - "exposureOrEventOrInjury": "Noise" - } - ], - "treatments": [ - { - "treatedDisabilityNames": [ - "Hearing Loss" - ], - "center": { - "name": "Center One", - "state": "GA", - "city": "Decatur" - }, - "beginDate": "2009-04" - }, - { - "treatedDisabilityNames": [ - "Hearing Loss" - ], - "center": { - "name": "Center One", - "state": "GA", - "city": "Decatur" - }, - "beginDate": "2009-03" - } - ], - "serviceInformation": { - "servicePeriods": [ - { - "serviceBranch": "Air Force", - "activeDutyBeginDate": "2008-11-14", - "activeDutyEndDate": "2023-10-30", - "serviceComponent": "Active", - "separationLocationCode": "98282" - } - ], - "confinements": [ - { - "approximateBeginDate": "2016-06-11", - "approximateEndDate": "2016-09-11" - }, - { - "approximateBeginDate": "2019-06", - "approximateEndDate": "2019-07" - } - ], - "federalActivation": { - "anticipatedSeparationDate": "2023-12-03", - "activationDate": "2023-02-10" - }, - "reservesNationalGuardService": { - "obligationTermsOfService": { - "beginDate": "2016-11-24", - "endDate": "2017-11-17" - }, - "unitName": "National Guard Unit Name", - "unitAddress": "1243 pine court", - "component": "National Guard", - "unitPhone": { - "areaCode": "555", - "phoneNumber": "5555555" - }, - "receivingInactiveDutyTrainingPay": "YES" - }, - "servedInActiveCombatSince911": "NO" - }, - "servicePay": { - "favorTrainingPay": true, - "favorMilitaryRetiredPay": false, - "receivingMilitaryRetiredPay": "NO", - "futureMilitaryRetiredPay": "YES", - "futureMilitaryRetiredPayExplanation": "Explanation of future military retired pay", - "militaryRetiredPay": { - "branchOfService": "Army", - "monthlyAmount": 840.75 - }, - "retiredStatus": "PERMANENT_DISABILITY_RETIRED_LIST", - "receivedSeparationOrSeverancePay": "NO", - "separationSeverancePay": { - "datePaymentReceived": "2018-07-31", - "branchOfService": "Naval Academy", - "preTaxAmountReceived": 379.25 - } - }, - "directDeposit": { - "accountType": "CHECKING", - "accountNumber": "123123123123", - "routingNumber": "123456789", - "financialInstitutionName": "Chase", - "noAccount": false - } - } - } - } - } - } - }, - "required": true - } - } - }, - "/veterans/{veteranId}/526/{id}/attachments": { - "post": { - "summary": "Upload documents supporting a 526 claim", - "tags": [ - "Disability Compensation Claims" - ], - "operationId": "upload526Attachments", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Uploads supporting documents related to a disability compensation claim. This endpoint accepts a document binary PDF as part of a multi-part payload.\n", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "UUID given when Disability Claim was submitted", - "schema": { - "type": "string" - } - }, - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "202": { - "description": "upload response", - "content": { - "application/json": { - "example": { - "data": { - "id": "98dd5011-0ea9-4a52-9ac9-c771da355110", - "type": "forms/526", - "attributes": { - "veteran": { - "flashes": [ - "Hardship", - "Homeless" - ], - "currentlyVAEmployee": false, - "currentMailingAddress": { - "city": "Portland", - "country": "USA", - "zipFirstFive": "12345", - "addressLine1": "1234 Couch Street", - "addressLine2": "Apt. 22", - "type": "DOMESTIC", - "zipLastFour": "6789", - "state": "OR" - }, - "homelessness": { - "currentlyHomeless": { - "homelessSituationType": "fleeing", - "otherLivingSituation": "none" - }, - "pointOfContact": { - "pointOfContactName": "Firstname Lastname", - "primaryPhone": { - "areaCode": "123", - "phoneNumber": "5551234" - } - } - } - }, - "claimantCertification": true, - "disabilities": [ - { - "ratedDisabilityId": "1100583", - "diagnosticCode": 9999, - "disabilityActionType": "NEW", - "name": "PTSD (post traumatic stress disorder)", - "specialIssues": [ - "Fully Developed Claim", - "PTSD/2" - ], - "secondaryDisabilities": [ - { - "name": "PTSD personal trauma", - "disabilityActionType": "SECONDARY", - "serviceRelevance": "Caused by a service-connected disability\\nLengthy description" - } - ] - } - ], - "standardClaim": false, - "autoCestPDFGenerationDisabled": true, - "claimDate": "1990-01-03", - "applicationExpirationDate": "2055-08-28T19:53:45+00:00", - "serviceInformation": { - "servicePeriods": [ - { - "activeDutyEndDate": "1990-01-02", - "serviceBranch": "Air Force", - "activeDutyBeginDate": "1980-02-05" - }, - { - "activeDutyEndDate": "1999-01-01", - "serviceBranch": "Air Force", - "activeDutyBeginDate": "1990-04-05" - } - ], - "reservesNationalGuardService": { - "obligationTermOfServiceFromDate": "2000-01-01", - "obligationTermOfServiceToDate": "2000-01-02", - "unitName": "A name, with commas, and double spaces" - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "status": "401", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "status": { - "type": "string", - "description": "HTTP error status code" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Resource not found", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Resource not found", - "status": "404", - "detail": "Resource not found", - "source": { - "pointer": "/modules/claims_api/app/controllers/claims_api/v2/veterans/disability_compensation_controller.rb:74:in `attachments'" - } - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "status": { - "type": "string", - "description": "HTTP error status code" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "attachment1": { - "type": "file", - "description": "Attachment contents. Must be provided in binary PDF or [base64 string](https://raw.githubusercontent.com/department-of-veterans-affairs/vets-api/master/modules/claims_api/spec/fixtures/base64pdf) format and less than 11 in x 11 in.\n" - }, - "attachment2": { - "type": "file", - "description": "Attachment contents. Must be provided in binary PDF or [base64 string](https://raw.githubusercontent.com/department-of-veterans-affairs/vets-api/master/modules/claims_api/spec/fixtures/base64pdf) format and less than 11 in x 11 in.\n" - } - } - } - } - } - } - } - }, - "/veterans/{veteranId}/526/generatePDF": { - "post": { - "summary": "Returns filled out 526EZ form as PDF", - "tags": [ - "Disability Compensation Claims" - ], - "operationId": "post526Pdf", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "description": "Returns a filled out 526EZ form for a disability compensation claim (21-526EZ).\n\nThis endpoint can be used to generate the PDF based on the request data in the case that the submission was not able to be successfully auto-established. The PDF can then be uploaded via the [Benefits Intake API](https://developer.va.gov/explore/api/benefits-intake) to digitally submit directly to the Veterans Benefits Administration's (VBA) claims intake process.\n", - "responses": { - "200": { - "description": "post pdf response", - "content": { - "application/json": { - "example": { - "data": { - "attributes": { - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "status": "401", - "detail": "Not authorized" - } - ] - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "attributes", - null - ], - "properties": { - "attributes": { - "$schema": "http://json-schema.org/draft-07/schema#", - "description": "Claims API 526 Schema", - "type": "object", - "additionalProperties": false, - "required": [ - "claimantCertification", - "claimProcessType", - "disabilities", - "serviceInformation", - "veteranIdentification" - ], - "properties": { - "claimProcessType": { - "type": "string", - "description": "Select type of claim program/process that applies to the Veteran.", - "enum": [ - "STANDARD_CLAIM_PROCESS", - "FDC_PROGRAM", - "BDD_PROGRAM" - ] - }, - "claimantCertification": { - "type": "boolean", - "description": "Claimant certifies and authorizes release of information.", - "default": false - }, - "veteranIdentification": { - "type": "object", - "additionalProperties": false, - "required": [ - "mailingAddress" - ], - "properties": { - "currentVaEmployee": { - "type": "boolean", - "description": "Set to true if Veteran is a VA employee.", - "default": false, - "nullable": true - }, - "serviceNumber": { - "type": "string", - "description": "Service identification number", - "nullable": true - }, - "emailAddress": { - "description": "Information associated with the Veteran's email address.", - "type": "object", - "nullable": true, - "properties": { - "email": { - "type": "string", - "pattern": "^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$", - "description": "The most current email address of the Veteran.", - "maxLength": 50, - "nullable": true - }, - "agreeToEmailRelatedToClaim": { - "type": "boolean", - "description": "Agreement to email information relating to this claim.", - "example": true, - "default": false, - "nullable": true - } - } - }, - "veteranNumber": { - "description": "If there is no phone number in VBMS for the Veteran, the exams will not be ordered. Including the phone number is recommended to avoid claim processing delays.", - "type": "object", - "nullable": true, - "properties": { - "telephone": { - "description": "Veteran's phone number.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "type": "string", - "description": "Veteran's international phone number.", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "mailingAddress": { - "type": "object", - "additionalProperties": false, - "required": [ - "addressLine1", - "city", - "state", - "zipFirstFive", - "country" - ], - "properties": { - "addressLine1": { - "description": "Address line 1 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's current mailing address.", - "type": "string", - "pattern": "^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's current mailing address. Must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's current mailing address.", - "type": "string", - "pattern": "^\\d{4}?$", - "example": "6789", - "nullable": true - }, - "state": { - "description": "State for the Veteran's current mailing address.", - "type": "string", - "pattern": "^[a-z,A-Z]{2}$", - "example": "OR" - } - } - } - } - }, - "changeOfAddress": { - "description": "If 'changeOfAddress' is included, the following attributes are required: 'typeOfAddressChange', 'dates.beginDate', 'addressLine1', 'city', 'state', 'country', 'zipFirstFive'.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "dates": { - "type": "object", - "properties": { - "beginDate": { - "description": "Begin date for the Veteran's new address.", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "type": "string", - "example": "2018-06-04" - }, - "endDate": { - "description": "Date in YYYY-MM-DD the changed address expires, if change is temporary.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-04" - } - } - }, - "typeOfAddressChange": { - "description": "Temporary or Permanent change of address. If 'TEMPORARY', 'beginDate' and 'endDate' are required.", - "type": "string", - "enum": [ - "TEMPORARY", - "PERMANENT" - ], - "example": "PERMANENT" - }, - "addressLine1": { - "description": "Address line 1 for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "maxLength": 20, - "example": "1234 Couch Street" - }, - "addressLine2": { - "description": "Address line 2 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Unit 4", - "nullable": true - }, - "addressLine3": { - "description": "Address line 3 for the Veteran's new address.", - "type": "string", - "maxLength": 20, - "example": "Room 1", - "nullable": true - }, - "city": { - "description": "City for the Veteran's new address.", - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.#]([-a-zA-Z0-9'.# ])?)+$", - "example": "Portland" - }, - "country": { - "description": "Country for the Veteran's new address. Value must match the values returned by the /countries endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "example": "USA" - }, - "zipFirstFive": { - "description": "Zip code (First 5 digits) for the Veteran's new address.", - "type": "string", - "pattern": "^$|^\\d{5}?$", - "example": "12345" - }, - "zipLastFour": { - "description": "Zip code (Last 4 digits) for the Veteran's new address.", - "type": "string", - "nullable": true, - "pattern": "^$|^\\d{4}?$", - "example": "6789" - }, - "state": { - "description": "State for the Veteran's new address.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR" - } - } - }, - "homeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "pointOfContact": { - "description": "Individual in direct contact with Veteran.", - "type": "string", - "nullable": true, - "minLength": 1, - "maxLength": 100, - "pattern": "^([-a-zA-Z0-9/']+( ?))*$", - "example": "Jane Doe" - }, - "pointOfContactNumber": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "telephone": { - "description": "Primary phone of point of contact.", - "type": "string", - "pattern": "^\\d{10}?$", - "example": "5555555", - "minLength": 10, - "maxLength": 10, - "nullable": true - }, - "internationalTelephone": { - "description": "International phone of point of contact.", - "type": "string", - "example": "+44 20 1234 5678", - "nullable": true - } - } - }, - "currentlyHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "homelessSituationOptions": { - "description": "Veteran's living situation.", - "type": "string", - "nullable": true, - "default": "other", - "enum": [ - "LIVING_IN_A_HOMELESS_SHELTER", - "NOT_CURRENTLY_IN_A_SHELTERED_ENVIRONMENT", - "STAYING_WITH_ANOTHER_PERSON", - "FLEEING_CURRENT_RESIDENCE", - "OTHER" - ], - "example": "FLEEING_CURRENT_RESIDENCE" - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'homelessSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - }, - "riskOfBecomingHomeless": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "livingSituationOptions": { - "type": "string", - "nullable": true, - "default": "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "enum": [ - "HOUSING_WILL_BE_LOST_IN_30_DAYS", - "LEAVING_PUBLICLY_FUNDED_SYSTEM_OF_CARE", - "OTHER" - ] - }, - "otherDescription": { - "description": "Explanation of living situation. Required if 'livingSituationOptions' is 'OTHER'.", - "type": "string", - "nullable": true, - "maxLength": 500, - "example": "other living situation" - } - } - } - } - }, - "toxicExposure": { - "type": "object", - "nullable": true, - "properties": { - "gulfWarHazardService": { - "type": "object", - "nullable": true, - "description": "Toxic exposure related to the Gulf war.", - "properties": { - "servedInGulfWarHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following Gulf War hazard locations: Iraq; Kuwait; Saudi Arabia; the neutral zone between Iraq and Saudi Arabia; Bahrain; Qatar; the United Arab Emirates; Oman; Yemen; Lebanon; Somalia; Afghanistan; Israel; Egypt; Turkey; Syria; Jordan; Djibouti; Uzbekistan; the Gulf of Aden; the Gulf of Oman; the Persian Gulf; the Arabian Sea; and the Red Sea.", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "serviceDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in Gulf War hazard location.", - "example": "2018-06 or 2018" - } - } - } - } - }, - "herbicideHazardService": { - "description": "Toxic exposure related to herbicide (Agent Orange) hazards.", - "type": "object", - "nullable": true, - "properties": { - "servedInHerbicideHazardLocations": { - "type": "string", - "description": "Set to true if the Veteran served in any of the following herbicide/Agent Orange locations: Republic of Vietnam to include the 12 nautical mile territorial waters; Thailand at any United States or Royal Thai base; Laos; Cambodia at Mimot or Krek; Kampong Cham Province; Guam or American Samoa; or in the territorial waters thereof; Johnston Atoll or a ship that called at Johnston Atoll; Korean demilitarized zone; aboard (to include repeated operations and maintenance with) a C-123 aircraft known to have been used to spray an herbicide agent (during service in the Air Force and Air Force Reserves).", - "example": "YES", - "enum": [ - "NO", - "YES" - ], - "nullable": true - }, - "otherLocationsServed": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Other location(s) where Veteran served." - }, - "serviceDates": { - "description": "Date range for exposure in herbicide hazard location.", - "type": "object", - "nullable": true, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for serving in herbicide location.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "additionalHazardExposures": { - "type": "object", - "nullable": true, - "description": "Additional hazardous exposures.", - "properties": { - "additionalExposures": { - "description": "Additional exposure incidents.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "enum": [ - "ASBESTOS", - "MUSTARD_GAS", - "RADIATION", - "SHIPBOARD_HAZARD_AND_DEFENSE", - "MILITARY_OCCUPATIONAL_SPECIALTY_RELATED_TOXIN", - "CONTAMINATED_WATER_AT_CAMP_LEJEUNE", - "OTHER" - ] - } - }, - "specifyOtherExposures": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Exposure to asbestos." - }, - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - } - } - }, - "multipleExposures": { - "type": "array", - "nullable": true, - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "exposureDates": { - "type": "object", - "nullable": true, - "description": "Date range for when the exposure happened.", - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "description": "Approximate begin date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - }, - "endDate": { - "type": "string", - "nullable": true, - "description": "Approximate end date for exposure.", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018" - } - } - }, - "exposureLocation": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Location where the exposure happened." - }, - "hazardExposedTo": { - "type": "string", - "nullable": true, - "pattern": "^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "description": "Hazard the Veteran was exposed to." - } - } - } - } - } - }, - "disabilities": { - "description": "Any current disabilities or symptoms the Veteran is claiming are related to their military service and/or are service-connected.", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "disabilityActionType", - "name" - ], - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury. If the disabilityActionType is 'NEW', the serviceRelevance is required.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "ratedDisabilityId": { - "description": "When submitting a contention with action type 'INCREASE', the previously rated disability id may be included.", - "type": "string", - "example": "1100583", - "nullable": true - }, - "diagnosticCode": { - "description": "If the disabilityActionType is 'NONE' or 'INCREASE', the diagnosticCode should correspond to an existing rated disability.", - "type": "integer", - "example": 9999, - "nullable": true - }, - "disabilityActionType": { - "description": "Action type requested for the disability. If 'INCREASE' or 'NONE', then 'ratedDisabilityId' and 'diagnosticCode' should be included. 'NONE' should be used when including a secondary disability.", - "type": "string", - "enum": [ - "NONE", - "NEW", - "INCREASE" - ], - "example": "NEW" - }, - "secondaryDisabilities": { - "description": "If secondaryDisability is included, the following attributes are required: 'secondaryDisability.name', 'secondaryDisability.disabilityActionType' and 'secondaryDisability.serviceRelevance'", - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of the disability. The /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible disability names.", - "type": "string", - "pattern": "^$|([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "PTSD (post traumatic stress disorder)", - "maxLength": 255 - }, - "disabilityActionType": { - "description": "The status of the secondary disability.", - "type": "string", - "example": "SECONDARY", - "enum": [ - "SECONDARY" - ] - }, - "serviceRelevance": { - "description": "Explanation of how the disability(ies) relates to the in-service event/exposure/injury.", - "type": "string", - "nullable": true, - "example": "Heavy equipment operator in service." - }, - "classificationCode": { - "type": "string", - "description": "Classification code for the associated body system. Must match an active code returned by the /disabilities endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "example": "249470", - "nullable": true - }, - "approximateDate": { - "description": "Approximate date disability began. Date must be in the past. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4}(?:-(?!00)(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[1-2][0-9]|3[0-1]))?)?)$", - "example": "2018-03-02 or 2018-03 or 2018", - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "isRelatedToToxicExposure": { - "type": "boolean", - "description": "Is the disability related to toxic exposures? If true, related 'toxicExposure' must be included.", - "example": true, - "default": false, - "nullable": true - }, - "exposureOrEventOrInjury": { - "type": "string", - "description": "What caused the disability?", - "nullable": true, - "examples": [ - "Agent Orange", - "radiation", - "burn pits" - ] - } - } - } - }, - "treatments": { - "description": "Identifies the Service Treatment information of the Veteran.", - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "beginDate": { - "description": "Begin date for treatment. If treatment began from 2005 to present, you do not need to provide dates. Each treatment begin date must be after the first 'servicePeriod.activeDutyBeginDate'.", - "type": "string", - "pattern": "^(?:19|20)[0-9][0-9]$|^(?:19|20)[0-9][0-9]-(0[1-9]|1[0-2])$", - "example": "2018-06 or 2018", - "nullable": true - }, - "treatedDisabilityNames": { - "description": "Name(s) of disabilities treated in this time frame. Name must match 'name' of a disability included on this claim.", - "type": "array", - "nullable": true, - "maxItems": 101, - "items": { - "type": "string", - "additionalProperties": false, - "example": [ - "PTSD (post traumatic stress disorder)", - "Trauma" - ] - } - }, - "center": { - "description": "VA Medical Center(s) and Department of Defense Military Treatment Facilities where the Veteran received treatment after discharge for any claimed disabilities.", - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "name": { - "description": "Name of facility Veteran was treated in. The /treatment-centers endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve possible treatment center names.", - "type": "string", - "nullable": true, - "pattern": "^$|(?!(?: )$)([a-zA-Z0-9\"\\/&\\(\\)\\-'.,# ]([a-zA-Z0-9(\\)\\-'.,# ])?)+$", - "example": "Private Facility 2", - "maxLength": 100 - }, - "city": { - "description": "City of treatment facility.", - "type": "string", - "pattern": "^$|^([-a-zA-Z'.#]([-a-zA-Z'.# ])?)+$", - "example": "Portland", - "nullable": true - }, - "state": { - "description": "State of treatment facility.", - "type": "string", - "pattern": "^$|^[a-z,A-Z]{2}$", - "example": "OR", - "nullable": true - } - } - } - } - } - }, - "serviceInformation": { - "type": "object", - "additionalProperties": false, - "required": [ - "servicePeriods" - ], - "properties": { - "servicePeriods": { - "description": "Identifies the Service dates and Branch the Veteran served in.", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "object", - "required": [ - "serviceBranch", - "serviceComponent" - ], - "properties": { - "serviceBranch": { - "description": "Branch of service during period. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "example": "Air Force" - }, - "serviceComponent": { - "type": "string", - "description": "", - "enum": [ - "Active", - "Reserves", - "National Guard" - ] - }, - "activeDutyBeginDate": { - "description": "Date started active duty.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "activeDutyEndDate": { - "description": "Date completed active duty. If in the future, 'separationLocationCode' is required.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "separationLocationCode": { - "description": "Location code for the facility the Veteran plans to separate from. Required if 'servicePeriod.activeDutyEndDate' is in the future. Code must match the values returned by the /intake-sites endpoint on the [Benefits reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current).", - "type": "string", - "nullable": true, - "example": "98283" - } - } - } - }, - "confinements": { - "type": "array", - "nullable": true, - "uniqueItems": true, - "items": { - "additionalProperties": false, - "type": "object", - "properties": { - "approximateBeginDate": { - "description": "The approximateBeginDate must be after the earliest servicePeriod activeDutyBeginDate.", - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - }, - "approximateEndDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-06-06 or 2018-06" - } - } - } - }, - "federalActivation": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "anticipatedSeparationDate": { - "description": "Anticipated date of separation. Date must be in the future.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - }, - "activationDate": { - "description": "Date cannot be in the future and must be after the earliest servicePeriod.activeDutyBeginDate.", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06", - "nullable": true - } - } - }, - "reservesNationalGuardService": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "obligationTermsOfService": { - "type": "object", - "nullable": true, - "description": "If 'obligationTermsOfService' is included, the following attributes are required: 'beginDate ' and 'endDate'.", - "additionalProperties": false, - "properties": { - "beginDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - }, - "endDate": { - "type": "string", - "nullable": true, - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$", - "example": "2018-06-06" - } - } - }, - "component": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "Reserves", - "National Guard" - ] - }, - "unitName": { - "type": "string", - "nullable": true, - "pattern": "^$|([a-zA-Z0-9\\-'.,# ][a-zA-Z0-9\\-'.,# ]?)*$" - }, - "unitAddress": { - "type": "string", - "pattern": "^$|^([-a-zA-Z0-9'.,&#]([-a-zA-Z0-9'.,&# ])?)+$", - "nullable": true - }, - "unitPhone": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "areaCode": { - "type": "string", - "nullable": true, - "maxLength": 3, - "pattern": "^$|^\\d{3}$", - "example": "555" - }, - "phoneNumber": { - "type": "string", - "nullable": true, - "maxLength": 20, - "example": "5555555" - } - } - }, - "receivingInactiveDutyTrainingPay": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "nullable": true, - "example": "YES" - } - } - }, - "alternateNames": { - "description": "List any other names under which the Veteran served, if applicable.", - "type": "array", - "nullable": true, - "maxItems": 100, - "uniqueItems": true, - "items": { - "type": "string", - "additionalProperties": false, - "examples": [ - "jane", - "janey lee", - "jane lee MacDonald" - ] - } - }, - "servedInActiveCombatSince911": { - "type": "string", - "enum": [ - "YES", - "NO" - ], - "description": "Did Veteran serve in a combat zone since 9-11-2001?", - "example": "YES", - "nullable": true - } - } - }, - "servicePay": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "properties": { - "favorTrainingPay": { - "description": "Is the Veteran waiving VA benefits to retain training pay? See item 28 on form 21-526EZ for more details. ", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "favorMilitaryRetiredPay": { - "description": "Is the Veteran waiving VA benefits to retain military retired pay? See item 26 on form 21-526EZ for more details.", - "type": "boolean", - "nullable": true, - "example": true, - "default": false - }, - "receivingMilitaryRetiredPay": { - "description": "Is the Veteran receiving military retired pay?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPay": { - "description": "Will the Veteran receive military retired pay pay in future? \n If true, then 'futurePayExplanation' is required.", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "futureMilitaryRetiredPayExplanation": { - "description": "Explains why future pay will be received.", - "type": "string", - "example": "Will be retiring soon.", - "nullable": true - }, - "militaryRetiredPay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "monthlyAmount": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - }, - "retiredStatus": { - "type": "string", - "nullable": true, - "description": "", - "enum": [ - "RETIRED", - "TEMPORARY_DISABILITY_RETIRED_LIST", - "PERMANENT_DISABILITY_RETIRED_LIST" - ] - }, - "receivedSeparationOrSeverancePay": { - "description": "Has the Veteran ever received separation pay, disability severance pay, or any other lump sum payment from their branch of service?", - "type": "string", - "enum": [ - "YES", - "NO" - ], - "example": "YES", - "nullable": true - }, - "separationSeverancePay": { - "type": "object", - "nullable": true, - "description": "", - "properties": { - "datePaymentReceived": { - "description": "Approximate date separation pay was received. \n Format can be either YYYY-MM-DD or YYYY-MM or YYYY", - "type": "string", - "pattern": "^(?:[0-9]{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])$|(?:[0-9]{4})$|(?:[0-9]{4})-(?:0[1-9]|1[0-2])$", - "example": "2018-03-02 or 2018-03 or 2018" - }, - "branchOfService": { - "description": "Branch of service. The /service-branches endpoint on the [Benefits Reference Data API](https://developer.va.gov/explore/benefits/docs/benefits_reference_data?version=current) may be used to retrieve list of possible service branches.", - "type": "string", - "nullable": true, - "example": "Air Force" - }, - "preTaxAmountReceived": { - "description": "Amount being received.", - "type": "number", - "nullable": true, - "minimum": 1, - "maximum": 999999, - "example": 100 - } - } - } - } - }, - "directDeposit": { - "type": "object", - "nullable": true, - "additionalProperties": false, - "description": "If direct deposit information is included, the following attributes are required: accountType, accountNumber, routingNumber.", - "properties": { - "accountType": { - "description": "Account type for the direct deposit.", - "type": "string", - "nullable": true, - "example": "CHECKING", - "enum": [ - "CHECKING", - "SAVINGS" - ] - }, - "accountNumber": { - "description": "Account number for the direct deposit.", - "pattern": "^(?:[a-zA-Z0-9]{4,17})?$", - "type": "string", - "nullable": true, - "example": "123123123123" - }, - "routingNumber": { - "description": "Routing number for the direct deposit.", - "type": "string", - "nullable": true, - "pattern": "^(?:\\d{9})?$", - "example": "123123123" - }, - "financialInstitutionName": { - "description": "Provide the name of the financial institution where the Veteran wants the direct deposit.", - "maxLength": 35, - "type": "string", - "nullable": true, - "example": "Some Bank" - }, - "noAccount": { - "type": "boolean", - "nullable": true, - "description": "Claimant certifies that they do not have an account with a financial institution or certified payment agent.", - "default": false - } - } - } - } - } - } - } - }, - "example": { - "data": { - "type": "form/526", - "attributes": { - "claimantCertification": true, - "claimProcessType": "STANDARD_CLAIM_PROCESS", - "veteranIdentification": { - "currentVaEmployee": false, - "mailingAddress": { - "addressLine1": "123 Main Street", - "addressLine2": "Unit 1", - "addressLine3": "Room 2", - "city": "Portland", - "country": "USA", - "zipFirstFive": "41726", - "zipLastFour": "1234", - "state": "OR" - }, - "serviceNumber": "123456789", - "emailAddress": { - "email": "valid@somedomain.com", - "agreeToEmailRelatedToClaim": true - }, - "veteranNumber": { - "telephone": "5555555555" - } - }, - "changeOfAddress": { - "dates": { - "beginDate": "2025-06-04", - "endDate": "2026-06-04" - }, - "typeOfAddressChange": "TEMPORARY", - "addressLine1": "456 Main Street", - "addressLine2": "Unit 3", - "addressLine3": "Room 4", - "city": "Atlanta", - "zipFirstFive": "42220", - "zipLastFour": "9897", - "state": "GA", - "country": "USA" - }, - "homeless": { - "pointOfContact": "John Doe", - "pointOfContactNumber": { - "telephone": "5555555555" - }, - "currentlyHomeless": { - "homelessSituationOptions": "OTHER", - "otherDescription": "Other living situation" - } - }, - "toxicExposure": { - "gulfWarHazardService": { - "servedInGulfWarHazardLocations": "YES", - "serviceDates": { - "beginDate": "1999-07", - "endDate": "2005-01" - } - }, - "herbicideHazardService": { - "servedInHerbicideHazardLocations": "YES", - "otherLocationsServed": "Guam", - "serviceDates": { - "beginDate": "2002-03", - "endDate": "2004-10" - } - }, - "additionalHazardExposures": { - "additionalExposures": [ - "ASBESTOS", - "SHIPBOARD_HAZARD_AND_DEFENSE" - ], - "specifyOtherExposures": "Other exposure details", - "exposureDates": { - "beginDate": "2011-07", - "endDate": "2013-10" - } - }, - "multipleExposures": [ - { - "exposureDates": { - "beginDate": "2012-12", - "endDate": "2013-07" - }, - "exposureLocation": "Guam", - "hazardExposedTo": "Hazard" - } - ] - }, - "disabilities": [ - { - "disabilityActionType": "NEW", - "name": "Hearing Loss", - "serviceRelevance": "Heavy equipment operator in service", - "approximateDate": "1988-07", - "isRelatedToToxicExposure": false, - "exposureOrEventOrInjury": "Noise" - } - ], - "treatments": [ - { - "treatedDisabilityNames": [ - "Hearing Loss" - ], - "center": { - "name": "Center One", - "state": "GA", - "city": "Decatur" - }, - "beginDate": "2009-04" - }, - { - "treatedDisabilityNames": [ - "Hearing Loss" - ], - "center": { - "name": "Center One", - "state": "GA", - "city": "Decatur" - }, - "beginDate": "2009-03" - } - ], - "serviceInformation": { - "servicePeriods": [ - { - "serviceBranch": "Air Force", - "activeDutyBeginDate": "2008-11-14", - "activeDutyEndDate": "2023-10-30", - "serviceComponent": "Active", - "separationLocationCode": "98282" - } - ], - "confinements": [ - { - "approximateBeginDate": "2016-06-11", - "approximateEndDate": "2016-09-11" - }, - { - "approximateBeginDate": "2019-06", - "approximateEndDate": "2019-07" - } - ], - "federalActivation": { - "anticipatedSeparationDate": "2023-12-03", - "activationDate": "2023-02-10" - }, - "reservesNationalGuardService": { - "obligationTermsOfService": { - "beginDate": "2016-11-24", - "endDate": "2017-11-17" - }, - "unitName": "National Guard Unit Name", - "unitAddress": "1243 pine court", - "component": "National Guard", - "unitPhone": { - "areaCode": "555", - "phoneNumber": "5555555" - }, - "receivingInactiveDutyTrainingPay": "YES" - }, - "servedInActiveCombatSince911": "NO" - }, - "servicePay": { - "favorTrainingPay": true, - "favorMilitaryRetiredPay": false, - "receivingMilitaryRetiredPay": "NO", - "futureMilitaryRetiredPay": "YES", - "futureMilitaryRetiredPayExplanation": "Explanation of future military retired pay", - "militaryRetiredPay": { - "branchOfService": "Army", - "monthlyAmount": 840.75 - }, - "retiredStatus": "PERMANENT_DISABILITY_RETIRED_LIST", - "receivedSeparationOrSeverancePay": "NO", - "separationSeverancePay": { - "datePaymentReceived": "2018-07-31", - "branchOfService": "Naval Academy", - "preTaxAmountReceived": 379.25 - } - }, - "directDeposit": { - "accountType": "CHECKING", - "accountNumber": "123123123123", - "routingNumber": "123456789", - "financialInstitutionName": "Chase", - "noAccount": false - } - } - } - } - } - } - }, - "required": true - } - } - }, - "/veterans/{veteranId}/claims/{id}/5103": { - "post": { - "summary": "Submit Evidence Waiver 5103", - "tags": [ - "5103 Waiver" - ], - "operationId": "submitEvidenceWaiver5103", - "security": [ - { - "productionOauth": [ - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Submit Evidence Waiver 5103 for Veteran.", - "parameters": [ - { - "name": "id", - "in": "path", - "example": "1234", - "description": "The ID of the claim being requested", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - }, - { - "name": "sponsorIcn", - "in": "query", - "required": false, - "example": "1012861229V078999", - "description": "ICN of the veteran affiliated with the dependent", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "example": { - "success": true - }, - "schema": { - "type": "object", - "additionalProperties": true, - "properties": { - "success": { - "type": "boolean", - "example": "true" - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "NotFound", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Resource not found", - "detail": "Claim not found" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/veterans/{veteranId}/intent-to-file/{type}": { - "get": { - "summary": "Returns last active Intent to File form submission for given 'type'.", - "tags": [ - "Intent to File" - ], - "operationId": "active0966itf", - "security": [ - { - "productionOauth": [ - "system/claim.read" - ] - }, - { - "sandboxOauth": [ - "system/claim.read" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Returns Veteran's last active Intent to File submission for given benefit type.", - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "path", - "required": true, - "description": "Type of Intent to File to return. Available values - compensation, pension, survivor.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response with active Intent to File", - "content": { - "application/json": { - "example": { - "data": { - "id": "193685", - "type": "intent_to_file", - "attributes": { - "creationDate": "2021-03-16T19:15:21.000-05:00", - "expirationDate": "2022-03-16T19:15:20.000-05:00", - "type": "compensation", - "status": "active" - } - } - }, - "schema": { - "$schema": "http://json-schema.org/draft-04/schema#", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "type", - "attributes" - ], - "properties": { - "id": { - "type": "string", - "description": "Intent To File ID", - "example": "600131328" - }, - "type": { - "type": "string", - "example": "intent_to_file" - }, - "attributes": { - "required": [ - "creationDate", - "expirationDate", - "status", - "type" - ], - "properties": { - "creationDate": { - "type": "string", - "format": "date", - "description": "Date the Intent to File was received at the VA" - }, - "expirationDate": { - "type": "string", - "format": "date", - "description": "Date the Intent to File expires, this is 1 year from the createdDate" - }, - "status": { - "type": "string", - "description": "The status of the Intent to File", - "example": "active" - }, - "type": { - "type": "string", - "description": "The type of Intent to File filed.", - "example": "compensation" - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Resource not found", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Resource not found", - "detail": "No active 'C' intent to file found." - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/veterans/{veteranId}/intent-to-file": { - "post": { - "summary": "Submit form 0966 Intent to File.", - "tags": [ - "Intent to File" - ], - "operationId": "post0966itf", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Establishes an Intent to File for disability compensation, pension, and survivor claims.", - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "0966 Response", - "content": { - "application/json": { - "example": { - "data": { - "id": "1", - "type": "intent_to_file", - "attributes": { - "creationDate": "2023-12-20", - "expirationDate": "2024-12-20", - "type": "compensation", - "status": "active" - } - } - }, - "schema": { - "$schema": "http://json-schema.org/draft-04/schema#", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "type", - "attributes" - ], - "properties": { - "id": { - "type": "string", - "description": "Intent To File ID", - "example": "600131328" - }, - "type": { - "type": "string", - "example": "intent_to_file" - }, - "attributes": { - "required": [ - "creationDate", - "expirationDate", - "status", - "type" - ], - "properties": { - "creationDate": { - "type": "string", - "format": "date", - "description": "Date the Intent to File was received at the VA" - }, - "expirationDate": { - "type": "string", - "format": "date", - "description": "Date the Intent to File expires, this is 1 year from the createdDate" - }, - "status": { - "type": "string", - "description": "The status of the Intent to File", - "example": "active" - }, - "type": { - "type": "string", - "description": "The type of Intent to File filed.", - "example": "compensation" - } - } - } - } - } - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "invalid value for type", - "detail": "some-invalid-value is not valid for type" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "422": { - "description": "Unprocessable entity", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Unprocessable Entity", - "detail": "Invalid claimantSsn parameter" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "example": "compensation", - "description": "Type of Intent To File being submitted. For type \"survivor\", the request must include claimantSsn and be made by a valid Veteran Representative. If the Representative is not a Veteran or a VA employee, this method is currently not available to them, and they should use the Benefits Intake API as an alternative.", - "enum": [ - "compensation", - "pension", - "survivor" - ] - }, - "claimantSsn": { - "type": "string", - "example": "001122334", - "description": "SSN of the Claimant." - } - }, - "example": { - "type": "compensation" - } - } - } - } - }, - "example": { - "data": { - "type": "intent_to_file", - "attributes": { - "type": "compensation" - } - } - } - } - } - }, - "required": true - } - } - }, - "/veterans/{veteranId}/intent-to-file/validate": { - "post": { - "summary": "Validate form 0966 Intent to File.", - "tags": [ - "Intent to File" - ], - "operationId": "validate0966itf", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Validates an Intent to File for disability compensation, pension, and survivor claims.", - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "0966 Response", - "content": { - "application/json": { - "example": { - "data": { - "type": "intent_to_file_validation", - "attributes": { - "status": "valid" - } - } - }, - "schema": { - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string" - }, - "attributes": { - "type": "object", - "additionalProperties": false, - "required": [ - "status" - ], - "properties": { - "status": { - "type": "string", - "description": "The status of the Intent to File", - "enum": [ - "valid" - ] - } - } - } - } - } - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "invalid value for type", - "detail": "some-invalid-value is not valid for type" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "example": "compensation", - "description": "Type of Intent To File being submitted. For type \"survivor\", the request must include claimantSsn and be made by a valid Veteran Representative. If the Representative is not a Veteran or a VA employee, this method is currently not available to them, and they should use the Benefits Intake API as an alternative.", - "enum": [ - "compensation", - "pension", - "survivor" - ] - }, - "claimantSsn": { - "type": "string", - "example": "001122334", - "description": "SSN of the Claimant." - } - }, - "example": { - "type": "compensation" - } - } - } - } - }, - "example": { - "data": { - "type": "intent_to_file", - "attributes": { - "type": "compensation" - } - } - } - } - } - }, - "required": true - } - } - }, - "/veterans/{veteranId}/power-of-attorney": { - "get": { - "summary": "Find current Power of Attorney for a Veteran.", - "tags": [ - "Power of Attorney" - ], - "operationId": "findPowerOfAttorney", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "description": "Retrieves current Power of Attorney for Veteran.", - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response with a current Power of Attorney", - "content": { - "application/json": { - "example": { - "code": "A1Q", - "name": "Firstname Lastname", - "phone": { - "number": "555-555-5555" - }, - "type": "individual" - }, - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string", - "description": "Power of Attorney Code currently assigned to Veteran" - }, - "name": { - "description": "Name of individual representative or organization", - "type": "string", - "nullable": true, - "example": "Jane Smith" - }, - "type": { - "description": "Type of representative, organization or individual", - "type": "string", - "nullable": true, - "example": "individual" - }, - "phone": { - "type": "object", - "additionalProperties": false, - "properties": { - "number": { - "description": "Phone number of representative. Can be organization or individual phone number.", - "type": "string", - "nullable": true, - "example": "555-555-5555" - } - } - } - } - } - } - } - }, - "204": { - "description": "Successful response with no current Power of Attorney", - "content": { - "application/json": { - "example": "" - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "example": { - "errors": [ - { - "title": "Not authorized", - "detail": "Not authorized" - } - ] - }, - "schema": { - "required": [ - "errors" - ], - "properties": { - "errors": { - "type": "array", - "items": { - "additionalProperties": false, - "required": [ - "title", - "detail" - ], - "properties": { - "title": { - "type": "string", - "description": "HTTP error title" - }, - "detail": { - "type": "string", - "description": "HTTP error detail" - }, - "source": { - "type": "object", - "additionalProperties": false, - "description": "Source of error", - "properties": { - "pointer": { - "type": "string", - "description": "Pointer to source of error" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/veterans/{veteranId}/2122a/validate": { - "post": { - "summary": "Validates a 2122a form submission.", - "tags": [ - "Power of Attorney" - ], - "operationId": "post2122aValidate", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "description": "Validates a request appointing an individual as Power of Attorney (21-22a).\n", - "responses": { - "200": { - "description": "Valid request response" - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/veterans/{veteranId}/2122a": { - "post": { - "summary": "Appoint an individual as Power of Attorney.", - "tags": [ - "Power of Attorney" - ], - "operationId": "post2122a", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "description": "Validates a request appointing an individual as Power of Attorney (21-22a).\n", - "responses": { - "200": { - "description": "Valid request response" - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/veterans/{veteranId}/2122/validate": { - "post": { - "summary": "Validates a 2122 form submission.", - "tags": [ - "Power of Attorney" - ], - "operationId": "post2122Validate", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "description": "Validates a request appointing an organization as Power of Attorney (21-22).\n", - "responses": { - "200": { - "description": "Valid request response" - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/veterans/{veteranId}/2122": { - "post": { - "summary": "Appoint an organization as Power of Attorney", - "tags": [ - "Power of Attorney" - ], - "operationId": "post2122", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - } - ], - "description": "Validates a request appointing an organization as Power of Attorney (21-22).\n", - "responses": { - "200": { - "description": "Valid request response" - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/veterans/{veteranId}/power-of-attorney/{id}": { - "get": { - "summary": "Checks status of Power of Attorney appointment form submission", - "tags": [ - "Power of Attorney" - ], - "operationId": "getPowerOfAttorneyStatus", - "security": [ - { - "productionOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "sandboxOauth": [ - "system/claim.read", - "system/claim.write" - ] - }, - { - "bearer_token": [ - - ] - } - ], - "parameters": [ - { - "name": "veteranId", - "in": "path", - "required": true, - "example": "1012667145V762142", - "description": "ID of Veteran", - "schema": { - "type": "string" - } - }, - { - "name": "id", - "in": "path", - "required": true, - "example": "12e13134-7229-4e44-90ae-bcea2a4525fa", - "description": "Power of Attorney appointment request id", - "schema": { - "type": "string" - } - } - ], - "description": "Gets the Power of Attorney appointment request status (21-22/21-22a)\n", - "responses": { - "200": { - "description": "Successful response" - }, - "401": { - "description": "Unauthorized" - } - } - } - } - }, - "servers": [ - { - "url": "https://sandbox-api.va.gov/services/claims/{version}", - "description": "VA.gov API sandbox environment", - "variables": { - "version": { - "default": "v2" - } - } - }, - { - "url": "https://api.va.gov/services/claims/{version}", - "description": "VA.gov API production environment", - "variables": { - "version": { - "default": "v2" - } - } - } - ] -} \ No newline at end of file diff --git a/modules/simple_forms_api/spec/requests/v1/uploads_spec.rb b/modules/simple_forms_api/spec/requests/v1/uploads_spec.rb index 7663eac253f..5c70fcf9c1b 100644 --- a/modules/simple_forms_api/spec/requests/v1/uploads_spec.rb +++ b/modules/simple_forms_api/spec/requests/v1/uploads_spec.rb @@ -31,92 +31,105 @@ ] describe '#submit' do - let(:metadata_file) { "#{file_seed}.SimpleFormsApi.metadata.json" } - let(:file_seed) { 'tmp/some-unique-simple-forms-file-seed' } + context 'going to Lighthouse Benefits Intake API' do + let(:metadata_file) { "#{file_seed}.SimpleFormsApi.metadata.json" } + let(:file_seed) { 'tmp/some-unique-simple-forms-file-seed' } - before { allow(Common::FileHelpers).to receive(:random_file_path).and_return(file_seed) } + before do + VCR.insert_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') + VCR.insert_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') + allow(Common::FileHelpers).to receive(:random_file_path).and_return(file_seed) + end - after { Common::FileHelpers.delete_file_if_exists(metadata_file) } + after do + VCR.eject_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') + VCR.eject_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') + Common::FileHelpers.delete_file_if_exists(metadata_file) + end - non_ivc_forms.each do |form| - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', form) - data = JSON.parse(fixture_path.read) + non_ivc_forms.each do |form| + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', form) + data = JSON.parse(fixture_path.read) - it 'makes the request' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do - allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) + it 'makes the request' do + allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) - post '/simple_forms_api/v1/simple_forms', params: data + post '/simple_forms_api/v1/simple_forms', params: data - expect(SimpleFormsApiSubmission::MetadataValidator).to have_received(:validate) - expect(response).to have_http_status(:ok) - end + expect(SimpleFormsApiSubmission::MetadataValidator).to have_received(:validate) + expect(response).to have_http_status(:ok) + end + + it 'saves a FormSubmissionAttempt' do + allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) + + expect do + post '/simple_forms_api/v1/simple_forms', params: data + end.to change(FormSubmissionAttempt, :count).by(1) end end - it 'saves a FormSubmissionAttempt' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do + authenticated_non_ivc_forms.each do |form| + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', form) + data = JSON.parse(fixture_path.read) + + context 'authenticated user' do + before do + user = create(:user) + sign_in_as(user) + create(:in_progress_form, user_uuid: user.uuid, form_id: data['form_number']) + end + + it 'clears the InProgressForm' do allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) expect do post '/simple_forms_api/v1/simple_forms', params: data - end.to change(FormSubmissionAttempt, :count).by(1) + end.to change(InProgressForm, :count).by(-1) end end end - end - authenticated_non_ivc_forms.each do |form| - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', form) - data = JSON.parse(fixture_path.read) + context 'request with intent to file' do + context 'authenticated' do + before do + sign_in + allow_any_instance_of(User).to receive(:icn).and_return('123498767V234859') + allow_any_instance_of(Auth::ClientCredentials::Service).to receive(:get_token).and_return('fake_token') + end - context 'authenticated user' do - before do - user = create(:user) - sign_in_as(user) - create(:in_progress_form, user_uuid: user.uuid, form_id: data['form_number']) - end + context 'third party' do + let(:expiration_date) { Time.zone.now } - it 'clears the InProgressForm' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do - allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) + before do + allow_any_instance_of(ActiveSupport::TimeZone).to receive(:now).and_return(expiration_date) + end + + %w[THIRD_PARTY_VETERAN THIRD_PARTY_SURVIVING_DEPENDENT].each do |identification| + it 'returns an expiration date' do + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', + 'vba_21_0966.json') + data = JSON.parse(fixture_path.read) + data['preparer_identification'] = identification - expect do post '/simple_forms_api/v1/simple_forms', params: data - end.to change(InProgressForm, :count).by(-1) + + parsed_response_body = JSON.parse(response.body) + parsed_expiration_date = Time.zone.parse(parsed_response_body['expiration_date']) + expect(parsed_expiration_date.to_s).to eq (expiration_date + 1.year).to_s + end end end end - end - end - ivc_forms.each do |form| - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', form) - data = JSON.parse(fixture_path.read) - - it 'uploads a PDF file to S3' do - allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) - allow_any_instance_of(Aws::S3::Client).to receive(:put_object).and_return(true) - - post '/simple_forms_api/v1/simple_forms', params: data - - expect(response).to have_http_status(:ok) - end - end - - describe 'request with intent to file unauthenticated' do - let(:expiration_date) { Time.zone.now } + context 'unauthenticated' do + let(:expiration_date) { Time.zone.now } - before do - allow_any_instance_of(ActiveSupport::TimeZone).to receive(:now).and_return(expiration_date) - end + before do + allow_any_instance_of(ActiveSupport::TimeZone).to receive(:now).and_return(expiration_date) + end - it 'returns an expiration date' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do + it 'returns an expiration date' do fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', 'vba_21_0966.json') data = JSON.parse(fixture_path.read) @@ -129,112 +142,133 @@ end end end - end - describe 'authenticated' do - before do - sign_in - allow_any_instance_of(User).to receive(:icn).and_return('123498767V234859') - allow_any_instance_of(Auth::ClientCredentials::Service).to receive(:get_token).and_return('fake_token') - end - - describe 'request with intent to file' do - describe 'veteran' do - it 'makes the request with an intent to file' do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/200_response_survivor') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/create_compensation_200_response') do - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', - 'vba_21_0966-min.json') - data = JSON.parse(fixture_path.read) - data['preparer_identification'] = 'VETERAN' - - post '/simple_forms_api/v1/simple_forms', params: data - - expect(response).to have_http_status(:ok) - end - end - end - end - end + context 'request with attached documents' do + it 'appends the attachments to the 40-0247 PDF' do + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', + 'vba_40_0247_with_supporting_document.json') + pdf_path = Rails.root.join('spec', 'fixtures', 'files', 'doctors-note.pdf') + data = JSON.parse(fixture_path.read) + attachment = double + allow(attachment).to receive(:to_pdf).and_return(pdf_path) + + expect(PersistentAttachment).to receive(:where).with(guid: ['a-random-uuid']).and_return([attachment]) + + post '/simple_forms_api/v1/simple_forms', params: data + + expect(response).to have_http_status(:ok) end - describe 'third party' do - let(:expiration_date) { Time.zone.now } + it 'appends the attachments to the 40-10007 PDF' do + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', + 'vba_40_10007_with_supporting_document.json') + pdf_path = Rails.root.join('spec', 'fixtures', 'files', 'doctors-note.pdf') + data = JSON.parse(fixture_path.read) + attachment = double + allow(attachment).to receive(:to_pdf).and_return(pdf_path) + expect(PersistentAttachment).to receive(:where).with(guid: ['a-random-uuid']).and_return([attachment]) + post '/simple_forms_api/v1/simple_forms', params: data + expect(response).to have_http_status(:ok) + end + end - before do - allow_any_instance_of(ActiveSupport::TimeZone).to receive(:now).and_return(expiration_date) - end + context 'LOA3 authenticated' do + before do + sign_in + allow_any_instance_of(User).to receive(:icn).and_return('123498767V234859') + allow_any_instance_of(Auth::ClientCredentials::Service).to receive(:get_token).and_return('fake_token') + end - %w[THIRD_PARTY_VETERAN THIRD_PARTY_SURVIVING_DEPENDENT].each do |identification| - it 'returns an expiration date' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', - 'vba_21_0966.json') - data = JSON.parse(fixture_path.read) - data['preparer_identification'] = identification - - post '/simple_forms_api/v1/simple_forms', params: data - - parsed_response_body = JSON.parse(response.body) - parsed_expiration_date = Time.zone.parse(parsed_response_body['expiration_date']) - expect(parsed_expiration_date.to_s).to eq (expiration_date + 1.year).to_s - end - end - end - end + it 'stamps the LOA3 text on the PDF' do + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', + 'vba_21_4142.json') + data = JSON.parse(fixture_path.read) + + allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) + expect_any_instance_of(SimpleFormsApi::PdfFiller).to receive(:generate).with(3) + + post '/simple_forms_api/v1/simple_forms', params: data end end - it 'stamps the LOA3 text on the PDF' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do + context 'transliterating fields' do + context 'transliteration succeeds' do + it 'responds with ok' do fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', - 'vba_21_4142.json') + 'form_with_accented_chars_21_0966.json') data = JSON.parse(fixture_path.read) - allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) - expect_any_instance_of(SimpleFormsApi::PdfFiller).to receive(:generate).with(3) post '/simple_forms_api/v1/simple_forms', params: data + + expect(response).to have_http_status(:ok) end end - end - end - describe 'request with attached documents' do - it 'appends the attachments to the 40-0247 PDF' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do + context 'transliteration fails' do + it 'responds with an error' do fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', - 'vba_40_0247_with_supporting_document.json') - pdf_path = Rails.root.join('spec', 'fixtures', 'files', 'doctors-note.pdf') + 'form_with_non_latin_chars_21_0966.json') data = JSON.parse(fixture_path.read) - attachment = double - allow(attachment).to receive(:to_pdf).and_return(pdf_path) - - expect(PersistentAttachment).to receive(:where).with(guid: ['a-random-uuid']).and_return([attachment]) post '/simple_forms_api/v1/simple_forms', params: data - expect(response).to have_http_status(:ok) + expect(response).to have_http_status(:error) + expect(response.body).to include('not compatible with the Windows-1252 character set') end end end + end - it 'appends the attachments to the 40-10007 PDF' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', - 'vba_40_10007_with_supporting_document.json') - pdf_path = Rails.root.join('spec', 'fixtures', 'files', 'doctors-note.pdf') - data = JSON.parse(fixture_path.read) - attachment = double - allow(attachment).to receive(:to_pdf).and_return(pdf_path) - expect(PersistentAttachment).to receive(:where).with(guid: ['a-random-uuid']).and_return([attachment]) - post '/simple_forms_api/v1/simple_forms', params: data - expect(response).to have_http_status(:ok) + context 'going to S3' do + ivc_forms.each do |form| + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', form) + data = JSON.parse(fixture_path.read) + + it 'uploads a PDF file to S3' do + allow(SimpleFormsApiSubmission::MetadataValidator).to receive(:validate) + allow_any_instance_of(Aws::S3::Client).to receive(:put_object).and_return(true) + + post '/simple_forms_api/v1/simple_forms', params: data + + expect(response).to have_http_status(:ok) + end + end + end + + context 'going to Lighthouse Benefits Claims API' do + before do + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/404_response') + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/200_response_survivor') + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/create_compensation_200_response') + end + + after do + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/404_response') + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/200_response_survivor') + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/create_compensation_200_response') + end + + context 'authenticated' do + before do + sign_in + allow_any_instance_of(User).to receive(:icn).and_return('123498767V234859') + allow_any_instance_of(Auth::ClientCredentials::Service).to receive(:get_token).and_return('fake_token') + end + + context 'request with intent to file' do + context 'veteran' do + it 'makes the request with an intent to file' do + fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', + 'vba_21_0966-min.json') + data = JSON.parse(fixture_path.read) + data['preparer_identification'] = 'VETERAN' + + post '/simple_forms_api/v1/simple_forms', params: data + + expect(response).to have_http_status(:ok) + end end end end @@ -368,37 +402,6 @@ end end end - - describe 'transliterating fields' do - context 'transliteration succeeds' do - it 'responds with ok' do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload_location') do - VCR.use_cassette('lighthouse/benefits_intake/200_lighthouse_intake_upload') do - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', - 'form_with_accented_chars_21_0966.json') - data = JSON.parse(fixture_path.read) - - post '/simple_forms_api/v1/simple_forms', params: data - - expect(response).to have_http_status(:ok) - end - end - end - end - - context 'transliteration fails' do - it 'responds with an error' do - fixture_path = Rails.root.join('modules', 'simple_forms_api', 'spec', 'fixtures', 'form_json', - 'form_with_non_latin_chars_21_0966.json') - data = JSON.parse(fixture_path.read) - - post '/simple_forms_api/v1/simple_forms', params: data - - expect(response).to have_http_status(:error) - expect(response.body).to include('not compatible with the Windows-1252 character set') - end - end - end end describe '#submit_supporting_documents' do @@ -429,80 +432,91 @@ describe '#get_intents_to_file' do before do + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/404_response') + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/404_response_pension') + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/404_response_survivor') sign_in allow_any_instance_of(User).to receive(:icn).and_return('123498767V234859') allow_any_instance_of(Auth::ClientCredentials::Service).to receive(:get_token).and_return('fake_token') end + after do + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/404_response') + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/404_response_pension') + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/404_response_survivor') + end + describe 'no intents on file' do it 'returns no intents' do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response_pension') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response_survivor') do - get '/simple_forms_api/v1/simple_forms/get_intents_to_file' - - parsed_response = JSON.parse(response.body) - expect(parsed_response['compensation_intent']).to eq nil - expect(parsed_response['pension_intent']).to eq nil - expect(parsed_response['survivor_intent']).to eq nil - expect(response).to have_http_status(:ok) - end - end - end + get '/simple_forms_api/v1/simple_forms/get_intents_to_file' + + parsed_response = JSON.parse(response.body) + expect(parsed_response['compensation_intent']).to eq nil + expect(parsed_response['pension_intent']).to eq nil + expect(parsed_response['survivor_intent']).to eq nil + expect(response).to have_http_status(:ok) end end describe 'compensation intent on file' do + before do + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/200_response') + end + + after do + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/200_response') + end + it 'returns a compensation intent' do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/200_response') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response_pension') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response_survivor') do - get '/simple_forms_api/v1/simple_forms/get_intents_to_file' - - parsed_response = JSON.parse(response.body) - expect(parsed_response['compensation_intent']['type']).to eq 'compensation' - expect(parsed_response['pension_intent']).to eq nil - expect(parsed_response['survivor_intent']).to eq nil - expect(response).to have_http_status(:ok) - end - end - end + get '/simple_forms_api/v1/simple_forms/get_intents_to_file' + + parsed_response = JSON.parse(response.body) + expect(parsed_response['compensation_intent']['type']).to eq 'compensation' + expect(parsed_response['pension_intent']).to eq nil + expect(parsed_response['survivor_intent']).to eq nil + expect(response).to have_http_status(:ok) end end describe 'pension intent on file' do + before do + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') + end + + after do + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') + end + it 'returns a pension intent' do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response_survivor') do - get '/simple_forms_api/v1/simple_forms/get_intents_to_file' - - parsed_response = JSON.parse(response.body) - expect(parsed_response['compensation_intent']).to eq nil - expect(parsed_response['pension_intent']['type']).to eq 'pension' - expect(parsed_response['survivor_intent']).to eq nil - expect(response).to have_http_status(:ok) - end - end - end + get '/simple_forms_api/v1/simple_forms/get_intents_to_file' + + parsed_response = JSON.parse(response.body) + expect(parsed_response['compensation_intent']).to eq nil + expect(parsed_response['pension_intent']['type']).to eq 'pension' + expect(parsed_response['survivor_intent']).to eq nil + expect(response).to have_http_status(:ok) end end describe 'both intents on file' do + before do + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/200_response') + VCR.insert_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') + end + + after do + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/200_response') + VCR.eject_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') + end + it 'returns a pension intent' do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/200_response') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/200_response_pension') do - VCR.use_cassette('lighthouse/benefits_claims/intent_to_file/404_response_survivor') do - get '/simple_forms_api/v1/simple_forms/get_intents_to_file' - - parsed_response = JSON.parse(response.body) - expect(parsed_response['compensation_intent']['type']).to eq 'compensation' - expect(parsed_response['pension_intent']['type']).to eq 'pension' - expect(parsed_response['survivor_intent']).to eq nil - expect(response).to have_http_status(:ok) - end - end - end + get '/simple_forms_api/v1/simple_forms/get_intents_to_file' + + parsed_response = JSON.parse(response.body) + expect(parsed_response['compensation_intent']['type']).to eq 'compensation' + expect(parsed_response['pension_intent']['type']).to eq 'pension' + expect(parsed_response['survivor_intent']).to eq nil + expect(response).to have_http_status(:ok) end end end diff --git a/modules/travel_pay/app/controllers/travel_pay/application_controller.rb b/modules/travel_pay/app/controllers/travel_pay/application_controller.rb index 7e522c1a4a1..ae4696eb0a0 100644 --- a/modules/travel_pay/app/controllers/travel_pay/application_controller.rb +++ b/modules/travel_pay/app/controllers/travel_pay/application_controller.rb @@ -38,6 +38,16 @@ def after_logger logger.info('travel-pay') { Utils::Logger.build(self).after } end + def authorize + auth_header = request.headers['Authorization'] + raise_unauthorized('Missing Authorization header') if auth_header.nil? + raise_unauthorized('Authorization header missing Bearer token') unless auth_header.start_with?('Bearer ') + end + + def raise_unauthorized(detail) + raise Common::Exceptions::Unauthorized.new(detail:) + end + # Blocks requests from being handled if feature flag is disabled def block_if_flag_disabled unless Flipper.enabled?(:travel_pay_power_switch, @current_user) diff --git a/modules/travel_pay/app/controllers/travel_pay/claims_controller.rb b/modules/travel_pay/app/controllers/travel_pay/claims_controller.rb index 413d9ea4a68..59cce20d36d 100644 --- a/modules/travel_pay/app/controllers/travel_pay/claims_controller.rb +++ b/modules/travel_pay/app/controllers/travel_pay/claims_controller.rb @@ -2,12 +2,13 @@ module TravelPay class ClaimsController < ApplicationController + before_action :authorize + def index veis_token = client.request_veis_token - # Non-intuitive Ruby behavior: #split splits a string on space by default - vagov_token = request.headers['Authorization'].split[1] - btsss_token = client.request_btsss_token(veis_token, vagov_token) + sts_token = client.request_sts_token(@current_user) + btsss_token = client.request_btsss_token(veis_token, sts_token) begin claims = client.get_claims(veis_token, btsss_token) diff --git a/modules/travel_pay/app/controllers/travel_pay/pings_controller.rb b/modules/travel_pay/app/controllers/travel_pay/pings_controller.rb index 8529b72d842..6f8964a7fd2 100644 --- a/modules/travel_pay/app/controllers/travel_pay/pings_controller.rb +++ b/modules/travel_pay/app/controllers/travel_pay/pings_controller.rb @@ -2,6 +2,8 @@ module TravelPay class PingsController < ApplicationController + before_action :authorize, only: [:authorized_ping] + def ping veis_token = client.request_veis_token @@ -11,9 +13,9 @@ def ping end def authorized_ping - vagov_token = request.headers['Authorization'].split[1] + sts_token = client.request_sts_token(@current_user) veis_token = client.request_veis_token - btsss_token = client.request_btsss_token(veis_token, vagov_token) + btsss_token = client.request_btsss_token(veis_token, sts_token) btsss_authorized_ping_response = client.authorized_ping(veis_token, btsss_token) render json: { diff --git a/modules/travel_pay/app/services/travel_pay/client.rb b/modules/travel_pay/app/services/travel_pay/client.rb index 7cafe4a677f..24ef261c2c9 100644 --- a/modules/travel_pay/app/services/travel_pay/client.rb +++ b/modules/travel_pay/app/services/travel_pay/client.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'securerandom' + module TravelPay class Client ## @@ -24,7 +26,7 @@ def request_veis_token # # @return [Faraday::Response] # - def request_btsss_token(veis_token, vagov_token) + def request_btsss_token(veis_token, sts_token) btsss_url = Settings.travel_pay.base_url api_key = Settings.travel_pay.subscription_key client_number = Settings.travel_pay.client_number @@ -33,7 +35,7 @@ def request_btsss_token(veis_token, vagov_token) req.headers['Authorization'] = "Bearer #{veis_token}" req.headers['Ocp-Apim-Subscription-Key'] = api_key req.headers['BTSSS-API-Client-Number'] = client_number.to_s - req.body = { authJwt: vagov_token } + req.body = { authJwt: sts_token } end response.body['access_token'] end @@ -90,8 +92,59 @@ def get_claims(veis_token, btsss_token) symbolized_body[:data].sort_by(&parse_claim_date).reverse! end + def request_sts_token(user) + host_baseurl = build_host_baseurl({ ip_form: false }) + private_key_file = Settings.sign_in.sts_client.key_path + private_key = OpenSSL::PKey::RSA.new(File.read(private_key_file)) + + assertion = build_sts_assertion(user) + jwt = JWT.encode(assertion, private_key, 'RS256') + + # send to sis + response = connection(server_url: host_baseurl).post('/v0/sign_in/token') do |req| + req.params['grant_type'] = 'urn:ietf:params:oauth:grant-type:jwt-bearer' + req.params['assertion'] = jwt + end + + response.body['data']['access_token'] + end + private + def build_sts_assertion(user) + service_account_id = Settings.travel_pay.sts.service_account_id + host_baseurl = build_host_baseurl({ ip_form: false }) + audience_baseurl = build_host_baseurl({ ip_form: true }) + + current_time = Time.now.to_i + jti = SecureRandom.uuid + + { + 'iss' => host_baseurl, + 'sub' => user.email, + 'aud' => "#{audience_baseurl}/v0/sign_in/token", + 'iat' => current_time, + 'exp' => current_time + 300, + 'scopes' => [], + 'service_account_id' => service_account_id, + 'jti' => jti, + 'user_attributes' => { 'icn' => user.icn } + } + end + + def build_host_baseurl(config) + env = Settings.vsp_environment + host = Settings.hostname + + if env == 'localhost' + return 'http://127.0.0.1:3000' if config[:ip_form] + + 'http://localhost:3000' + end + + "https://#{host}" + end + def veis_params { client_id: Settings.travel_pay.veis.client_id, @@ -112,7 +165,7 @@ def connection(server_url:) Faraday.new(url: server_url) do |conn| conn.use :breakers conn.response :raise_error, error_prefix: service_name, include_request: true - conn.response :betamocks if use_fakes? + conn.response :betamocks if mock_enabled? conn.response :json conn.request :json @@ -123,8 +176,8 @@ def connection(server_url:) ## # Syntactic sugar for determining if the client should use # fake api responses or actually connect to the BTSSS API - def use_fakes? - Settings.useFakes + def mock_enabled? + Settings.travel_pay.mock end end end diff --git a/modules/travel_pay/spec/controllers/claims_controller_spec.rb b/modules/travel_pay/spec/controllers/claims_controller_spec.rb index 0762820acf5..16c2ca24639 100644 --- a/modules/travel_pay/spec/controllers/claims_controller_spec.rb +++ b/modules/travel_pay/spec/controllers/claims_controller_spec.rb @@ -12,9 +12,13 @@ .to receive(:request_veis_token) .and_return('veis_token') + allow_any_instance_of(TravelPay::Client) + .to receive(:request_sts_token) + .and_return('sts_token') + allow_any_instance_of(TravelPay::Client) .to receive(:request_btsss_token) - .with('veis_token', 'vagov_token') + .with('veis_token', 'sts_token') .and_return('btsss_token') allow_any_instance_of(TravelPay::Client) @@ -34,9 +38,13 @@ .to receive(:request_veis_token) .and_return('veis_token') + allow_any_instance_of(TravelPay::Client) + .to receive(:request_sts_token) + .and_return('sts_token') + allow_any_instance_of(TravelPay::Client) .to receive(:request_btsss_token) - .with('veis_token', 'vagov_token') + .with('veis_token', 'sts_token') .and_return('btsss_token') allow_any_instance_of(TravelPay::Client) diff --git a/modules/travel_pay/spec/controllers/pings_controller_spec.rb b/modules/travel_pay/spec/controllers/pings_controller_spec.rb index 750a96600bf..93c43f00240 100644 --- a/modules/travel_pay/spec/controllers/pings_controller_spec.rb +++ b/modules/travel_pay/spec/controllers/pings_controller_spec.rb @@ -48,6 +48,9 @@ before do btsss_authorized_ping_response = double allow(btsss_authorized_ping_response).to receive(:status).and_return(200) + allow(client) + .to receive(:request_sts_token) + .and_return('sample_sts_token') allow(client) .to receive(:request_btsss_token) .and_return('sample_btsss_token') diff --git a/rakelib/rswag.rake b/rakelib/rswag.rake index ce030b04aff..2d1a184fbae 100644 --- a/rakelib/rswag.rake +++ b/rakelib/rswag.rake @@ -33,16 +33,6 @@ end namespace :rswag do namespace :claims_api do - desc 'Generate rswag docs for claims_api' - task run: :environment do - ENV['PATTERN'] = 'modules/claims_api/spec/requests/**/*_spec.rb' - ENV['RAILS_MODULE'] = 'claims_api' - ENV['SWAGGER_DRY_RUN'] = '0' - Rake::Task['rswag:specs:swaggerize'].invoke - - %w[v1 v2].each { |version| format_for_swagger(version) } - end - desc 'Generate rswag docs by environment for the claims_api' task build: :environment do ENV['PATTERN'] = 'modules/claims_api/spec/requests/**/*_spec.rb' diff --git a/spec/controllers/v0/profile/direct_deposits_controller_spec.rb b/spec/controllers/v0/profile/direct_deposits_controller_spec.rb index 1e0af7acae2..3dd8abc3e91 100644 --- a/spec/controllers/v0/profile/direct_deposits_controller_spec.rb +++ b/spec/controllers/v0/profile/direct_deposits_controller_spec.rb @@ -181,7 +181,7 @@ context 'when the user does have an associated email address' do it 'sends an email through va notify' do expect(VANotifyDdEmailJob).to receive(:send_to_emails).with( - user.all_emails, 'comp_and_pen' + user.all_emails ) VCR.use_cassette('lighthouse/direct_deposit/update/200_valid') do diff --git a/spec/lib/saml/post_url_service_spec.rb b/spec/lib/saml/post_url_service_spec.rb index 692020efd7a..fb2c9df8172 100644 --- a/spec/lib/saml/post_url_service_spec.rb +++ b/spec/lib/saml/post_url_service_spec.rb @@ -613,29 +613,102 @@ let(:expected_log_message) { 'Redirecting to /terms-of-use' } let(:expected_log_payload) { { type: :ssoe } } - context 'when tracker application is within Settings.terms_of_use.enabled_clients' do + context 'when associated terms of use redirect user cache object exists' do + let(:cache_key) { "terms_of_use_redirect_user_#{user.uuid}" } + let(:enabled_clients) { application } + let(:cache_expiration) { 5.minutes } + before do - allow(Settings.terms_of_use).to receive(:enabled_clients).and_return(application) + allow(Settings.terms_of_use).to receive(:enabled_clients).and_return(enabled_clients) + allow(Rails.cache).to receive(:read).with(cache_key).and_return(application) end - context 'and authentication is occuring on a review instance' do - let(:review_instance_slug) { 'some-review-instance-slug' } - let(:review_instance_url) { "#{review_instance_slug}.review.vetsgov-internal" } + context 'and application is within Settings.terms_of_use.enabled_clients' do + let(:enabled_clients) { application } - before { allow(Settings).to receive(:review_instance_slug).and_return(review_instance_slug) } + context 'and authentication is occuring on a review instance' do + let(:review_instance_slug) { 'some-review-instance-slug' } + let(:review_instance_url) { "#{review_instance_slug}.review.vetsgov-internal" } - it 'has a login redirect url as a parameter embedded in review instance terms of use page' do - expect(subject.terms_of_use_redirect_url) - .to eq("http://#{review_instance_url}/terms-of-use?#{expected_redirect_url_param}") + before { allow(Settings).to receive(:review_instance_slug).and_return(review_instance_slug) } + + it 'has a login redirect url as a parameter embedded in review instance terms of use page' do + expect(subject.terms_of_use_redirect_url) + .to eq("http://#{review_instance_url}/terms-of-use?#{expected_redirect_url_param}") + end + + it 'logs expected message and payload' do + expect(Rails.logger).to receive(:info).with(expected_log_message, expected_log_payload) + subject.terms_of_use_redirect_url + end end - it 'logs expected message and payload' do - expect(Rails.logger).to receive(:info).with(expected_log_message, expected_log_payload) - subject.terms_of_use_redirect_url + context 'and authentication is not occurring on a review instance' do + it 'has a login redirect url as a parameter embedded in terms of use page with success' do + expect(subject.terms_of_use_redirect_url) + .to eq("#{values[:base_redirect]}/terms-of-use?#{expected_redirect_url_param}") + end + + it 'logs expected message and payload' do + expect(Rails.logger).to receive(:info).with(expected_log_message, expected_log_payload) + subject.terms_of_use_redirect_url + end end end - context 'and authentication is not occurring on a review instance' do + context 'and stored application is not within Settings.terms_of_use.enabled_clients' do + let(:enabled_clients) { '' } + + it 'has a login redirect url with success not embedded in a terms of use page' do + expect(subject.terms_of_use_redirect_url).to eq(expected_login_redirect_url) + end + end + + it 'deletes the cached terms of use redirect user object' do + expect(Rails.cache).to receive(:delete).with(cache_key) + subject.terms_of_use_redirect_url + end + end + + context 'when associated terms of use redirect user cache object does not exist' do + context 'when tracker application is within Settings.terms_of_use.enabled_clients' do + before do + allow(Settings.terms_of_use).to receive(:enabled_clients).and_return(application) + end + + context 'and authentication is occuring on a review instance' do + let(:review_instance_slug) { 'some-review-instance-slug' } + let(:review_instance_url) { "#{review_instance_slug}.review.vetsgov-internal" } + + before { allow(Settings).to receive(:review_instance_slug).and_return(review_instance_slug) } + + it 'has a login redirect url as a parameter embedded in review instance terms of use page' do + expect(subject.terms_of_use_redirect_url) + .to eq("http://#{review_instance_url}/terms-of-use?#{expected_redirect_url_param}") + end + + it 'logs expected message and payload' do + expect(Rails.logger).to receive(:info).with(expected_log_message, expected_log_payload) + subject.terms_of_use_redirect_url + end + end + + context 'and authentication is not occurring on a review instance' do + it 'has a login redirect url as a parameter embedded in terms of use page with success' do + expect(subject.terms_of_use_redirect_url) + .to eq("#{values[:base_redirect]}/terms-of-use?#{expected_redirect_url_param}") + end + + it 'logs expected message and payload' do + expect(Rails.logger).to receive(:info).with(expected_log_message, expected_log_payload) + subject.terms_of_use_redirect_url + end + end + end + + context 'when tracker application is nil' do + let(:application) { nil } + it 'has a login redirect url as a parameter embedded in terms of use page with success' do expect(subject.terms_of_use_redirect_url) .to eq("#{values[:base_redirect]}/terms-of-use?#{expected_redirect_url_param}") @@ -646,30 +719,16 @@ subject.terms_of_use_redirect_url end end - end - - context 'when tracker application is nil' do - let(:application) { nil } - - it 'has a login redirect url as a parameter embedded in terms of use page with success' do - expect(subject.terms_of_use_redirect_url) - .to eq("#{values[:base_redirect]}/terms-of-use?#{expected_redirect_url_param}") - end - - it 'logs expected message and payload' do - expect(Rails.logger).to receive(:info).with(expected_log_message, expected_log_payload) - subject.terms_of_use_redirect_url - end - end - context 'when tracker application is not within Settings.terms_of_use.enabled_clients' do - before do - allow(Settings.terms_of_use).to receive(:enabled_clients).and_return('') - end + context 'when tracker application is not within Settings.terms_of_use.enabled_clients' do + before do + allow(Settings.terms_of_use).to receive(:enabled_clients).and_return('') + end - it 'has a login redirect url with success not embedded in a terms of use page' do - expect(subject.terms_of_use_redirect_url) - .to eq(expected_login_redirect_url) + it 'has a login redirect url with success not embedded in a terms of use page' do + expect(subject.terms_of_use_redirect_url) + .to eq(expected_login_redirect_url) + end end end end diff --git a/spec/sidekiq/va_notify_dd_email_job_spec.rb b/spec/sidekiq/va_notify_dd_email_job_spec.rb index 10a5d528e74..406ee454aa7 100644 --- a/spec/sidekiq/va_notify_dd_email_job_spec.rb +++ b/spec/sidekiq/va_notify_dd_email_job_spec.rb @@ -38,19 +38,42 @@ describe '#perform' do let(:notification_client) { double('Notifications::Client') } - %w[ch33 comp_pen].each do |dd_type| - context "with a dd type of #{dd_type}" do - it 'sends a confirmation email' do - allow(VaNotify::Service).to receive(:new) - .with(Settings.vanotify.services.va_gov.api_key).and_return(notification_client) - - expect(notification_client).to receive(:send_email).with( - email_address: email, - template_id: dd_type == 'ch33' ? 'edu_template_id' : 'comp_pen_template_id' - ) - - described_class.new.perform(email, dd_type) - end + context 'with a dd type of ch33' do + it 'sends a confirmation email using the edu template' do + allow(VaNotify::Service).to receive(:new) + .with(Settings.vanotify.services.va_gov.api_key).and_return(notification_client) + + expect(notification_client).to receive(:send_email).with( + email_address: email, template_id: 'edu_template_id' + ) + + described_class.new.perform(email, 'ch33') + end + end + + context 'with a dd type of comp_pen' do + it 'sends a confirmation email using the comp and pen template' do + allow(VaNotify::Service).to receive(:new) + .with(Settings.vanotify.services.va_gov.api_key).and_return(notification_client) + + expect(notification_client).to receive(:send_email).with( + email_address: email, template_id: 'comp_pen_template_id' + ) + + described_class.new.perform(email, 'comp_pen') + end + end + + context 'without a dd type' do + it 'sends a confirmation email using the direct_deposit template' do + allow(VaNotify::Service).to receive(:new) + .with(Settings.vanotify.services.va_gov.api_key).and_return(notification_client) + + expect(notification_client).to receive(:send_email).with( + email_address: email, template_id: 'direct_deposit_template_id' + ) + + described_class.new.perform(email, nil) end end @@ -89,4 +112,26 @@ .and trigger_statsd_increment('worker.direct_deposit_confirmation_email.error') end end + + describe '#get_template' do + let(:job) { VANotifyDdEmailJob.new } + + context 'when dd_type is nil' do + it 'returns the direct_deposit template' do + expect(job.template_type(nil)).to eq('direct_deposit') + end + end + + context 'when dd_type is comp_pen' do + it 'returns the direct_deposit template' do + expect(job.template_type('comp_pen')).to eq('direct_deposit_comp_pen') + end + end + + context 'when dd_type is edu' do + it 'returns the direct_deposit template' do + expect(job.template_type('edu')).to eq('direct_deposit') + end + end + end end