Skip to content

Commit

Permalink
is_homeless indicator should use ApplicantFixedAddress tag
Browse files Browse the repository at this point in the history
  • Loading branch information
raghuramg committed Mar 21, 2024
1 parent d10013b commit 082bf73
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/aca_entities/atp/transformers/cv/family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,13 @@ class Family < ::AcaEntities::Operations::Transforms::Transform
add_key 'person.addresses', memoize_record: true, function: AcaEntities::Atp::Functions::AddressBuilder.new
add_key 'person.is_homeless', function: lambda { |v|
member_id = v.find(/record.people.(\w+)$/).map(&:item).last
contacts_information = v.find(Regexp.new("record.people.#{member_id}.augementation")).map(&:item).last[:contacts]
contacts_information.select { |co| co[:category_code].downcase == "home" && co[:contact][:mailing_address].present? }.empty?
applicants = v.resolve(:'insurance_application.insurance_applicants').item
if applicants[member_id.to_sym]&.key?(:fixed_address_indicator)
!applicants[member_id.to_sym][:fixed_address_indicator]
else
contacts_information = v.find(Regexp.new("record.people.#{member_id}.augementation")).map(&:item).last[:contacts]
contacts_information.select { |co| co[:category_code].downcase == "home" && co[:contact][:mailing_address].present? }.empty?
end
}
add_key 'person.emails', function: lambda {|v|
# revisit if condition for emails and phone for dependents
Expand Down

0 comments on commit 082bf73

Please sign in to comment.