app/services/form1010cg/service.rb
# MPI::Service requires a valid UserIdentity to run a search, but only reads the user's attributes.
# This method will build a valid UserIdentity, so MPI::Service can pluck the name, ssn, dob, and gender.
#
# @param form_subject_data [Hash] The data of a specific form subject (ex: claim.parsed_form['veteran'])
# @return [UserIdentity] A valid UserIdentity for the given form_subject
:Service requires a valid UserIdentity to run a search, but only reads the user's attributes.
This method will build a valid UserIdentity, so MPI::Service can pluck the name, ssn, dob, and gender.
: Service requires a valid UserIdentity to run a search but only reads the user ' s attributes . This method will build a valid UserIdentity so MPI :: Service can pluck the name ssn dob and gender .
def build_user_identity_for(form_subject_data)
      UserIdentity.new(
        first_name: form_subject_data['fullName']['first'],
        middle_name: form_subject_data['fullName']['middle'],
        last_name: form_subject_data['fullName']['last'],
        birth_date: form_subject_data['dateOfBirth'],
        gender: form_subject_data['gender'],
        ssn: form_subject_data['ssnOrTin'],
        email: form_subject_data['email'] || 'no-email@example.com',
        uuid: SecureRandom.uuid,
        loa: {
          current: LOA::THREE,
          highest: LOA::THREE
        }
      )
    end
def build_user_identity_for ( form_subject_data ) UserIdentity . new ( first_name : form_subject_data [ 'fullName' ] [ 'first' ] , middle_name : form_subject_data [ 'fullName' ] [ 'middle' ] , last_name : form_subject_data [ 'fullName' ] [ 'last' ] , birth_date : form_subject_data [ 'dateOfBirth' ] , gender : form_subject_data [ 'gender' ] , ssn : form_subject_data [ 'ssnOrTin' ] , email : form_subject_data [ 'email' ] || 'no-email@example.com' , uuid : SecureRandom . uuid , loa : { current : LOA :: THREE , highest : LOA :: THREE } ) end
MPI::Service requires a valid UserIdentity to run a search, but only reads the user's attributes.
MPI :: Service requires a valid UserIdentity to run a search but only reads the user ' s attributes .
A valid UserIdentity for the given form_subject
A valid UserIdentity for the given form_subject
UserIdentity
form_subject_data
The data of a specific form subject (ex: claim.parsed_form['veteran'])
The data of a specific form subject ( ex : claim . parsed_form [ ' veteran ' ] )