Browse Source

Update labels and email content

pull/1952/head
Kat 3 years ago
parent
commit
d31792acb3
  1. 14
      app/mailers/csv_download_mailer.rb
  2. 12
      app/services/csv/missing_addresses_csv_service.rb
  3. 10
      spec/fixtures/files/addresses_reimport.csv
  4. 2
      spec/fixtures/files/addresses_reimport_all_logs.csv
  5. 2
      spec/fixtures/files/missing_lettings_logs_addresses.csv
  6. 4
      spec/fixtures/files/missing_lettings_logs_addresses_all_issues.csv
  7. 2
      spec/fixtures/files/missing_lettings_logs_town_or_city.csv
  8. 4
      spec/fixtures/files/missing_lettings_logs_wrong_uprn.csv
  9. 2
      spec/fixtures/files/missing_sales_logs_addresses.csv
  10. 4
      spec/fixtures/files/missing_sales_logs_addresses_all_issues.csv
  11. 2
      spec/fixtures/files/missing_sales_logs_town_or_city.csv
  12. 4
      spec/fixtures/files/missing_sales_logs_wrong_uprn.csv
  13. 10
      spec/fixtures/files/sales_addresses_reimport.csv
  14. 2
      spec/fixtures/files/sales_addresses_reimport_all_logs.csv
  15. 2
      spec/mailers/csv_download_mailer_spec.rb
  16. 4
      spec/services/csv/missing_addresses_csv_service_spec.rb

14
app/mailers/csv_download_mailer.rb

@ -15,7 +15,7 @@ class CsvDownloadMailer < NotifyMailer
send_email(
user.email,
CSV_MISSING_LETTINGS_ADDRESSES_DOWNLOAD_TEMPLATE_ID,
{ name: user.name, issue_explanation: issue_explanation(issue_types), how_to_fix: how_to_fix(issue_types, link, "lettings"), duration: ActiveSupport::Duration.build(duration).inspect },
{ name: user.name, issue_explanation: issue_explanation(issue_types, "lettings"), how_to_fix: how_to_fix(issue_types, link, "lettings"), duration: ActiveSupport::Duration.build(duration).inspect },
)
end
@ -23,7 +23,7 @@ class CsvDownloadMailer < NotifyMailer
send_email(
user.email,
CSV_MISSING_SALES_ADDRESSES_DOWNLOAD_TEMPLATE_ID,
{ name: user.name, issue_explanation: issue_explanation(issue_types), how_to_fix: how_to_fix(issue_types, link, "sales"), duration: ActiveSupport::Duration.build(duration).inspect },
{ name: user.name, issue_explanation: issue_explanation(issue_types, "sales"), how_to_fix: how_to_fix(issue_types, link, "sales"), duration: ActiveSupport::Duration.build(duration).inspect },
)
end
@ -31,12 +31,12 @@ private
HELPDESK_URL = "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11".freeze
def issue_explanation(issue_types)
def issue_explanation(issue_types, log_type)
[
"We have found #{multiple_issue_types?(issue_types) ? 'these issues' : 'this issue'} in your logs imported to the new version of CORE:\n",
issue_types.include?("missing_address") ? "## Full address required\nThe Unique Property Reference number (UPRN) in some logs is incorrect, so the address data was not imported. Provide the full address and leave the UPRN column blank.\n" : "",
issue_types.include?("missing_town") ? "## Missing town or city\nThe town or city in some logs is missing. This data is required in the new version of CORE.\n" : "",
has_uprn_issues(issue_types) ? uprn_issue_explanation(issue_types) : "",
has_uprn_issues(issue_types) ? uprn_issue_explanation(issue_types, log_type) : "",
].join("")
end
@ -62,11 +62,11 @@ private
issue_types.count > 1 && !uprn_issues_only(issue_types) || issue_types.count > 2
end
def uprn_issue_explanation(issue_types)
def uprn_issue_explanation(issue_types, log_type)
if issue_types.include?("wrong_uprn") && !issue_types.include?("bristol_uprn")
"## Incorrect UPRN\nThe UPRN in some logs may be incorrect, so the wrong address data may have been imported.
In some of your logs, the UPRN is the same as the tenant code or property reference, but these are different things. Property references are codes that yourorganisation uses to identify properties. UPRNs are unique numbers assigned by the Ordnance Survey.
In some of your logs, the UPRN is the same as the #{log_type == 'lettings' ? 'tenant code or property reference' : 'purchaser code'}, but these are different things. #{log_type == 'lettings' ? 'Property references' : 'Purchaser codes'} are codes that your organisation uses to identify properties. UPRNs are unique numbers assigned by the Ordnance Survey.
If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrect, clear the value and provide the full address instead. Alternatively, you can change the UPRN on the CORE system.\n"
elsif issue_types.include?("bristol_uprn") && !issue_types.include?("wrong_uprn")
@ -78,7 +78,7 @@ If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrec
In some of your logs, the UPRN links to an address in Bristol, but this is the first time your organisation has submitted logs for properties in Bristol.
In other logs, the UPRN is the same as the tenant code or property reference, but these are different things. Property references are codes that your organisation uses to identify properties. UPRNs are unique numbers assigned by the Ordnance Survey.
In other logs, the UPRN is the same as the #{log_type == 'lettings' ? 'tenant code or property reference' : 'purchaser code'}, but these are different things. #{log_type == 'lettings' ? 'Property references' : 'Purchaser codes'} are codes that your organisation uses to identify properties. UPRNs are unique numbers assigned by the Ordnance Survey.
If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrect, clear the value and provide the full address instead. Alternatively, you can change the UPRN on the CORE system."
end

12
app/services/csv/missing_addresses_csv_service.rb

@ -28,7 +28,7 @@ module Csv
return if logs_with_missing_addresses.empty? && logs_with_missing_town_or_city.empty? && logs_with_wrong_uprn.empty?
CSV.generate(headers: true) do |csv|
csv << ["Issue type", "Log ID", "Tenancy start date", "Tenant code", "Property reference", "Log owner", "Owning organisation", "Managing organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Propertys postcode"]
csv << ["Issue type", "Log ID", "Tenancy start date", "Tenant code", "Property reference", "Log owner", "Owning organisation", "Managing organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Property's postcode"]
logs_with_missing_addresses.each do |log|
csv << ["Full address required"] + lettings_log_to_csv_row(log)
@ -39,7 +39,7 @@ module Csv
end
logs_with_wrong_uprn.each do |log|
csv << ["UPRN issues"] + lettings_log_to_csv_row(log)
csv << ["Incorrect UPRN"] + lettings_log_to_csv_row(log)
end
end
end
@ -65,7 +65,7 @@ module Csv
return if logs_with_missing_addresses.empty? && logs_with_missing_town_or_city.empty? && logs_with_wrong_uprn.empty?
CSV.generate(headers: true) do |csv|
csv << ["Issue type", "Log ID", "Sale completion date", "Purchaser code", "Log owner", "Owning organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Propertys postcode"]
csv << ["Issue type", "Log ID", "Sale completion date", "Purchaser code", "Log owner", "Owning organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Property's postcode"]
logs_with_missing_addresses.each do |log|
csv << ["Full address required"] + sales_log_to_csv_row(log)
@ -76,7 +76,7 @@ module Csv
end
logs_with_wrong_uprn.each do |log|
csv << ["UPRN issues"] + sales_log_to_csv_row(log)
csv << ["Incorrect UPRN"] + sales_log_to_csv_row(log)
end
end
end
@ -85,7 +85,7 @@ module Csv
logs = @organisation.managed_lettings_logs.filter_by_year(2023)
CSV.generate(headers: true) do |csv|
csv << ["Log ID", "Tenancy start date", "Tenant code", "Property reference", "Log owner", "Owning organisation", "Managing organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Propertys postcode"]
csv << ["Log ID", "Tenancy start date", "Tenant code", "Property reference", "Log owner", "Owning organisation", "Managing organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Property's postcode"]
logs.each do |log|
csv << lettings_log_to_csv_row(log)
@ -97,7 +97,7 @@ module Csv
logs = @organisation.sales_logs.filter_by_year(2023)
CSV.generate(headers: true) do |csv|
csv << ["Log ID", "Sale completion date", "Purchaser code", "Log owner", "Owning organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Propertys postcode"]
csv << ["Log ID", "Sale completion date", "Purchaser code", "Log owner", "Owning organisation", "UPRN", "Address Line 1", "Address Line 2 (optional)", "Town or City", "County (optional)", "Property's postcode"]
logs.each do |log|
csv << sales_log_to_csv_row(log)

10
spec/fixtures/files/addresses_reimport.csv vendored

@ -1,7 +1,7 @@
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Full address required,{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,address 1,address 2,town,county,B1 1BB
Missing town or city,{id2},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,address 3,,city,,B1 1BB
UPRN issues,{id3},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,123,Some Place,,Bristol,,BS1 1AD
UPRN issues,{id4},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,Some Place,,,,BS1 1AD
UPRN issues,,2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,Some Place,,Bristol,,BS1 1AD
UPRN issues,fake_id,2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,{id3},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,123,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,{id4},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,Some Place,,,,BS1 1AD
Incorrect UPRN,,2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,fake_id,2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,Some Place,,Bristol,,BS1 1AD

1 Issue type Log ID Tenancy start date Tenant code Property reference Log owner Owning organisation Managing organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Full address required {id} 2023-04-05 tenancycode propcode testy@example.com Address org Address org address 1 address 2 town county B1 1BB B1 1BB
3 Missing town or city {id2} 2023-04-05 tenancycode propcode testy@example.com Address org Address org address 3 city B1 1BB B1 1BB
4 UPRN issues Incorrect UPRN {id3} 2023-04-05 tenancycode propcode testy@example.com Address org Address org 123 Some Place Bristol BS1 1AD BS1 1AD
5 UPRN issues Incorrect UPRN {id4} 2023-04-05 tenancycode propcode testy@example.com Address org Address org Some Place BS1 1AD BS1 1AD
6 UPRN issues Incorrect UPRN 2023-04-05 tenancycode propcode testy@example.com Address org Address org Some Place Bristol BS1 1AD BS1 1AD
7 UPRN issues Incorrect UPRN fake_id 2023-04-05 tenancycode propcode testy@example.com Address org Address org Some Place Bristol BS1 1AD BS1 1AD

2
spec/fixtures/files/addresses_reimport_all_logs.csv vendored

@ -1,4 +1,4 @@
Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,address 1,address 2,town,county,B1 1BB
{id2},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,address 3,,city,,B1 1BB
{id3},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,123,Some Place,,Bristol,,BS1 1AD

1 Log ID Tenancy start date Tenant code Property reference Log owner Owning organisation Managing organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 {id} 2023-04-05 tenancycode propcode testy@example.com Address org Address org address 1 address 2 town county B1 1BB B1 1BB
3 {id2} 2023-04-05 tenancycode propcode testy@example.com Address org Address org address 3 city B1 1BB B1 1BB
4 {id3} 2023-04-05 tenancycode propcode testy@example.com Address org Address org 123 Some Place Bristol BS1 1AD BS1 1AD

2
spec/fixtures/files/missing_lettings_logs_addresses.csv vendored

@ -1,2 +1,2 @@
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Full address required,{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,,,,,

1 Issue type Log ID Tenancy start date Tenant code Property reference Log owner Owning organisation Managing organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Full address required {id} 2023-04-05 tenancycode propcode testy@example.com Address org Address org

4
spec/fixtures/files/missing_lettings_logs_addresses_all_issues.csv vendored

@ -1,4 +1,4 @@
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Full address required,{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,,,,,
Missing town or city,{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,existing address,,,,
UPRN issues,{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,123,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,123,Some Place,,Bristol,,BS1 1AD

1 Issue type Log ID Tenancy start date Tenant code Property reference Log owner Owning organisation Managing organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Full address required {id} 2023-04-05 tenancycode propcode testy@example.com Address org Address org
3 Missing town or city {id} 2023-04-05 tenancycode propcode testy@example.com Address org Address org existing address
4 UPRN issues Incorrect UPRN {id} 2023-04-05 tenancycode propcode testy@example.com Address org Address org 123 Some Place Bristol BS1 1AD BS1 1AD

2
spec/fixtures/files/missing_lettings_logs_town_or_city.csv vendored

@ -1,2 +1,2 @@
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Missing town or city,{id},2023-04-05,tenancycode,propcode,testy@example.com,Address org,Address org,,existing address,,,,

1 Issue type Log ID Tenancy start date Tenant code Property reference Log owner Owning organisation Managing organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Missing town or city {id} 2023-04-05 tenancycode propcode testy@example.com Address org Address org existing address

4
spec/fixtures/files/missing_lettings_logs_wrong_uprn.csv vendored

@ -1,2 +1,2 @@
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
UPRN issues,{id},2023-04-05,tenancycode,12,testy@example.com,Address org,Address org,12,Some Place,,Newcastle,,EC1N 2TD
Issue type,Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Incorrect UPRN,{id},2023-04-05,tenancycode,12,testy@example.com,Address org,Address org,12,Some Place,,Newcastle,,EC1N 2TD

1 Issue type Log ID Tenancy start date Tenant code Property reference Log owner Owning organisation Managing organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 UPRN issues Incorrect UPRN {id} 2023-04-05 tenancycode 12 testy@example.com Address org Address org 12 Some Place Newcastle EC1N 2TD EC1N 2TD

2
spec/fixtures/files/missing_sales_logs_addresses.csv vendored

@ -1,2 +1,2 @@
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Full address required,{id},2023-04-05,purchaser code,testy@example.com,Address org,,,,,,

1 Issue type Log ID Sale completion date Purchaser code Log owner Owning organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Full address required {id} 2023-04-05 purchaser code testy@example.com Address org

4
spec/fixtures/files/missing_sales_logs_addresses_all_issues.csv vendored

@ -1,4 +1,4 @@
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Full address required,{id},2023-04-05,purchaser code,testy@example.com,Address org,,,,,,
Missing town or city,{id},2023-04-05,purchaser code,testy@example.com,Address org,,existing address line 1,,,,
UPRN issues,{id},2023-04-05,purchaser code,testy@example.com,Address org,123,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,{id},2023-04-05,purchaser code,testy@example.com,Address org,123,Some Place,,Bristol,,BS1 1AD

1 Issue type Log ID Sale completion date Purchaser code Log owner Owning organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Full address required {id} 2023-04-05 purchaser code testy@example.com Address org
3 Missing town or city {id} 2023-04-05 purchaser code testy@example.com Address org existing address line 1
4 UPRN issues Incorrect UPRN {id} 2023-04-05 purchaser code testy@example.com Address org 123 Some Place Bristol BS1 1AD BS1 1AD

2
spec/fixtures/files/missing_sales_logs_town_or_city.csv vendored

@ -1,2 +1,2 @@
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Missing town or city,{id},2023-04-05,purchaser code,testy@example.com,Address org,,existing address line 1,,,,

1 Issue type Log ID Sale completion date Purchaser code Log owner Owning organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Missing town or city {id} 2023-04-05 purchaser code testy@example.com Address org existing address line 1

4
spec/fixtures/files/missing_sales_logs_wrong_uprn.csv vendored

@ -1,2 +1,2 @@
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
UPRN issues,{id},2023-04-05,12,testy@example.com,Address org,12,Some Place,,Newcastle,,EC1N 2TD
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Incorrect UPRN,{id},2023-04-05,12,testy@example.com,Address org,12,Some Place,,Newcastle,,EC1N 2TD

1 Issue type Log ID Sale completion date Purchaser code Log owner Owning organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 UPRN issues Incorrect UPRN {id} 2023-04-05 12 testy@example.com Address org 12 Some Place Newcastle EC1N 2TD EC1N 2TD

10
spec/fixtures/files/sales_addresses_reimport.csv vendored

@ -1,7 +1,7 @@
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Issue type,Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
Full address required,{id},2023-04-05,purchid,testy@example.com,Address org,,address 1,address 2,town,county,B1 1BB
Missing town or city,{id2},2023-04-05,purchid,testy@example.com,Address org,,address 3,,city,,B1 1BB
UPRN issues,{id3},2023-04-05,purchid,testy@example.com,Address org,123,Some Place,,Bristol,,BS1 1AD
UPRN issues,{id4},2023-04-05,purchid,testy@example.com,Address org,,Some Place,,,,BS1 1AD
UPRN issues,,2023-04-05,purchid,testy@example.com,Address org,,Some Place,,Bristol,,BS1 1AD
UPRN issues,fake_id,2023-04-05,purchid,testy@example.com,Address org,,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,{id3},2023-04-05,purchid,testy@example.com,Address org,123,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,{id4},2023-04-05,purchid,testy@example.com,Address org,,Some Place,,,,BS1 1AD
Incorrect UPRN,,2023-04-05,purchid,testy@example.com,Address org,,Some Place,,Bristol,,BS1 1AD
Incorrect UPRN,fake_id,2023-04-05,purchid,testy@example.com,Address org,,Some Place,,Bristol,,BS1 1AD

1 Issue type Log ID Sale completion date Purchaser code Log owner Owning organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 Full address required {id} 2023-04-05 purchid testy@example.com Address org address 1 address 2 town county B1 1BB B1 1BB
3 Missing town or city {id2} 2023-04-05 purchid testy@example.com Address org address 3 city B1 1BB B1 1BB
4 UPRN issues Incorrect UPRN {id3} 2023-04-05 purchid testy@example.com Address org 123 Some Place Bristol BS1 1AD BS1 1AD
5 UPRN issues Incorrect UPRN {id4} 2023-04-05 purchid testy@example.com Address org Some Place BS1 1AD BS1 1AD
6 UPRN issues Incorrect UPRN 2023-04-05 purchid testy@example.com Address org Some Place Bristol BS1 1AD BS1 1AD
7 UPRN issues Incorrect UPRN fake_id 2023-04-05 purchid testy@example.com Address org Some Place Bristol BS1 1AD BS1 1AD

2
spec/fixtures/files/sales_addresses_reimport_all_logs.csv vendored

@ -1,4 +1,4 @@
Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode
Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode
{id},2023-04-05,purchid,testy@example.com,Address org,,address 1,address 2,town,county,B1 1BB
{id2},2023-04-05,purchid,testy@example.com,Address org,,address 3,,city,,B1 1BB
{id3},2023-04-05,purchid,testy@example.com,Address org,123,Some Place,,Bristol,,BS1 1AD

1 Log ID Sale completion date Purchaser code Log owner Owning organisation UPRN Address Line 1 Address Line 2 (optional) Town or City County (optional) Property’s postcode Property's postcode
2 {id} 2023-04-05 purchid testy@example.com Address org address 1 address 2 town county B1 1BB B1 1BB
3 {id2} 2023-04-05 purchid testy@example.com Address org address 3 city B1 1BB B1 1BB
4 {id3} 2023-04-05 purchid testy@example.com Address org 123 Some Place Bristol BS1 1AD BS1 1AD

2
spec/mailers/csv_download_mailer_spec.rb

@ -66,7 +66,7 @@ The town or city in some logs is missing. This data is required in the new versi
issue_explanation: "We have found this issue in your logs imported to the new version of CORE:
## Incorrect UPRN\nThe UPRN in some logs may be incorrect, so the wrong address data may have been imported.
In some of your logs, the UPRN is the same as the tenant code or property reference, but these are different things. Property references are codes that yourorganisation uses to identify properties. UPRNs are unique numbers assigned by the Ordnance Survey.
In some of your logs, the UPRN is the same as the purchaser code, but these are different things. Purchaser codes are codes that your organisation uses to identify properties. UPRNs are unique numbers assigned by the Ordnance Survey.
If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrect, clear the value and provide the full address instead. Alternatively, you can change the UPRN on the CORE system.\n",
how_to_fix: "You need to:\n

4
spec/services/csv/missing_addresses_csv_service_spec.rb

@ -408,7 +408,7 @@ RSpec.describe Csv::MissingAddressesCsvService do
it "returns only headers" do
csv = service.create_lettings_addresses_csv
expect(csv).to eq "Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode\n"
expect(csv).to eq "Log ID,Tenancy start date,Tenant code,Property reference,Log owner,Owning organisation,Managing organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode\n"
end
end
end
@ -505,7 +505,7 @@ RSpec.describe Csv::MissingAddressesCsvService do
it "returns only headers" do
csv = service.create_sales_addresses_csv
expect(csv).to eq("Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Propertys postcode\n")
expect(csv).to eq("Log ID,Sale completion date,Purchaser code,Log owner,Owning organisation,UPRN,Address Line 1,Address Line 2 (optional),Town or City,County (optional),Property's postcode\n")
end
end
end

Loading…
Cancel
Save