Browse Source

derive if ethnic has been refused from ethnic group

pull/537/head
Ted 3 years ago
parent
commit
d762f4ac05
  1. 5
      app/models/case_log.rb
  2. 2
      app/services/imports/case_logs_import_service.rb
  3. 2
      spec/fixtures/softwire_imports/case_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml

5
app/models/case_log.rb

@ -320,6 +320,10 @@ class CaseLog < ApplicationRecord
hb == 7 hb == 7
end end
def ethnic_refused?
ethnic_group == 17
end
def receives_housing_related_benefits? def receives_housing_related_benefits?
receives_housing_benefit_only? || receives_uc_with_housing_element_excl_housing_benefit? || receives_housing_benefit_only? || receives_uc_with_housing_element_excl_housing_benefit? ||
receives_housing_benefit_and_universal_credit? receives_housing_benefit_and_universal_credit?
@ -435,6 +439,7 @@ private
self.totelder = get_totelder self.totelder = get_totelder
self.totadult = get_totadult self.totadult = get_totadult
self.refused = get_refused self.refused = get_refused
self.ethnic = 17 if ethnic_refused?
if %i[brent scharge pscharge supcharg].any? { |f| public_send(f).present? } if %i[brent scharge pscharge supcharg].any? { |f| public_send(f).present? }
self.brent ||= 0 self.brent ||= 0
self.scharge ||= 0 self.scharge ||= 0

2
app/services/imports/case_logs_import_service.rb

@ -428,7 +428,7 @@ module Imports
4 4
when 17 when 17
# Refused # Refused
5 17
end end
end end

2
spec/fixtures/softwire_imports/case_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml vendored

@ -52,7 +52,7 @@
<P1AR/> <P1AR/>
<P1Sex override-field="">Female</P1Sex> <P1Sex override-field="">Female</P1Sex>
<P1Eco>6) Not Seeking Work</P1Eco> <P1Eco>6) Not Seeking Work</P1Eco>
<P1Eth>1 White: English/Scottish/Welsh/Northern Irish/British</P1Eth> <P1Eth>17 Refused</P1Eth>
<P1Nat>1 UK national resident in UK</P1Nat> <P1Nat>1 UK national resident in UK</P1Nat>
<P2Age override-field="">2</P2Age> <P2Age override-field="">2</P2Age>
<P2AR/> <P2AR/>

Loading…
Cancel
Save