Class: VAProfile::Models::AssociatedPerson

Inherits:
Base
  • Object
show all
Defined in:
lib/va_profile/models/associated_person.rb

Constant Summary collapse

PRIMARY_NEXT_OF_KIN =
'Primary Next of Kin'
OTHER_NEXT_OF_KIN =
'Other Next of Kin'
EMERGENCY_CONTACT =
'Emergency Contact'
OTHER_EMERGENCY_CONTACT =
'Other emergency contact'
NOK_TYPES =
[PRIMARY_NEXT_OF_KIN, OTHER_NEXT_OF_KIN].freeze
EC_TYPES =
[EMERGENCY_CONTACT, OTHER_EMERGENCY_CONTACT].freeze
CONTACT_TYPES =
[
  PRIMARY_NEXT_OF_KIN,
  OTHER_NEXT_OF_KIN,
  EMERGENCY_CONTACT,
  OTHER_EMERGENCY_CONTACT
].freeze

Constants inherited from Base

Base::SOURCE_SYSTEM

Class Method Summary collapse

Class Method Details

.build_from(json) ⇒ VAProfile::Models::AssociatedPerson

Translate a VA Profile Health Benefit API response.body.associated_persons

entry to an AssociatedPerson model

rubocop:disable Metrics/MethodLength

Parameters:

Returns:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/va_profile/models/associated_person.rb', line 61

def build_from(json)
  new(
    create_date: json['create_date'],
    udpate_date: json['update_date'],
    tx_audit_id: json['tx_audit_id'],
    source_system: json['source_system'],
    originating_source_system: json['originating_source_system'],
    source_system_user: json['source_system_user'],
    contact_type: json['contact_type'],
    prefix: json['prefix'],
    given_name: json['given_name'],
    middle_name: json['middle_name'],
    family_name: json['family_name'],
    suffix: json['suffix'],
    relationship: json['relationship'],
    address_line1: json['address_line1'],
    address_line2: json['address_line2'],
    address_line3: json['address_line3'],
    city: json['city'],
    state: json['state'],
    county: json['county'],
    zip_code: json['zip_code'],
    zip_plus4: json['zip_plus4'],
    postal_code: json['postal_code'],
    province_code: json['province_code'],
    country: json['country'],
    primary_phone: json['primary_phone'],
    alternate_phone: json['alternate_phone'],
    effective_end_date: json['effective_end_date']
  )
end