modules/claims_api/app/models/claims_api/auto_established_claim.rb
def transform_service_branch
      received_service_periods = form_data['serviceInformation']['servicePeriods']

      transformed_service_periods = received_service_periods.map do |period|
        name = period['serviceBranch']
        period['serviceBranch'] = ClaimsApi::ServiceBranchMapper.new(name).value

        period
      end

      form_data['serviceInformation']['servicePeriods'] = transformed_service_periods
      form_data['serviceInformation']
    end
# For whatever reason, legacy ClaimsApi code previously allowed
# 'serviceInformation.servicePeriod.serviceBranch' values that are not accepted by EVSS.
# Rather than refuse those invalid values, this maps them to an equivalent value that EVSS will accept.
For whatever reason, legacy ClaimsApi code previously allowed
'serviceInformation.servicePeriod.serviceBranch' values that are not accepted by EVSS.
Rather than refuse those invalid values, this maps them to an equivalent value that EVSS will accept.
For whatever reason legacy ClaimsApi code previously allowed ' serviceInformation . servicePeriod . serviceBranch ' values that are not accepted by EVSS . Rather than refuse those invalid values this maps them to an equivalent value that EVSS will accept .
def transform_service_branch
      received_service_periods = form_data['serviceInformation']['servicePeriods']
      transformed_service_periods = received_service_periods.map do |period|
        name = period['serviceBranch']
        period['serviceBranch'] = ClaimsApi::ServiceBranchMapper.new(name).value
        period
      end
      form_data['serviceInformation']['servicePeriods'] = transformed_service_periods
      form_data['serviceInformation']
    end
def transform_service_branch received_service_periods = form_data [ 'serviceInformation' ] [ 'servicePeriods' ] transformed_service_periods = received_service_periods . map do | period | name = period [ 'serviceBranch' ] period [ 'serviceBranch' ] = ClaimsApi :: ServiceBranchMapper . new ( name ) . value period end form_data [ 'serviceInformation' ] [ 'servicePeriods' ] = transformed_service_periods form_data [ 'serviceInformation' ] end
For whatever reason, legacy ClaimsApi code previously allowed
'serviceInformation.servicePeriod.serviceBranch' values that are not accepted by EVSS.
For whatever reason legacy ClaimsApi code previously allowed ' serviceInformation . servicePeriod . serviceBranch ' values that are not accepted by EVSS .