Browse Source

Update provider_type and add new fields

pull/2652/head
Kat 2 years ago
parent
commit
410ebfb863
  1. 4
      app/services/exports/organisation_export_constants.rb
  2. 3
      app/services/exports/organisation_export_service.rb
  3. 4
      spec/fixtures/exports/organisation.xml

4
app/services/exports/organisation_export_constants.rb

@ -20,6 +20,8 @@ module Exports::OrganisationExportConstants
"deleted_at", "deleted_at",
"dsa_signed", "dsa_signed",
"dsa_signed_at", "dsa_signed_at",
"dpo_email" "dpo_email",
"profit_status",
"group"
] ]
end end

3
app/services/exports/organisation_export_service.rb

@ -62,6 +62,9 @@ module Exports
attribute_hash["dsa_signed"] = organisation.data_protection_confirmed? attribute_hash["dsa_signed"] = organisation.data_protection_confirmed?
attribute_hash["dsa_signed_at"] = organisation.data_protection_confirmation&.signed_at attribute_hash["dsa_signed_at"] = organisation.data_protection_confirmation&.signed_at
attribute_hash["dpo_email"] = organisation.data_protection_confirmation&.data_protection_officer_email attribute_hash["dpo_email"] = organisation.data_protection_confirmation&.data_protection_officer_email
attribute_hash["provider_type"] = organisation.provider_type_before_type_cast
attribute_hash["profit_status"] = nil # will need update when we add the field to the org
attribute_hash["group"] = nil # will need update when we add the field to the org
attribute_hash attribute_hash
end end

4
spec/fixtures/exports/organisation.xml vendored

@ -4,7 +4,7 @@
<id>{id}</id> <id>{id}</id>
<name>MHCLG</name> <name>MHCLG</name>
<phone/> <phone/>
<provider_type>LA</provider_type> <provider_type>1</provider_type>
<address_line1>2 Marsham Street</address_line1> <address_line1>2 Marsham Street</address_line1>
<address_line2>London</address_line2> <address_line2>London</address_line2>
<postcode>SW1P 4DF</postcode> <postcode>SW1P 4DF</postcode>
@ -20,5 +20,7 @@
<dsa_signed>true</dsa_signed> <dsa_signed>true</dsa_signed>
<dsa_signed_at>{dsa_signed_at}</dsa_signed_at> <dsa_signed_at>{dsa_signed_at}</dsa_signed_at>
<dpo_email>{dpo_email}</dpo_email> <dpo_email>{dpo_email}</dpo_email>
<profit_status/>
<group/>
</form> </form>
</forms> </forms>

Loading…
Cancel
Save