Browse Source

Update link expiry time and headers

pull/1953/head
Kat 3 years ago
parent
commit
c5a07c9faf
  1. 2
      app/jobs/email_missing_addresses_csv_job.rb
  2. 4
      app/services/csv/missing_addresses_csv_service.rb
  3. 2
      spec/fixtures/files/missing_lettings_logs_addresses.csv
  4. 2
      spec/fixtures/files/missing_lettings_logs_addresses_all_issues.csv
  5. 2
      spec/fixtures/files/missing_lettings_logs_town_or_city.csv
  6. 2
      spec/fixtures/files/missing_lettings_logs_wrong_uprn.csv
  7. 2
      spec/fixtures/files/missing_sales_logs_addresses.csv
  8. 2
      spec/fixtures/files/missing_sales_logs_addresses_all_issues.csv
  9. 2
      spec/fixtures/files/missing_sales_logs_town_or_city.csv
  10. 2
      spec/fixtures/files/missing_sales_logs_wrong_uprn.csv

2
app/jobs/email_missing_addresses_csv_job.rb

@ -2,7 +2,7 @@ class EmailMissingAddressesCsvJob < ApplicationJob
queue_as :default
BYTE_ORDER_MARK = "\uFEFF".freeze # Required to ensure Excel always reads CSV as UTF-8
EXPIRATION_TIME = 72.hours.to_i
EXPIRATION_TIME = 1.week.to_i
MISSING_ADDRESSES_THRESHOLD = 50
def perform(user_ids, organisation, log_type, skip_uprn_issue_organisations)

4
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", "Lettings log ID", "Tenancy start date", "Tenant code", "Property code", "Log owner", "Owning organisation name", "Managing organisation name", "UPRN", "Address line 1", "Address line 2 (optional)", "Town or City", "County (optional)", "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 << lettings_log_to_csv_row(log, "Full address required")
@ -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", "Sales log ID", "Sale completion date", "Purchaser code", "Log owner", "Owning organisation name", "UPRN", "Address line 1", "Address line 2 (optional)", "Town or City", "County (optional)", "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 << sales_log_to_csv_row(log, "Full address required")

2
spec/fixtures/files/missing_lettings_logs_addresses.csv vendored

@ -1,2 +1,2 @@
Issue type,Lettings log ID,Tenancy start date,Tenant code,Property code,Log owner,Owning organisation name,Managing organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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 Lettings log ID Log ID Tenancy start date Tenant code Property code Property reference Log owner Owning organisation name Owning organisation Managing organisation name Managing organisation UPRN Address line 1 Address Line 1 Address line 2 (optional) Address Line 2 (optional) Town or City County (optional) Postcode Property’s postcode
2 Full address required {id} {id} 2023-04-05 tenancycode propcode propcode testy@example.com Address org Address org Address org Address org

2
spec/fixtures/files/missing_lettings_logs_addresses_all_issues.csv vendored

@ -1,4 +1,4 @@
Issue type,Lettings log ID,Tenancy start date,Tenant code,Property code,Log owner,Owning organisation name,Managing organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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

1 Issue type Lettings log ID Log ID Tenancy start date Tenant code Property code Property reference Log owner Owning organisation name Owning organisation Managing organisation name Managing organisation UPRN Address line 1 Address Line 1 Address line 2 (optional) Address Line 2 (optional) Town or City County (optional) Postcode Property’s postcode
2 Full address required {id} {id} 2023-04-05 tenancycode propcode propcode testy@example.com Address org Address org Address org Address org
3 Missing town or city {id} {id} 2023-04-05 tenancycode propcode propcode testy@example.com Address org Address org Address org Address org existing address existing address
4 UPRN issues {id} {id} 2023-04-05 tenancycode propcode propcode testy@example.com Address org Address org Address org Address org 123 Some Place 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,Lettings log ID,Tenancy start date,Tenant code,Property code,Log owner,Owning organisation name,Managing organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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 Lettings log ID Log ID Tenancy start date Tenant code Property code Property reference Log owner Owning organisation name Owning organisation Managing organisation name Managing organisation UPRN Address line 1 Address Line 1 Address line 2 (optional) Address Line 2 (optional) Town or City County (optional) Postcode Property’s postcode
2 Missing town or city {id} {id} 2023-04-05 tenancycode propcode propcode testy@example.com Address org Address org Address org Address org existing address existing address

2
spec/fixtures/files/missing_lettings_logs_wrong_uprn.csv vendored

@ -1,2 +1,2 @@
Issue type,Lettings log ID,Tenancy start date,Tenant code,Property code,Log owner,Owning organisation name,Managing organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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
UPRN issues,{id},2023-04-05,tenancycode,12,testy@example.com,Address org,Address org,12,Some Place,,Newcastle,,EC1N 2TD

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

2
spec/fixtures/files/missing_sales_logs_addresses.csv vendored

@ -1,2 +1,2 @@
Issue type,Sales log ID,Sale completion date,Purchaser code,Log owner,Owning organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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 Sales log ID Log ID Sale completion date Purchaser code Log owner Owning organisation name Owning organisation UPRN Address line 1 Address Line 1 Address line 2 (optional) Address Line 2 (optional) Town or City County (optional) Postcode Property’s postcode
2 Full address required {id} {id} 2023-04-05 purchaser code testy@example.com Address org Address org

2
spec/fixtures/files/missing_sales_logs_addresses_all_issues.csv vendored

@ -1,4 +1,4 @@
Issue type,Sales log ID,Sale completion date,Purchaser code,Log owner,Owning organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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

1 Issue type Sales log ID Log ID Sale completion date Purchaser code Log owner Owning organisation name Owning organisation UPRN Address line 1 Address Line 1 Address line 2 (optional) Address Line 2 (optional) Town or City County (optional) Postcode Property’s postcode
2 Full address required {id} {id} 2023-04-05 purchaser code testy@example.com Address org Address org
3 Missing town or city {id} {id} 2023-04-05 purchaser code testy@example.com Address org Address org existing address line 1 existing address line 1
4 UPRN issues {id} {id} 2023-04-05 purchaser code testy@example.com Address org Address org 123 Some Place 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,Sales log ID,Sale completion date,Purchaser code,Log owner,Owning organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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 Sales log ID Log ID Sale completion date Purchaser code Log owner Owning organisation name Owning organisation UPRN Address line 1 Address Line 1 Address line 2 (optional) Address Line 2 (optional) Town or City County (optional) Postcode Property’s postcode
2 Missing town or city {id} {id} 2023-04-05 purchaser code testy@example.com Address org Address org existing address line 1 existing address line 1

2
spec/fixtures/files/missing_sales_logs_wrong_uprn.csv vendored

@ -1,2 +1,2 @@
Issue type,Sales log ID,Sale completion date,Purchaser code,Log owner,Owning organisation name,UPRN,Address line 1,Address line 2 (optional),Town or City,County (optional),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
UPRN issues,{id},2023-04-05,12,testy@example.com,Address org,12,Some Place,,Newcastle,,EC1N 2TD

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