Browse Source

CLDC-2168 Bugfix - handle empty file (#1795)

* Bugfix - handle empty file

* Count rows without headers

* Add host to sentry tags

* Add test for blank file with headers

* Fix sales validator

* Validate also content of rows

* Use compact

* Add 2023-2024 lettings empty file spec

* Update sales template
pull/1817/head
Jack 1 year ago committed by GitHub
parent
commit
87a5265c05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/services/bulk_upload/lettings/validator.rb
  2. 4
      app/services/bulk_upload/sales/validator.rb
  3. 2
      config/initializers/sentry.rb
  4. 2
      config/locales/en.yml
  5. BIN
      public/files/bulk-upload-sales-template-2023-24.xlsx
  6. 49
      spec/fixtures/files/2022_23_lettings_bulk_upload_empty_with_headers.csv
  7. 49
      spec/fixtures/files/2023_24_lettings_bulk_upload_empty_with_headers.csv
  8. 46
      spec/services/bulk_upload/lettings/validator_spec.rb
  9. 92
      spec/services/bulk_upload/processor_spec.rb
  10. 13
      spec/services/bulk_upload/sales/validator_spec.rb

4
app/services/bulk_upload/lettings/validator.rb

@ -144,8 +144,8 @@ private
end end
def validate_file_not_empty def validate_file_not_empty
if File.size(path).zero? if File.size(path).zero? || csv_parser.body_rows.flatten.compact.empty?
errors.add(:file, :blank) errors.add(:base, :blank_file)
halt_validations! halt_validations!
end end

4
app/services/bulk_upload/sales/validator.rb

@ -138,8 +138,8 @@ private
end end
def validate_file_not_empty def validate_file_not_empty
if File.size(path).zero? if File.size(path).zero? || csv_parser.body_rows.flatten.compact.empty?
errors.add(:file, :blank) errors.add(:base, :blank_file)
halt_validations! halt_validations!
end end

2
config/initializers/sentry.rb

@ -22,3 +22,5 @@ Sentry.init do |config|
end end
end end
end end
Sentry.set_tags("app_host": ENV["APP_HOST"])

2
config/locales/en.yml

@ -55,12 +55,14 @@ en:
bulk_upload/lettings/validator: bulk_upload/lettings/validator:
attributes: attributes:
base: base:
blank_file: Template is blank - The template must be filled in for us to create the logs and check if data is correct.
wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template" wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template"
over_max_column_count: "Too many columns, please ensure you have used the correct template" over_max_column_count: "Too many columns, please ensure you have used the correct template"
wrong_template: "Incorrect start dates, please ensure you have used the correct template" wrong_template: "Incorrect start dates, please ensure you have used the correct template"
bulk_upload/sales/validator: bulk_upload/sales/validator:
attributes: attributes:
base: base:
blank_file: Template is blank - The template must be filled in for us to create the logs and check if data is correct.
wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template" wrong_field_numbers_count: "Incorrect number of fields, please ensure you have used the correct template"
over_max_column_count: "Too many columns, please ensure you have used the correct template" over_max_column_count: "Too many columns, please ensure you have used the correct template"
wrong_template: "Incorrect sale dates, please ensure you have used the correct template" wrong_template: "Incorrect sale dates, please ensure you have used the correct template"

BIN
public/files/bulk-upload-sales-template-2023-24.xlsx

Binary file not shown.

49
spec/fixtures/files/2022_23_lettings_bulk_upload_empty_with_headers.csv vendored

@ -0,0 +1,49 @@
,Setting up this lettings log,,,,,,,,,,,,,,,,,Property information,,,,,,,,,,,,,,,,,,,,,Tenancy information,,,,,,Household characteristics,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Household needs,,,,,,,,,,,,,,,,,,,,,Household situation,,,,,,,,,,,,,,,,,,,,"Income, benefits and outgoings",,,,,,,,,,,,,,
Question,Which organisation owns this property?,Which organisation manages this letting?,What is the CORE username of the account this letting log should be assigned to? ,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date? - day DD,What is the tenancy start date? - month MM,What is the tenancy start date? - year YY,Is this a London Affordable Rent letting?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,What is the tenant code?,What is the property reference?,What management group does this letting belong to?,What scheme does this letting belong to?,Which location is this letting for?,"If known, provide this property’s UPRN",Address Line 1,Address Line 2,Town or city,County,Part 1 of the property's postcode,Part 2 of the property's postcode,What is the property's local authority?,What type was the property most recently let as?,What is the reason for the property being vacant?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date? - day DD,What is the void date? - month MM,What is the void date? - year YYYY,What date were any major repairs completed on? - day DD,What date were any major repairs completed on? - month MM,What date were any major repairs completed on? - year YY,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the DLUHC privacy notice?,What is the lead tenant’s age?,Which of these best describes the lead tenant’s gender identity? ,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant’s nationality?,Which of these best describes the lead tenant’s working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,"Disabled access needs
a) Fully wheelchair-accessible housing","Disabled access needs
b) Wheelchair access to essential rooms","Disabled access needs
c) Level access housing","Disabled access needs
f) Other disabled access needs","Disabled access needs
g) No disabled access needs","Disabled access needs
h) Don’t know",Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant’s main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Do you know the postcode of the household's last settled home?,Part 1 of postcode of last settled home,Part 2 of postcode of last settled home,What is the local authority of the household's last settled home?,Was the household given 'reasonable preference' by the local authority?,"Reasonable preference reason
They were homeless or about to lose their home (within 56 days)","Reasonable preference reason
They were living in unsanitary, overcrowded or unsatisfactory housing","Reasonable preference reason
They needed to move due to medical and welfare reasons (including disability)","Reasonable preference reason
They needed to move to avoid hardship to themselves or others","Reasonable preference reason
Don't know",Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)? ,Was the letting made under the Common Housing Register (CHR)?,What was the source of referral for this letting?,Do you know the household's combined total income after tax?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,How often does the household pay rent and other charges?,"If this is a care home, how much does the household pay every [time period]?",What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",What do you expect the outstanding amount to be?
Additional info,Organisation's CORE ID,,"If using new core then this will be the email address. If left empty, the letting log will be assigned to the account used to upload the log.","General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing includes direct access hostels, group homes, residential care and nursing homes.",,This is a letting to the same tenant in the same property,,,,,,,This is how you usually refer to this tenancy on your own systems,This is how you usually refer to this property on your own systems,Provide management code if you have one,"Provide scheme code, include the 'S' at the beginning if it has one",Provide location code if you have one,"The UPRN is the Unique Property Reference Number. It's created by the Ordnance Survey so it's a unique number system used across all housing providers, all sectors (i.e. not just social housing) and all across the UK.",,,,,,,,,,"Do not include the offer that led to this letting.
This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0.",,,,"If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom.","This is the date the property became available to let. For a re-let, it's the day after the previous tenant's contract ends. For a new build, conversion, acquisition or lease it's the day after the provider legally took over possession or management.",,,"Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs.",,,,Also known as an ‘introductory period’,"Fixed-term tenancies are for a set time (up to 20 years). Licence agreements are on a rolling basis, mainly for supported housing. Local authorities mostly provide secure tenancies, and housing associations mostly provide assured (ASTs).",,Not including starter or introductory period,,Make sure the tenant has seen the attached privacy notice before completing this log,"This is the household member who does the most paid work. If several people do the same paid work, it's the oldest household member.",,,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,"Excluding national service.
If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners.",,,,,,,,,,,"For example, lifting and carrying objects, or using a keyboard",,"For example, deafness or partial hearing",,"For example, depression or anxiety",,"Anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD)",,"For example, blindness or partial sight",,,,"‘Last settled home' means last long-standing home. For tenants who had temporary accommodation or slept rough, it's where they lived previously.",,,,,,,,Social housing 'reasonable preference' is also known as 'priority need',,,,,,,,,,,,"Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support.",,,"If rent is charged on the property then answer Yes, even if tenants do not pay it themselves.",,,"Amount paid before any service charges, for example hot water or cleaning. Households may get household benefits towards basic rent.","For example, cleaning. Households may get household benefits towards service charge",For example heating or hot water. This doesn’t include housing benefit or Universal Credit.,Any support service charges included in the tenancy agreement,Unnecessary for new CORE users,,Approximate figure only
Values,Numeric,,"Email format if using new CORE.
Alphanumeric, except for commas if using old CORE.",1 - 2,1 - 12,1 - 2,1 - 31,1 - 12,23 - 24,1 - 3,,Text,"Alphanumeric, max 13 characters","Alphanumeric, max 12 characters",1 - 999,Alphanumeric,1 - 999,Numeric,Alphanumeric,,Text,,XX(XX),XXX,"ONS CODE: Alphanumeric, 9 characters beginning with 'E'",1 - 3 or 5 - 8,"5 - 6, or 8 - 20",0+,"1 - 2, 4 or 6 - 10",1 - 2,,1 - 7,1 - 31,1 - 12,20 - 24,1 - 31,1 - 12,14 - 24,1 - 3,1 - 2,2 - 7,Text,1 - 99,1 - 5,1,16 - 120 or R,"F, M, X or R",1 - 19,"12 - 13, 17 - 21",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,1 - 6,3 - 6,1 - 3,,1 or empty,,,,,,1 - 3,1 or empty,,,,,,,,,,1 - 2 or 5 - 10,2 or 5 - 10,"1 - 2, 4, 8 - 14, 16 - 20, 28 - 31 or 34 - 49",Text,"3 - 4, 6 - 7, 9 - 10, 13 - 14, 18 - 19, 21 or 23 - 37",1 or 11,1 - 2,XX(XX),XXX,"ONS CODE: Alphanumeric, 9 characters beginning with 'E'",1 - 3,1 or empty,,,,,1 - 2,,,"1 - 4, 7 - 10, 12 - 17",1 - 3,,0 - 99999,"1, 3, 6, 9 or 10",1 - 4,0 - 1,1 - 10,xxxx.xx,,,,,,1 - 3,xxxx.xx
Can be empty?,No,,Yes,No,,,No,,,"Yes, if letting type is not an Affordable Rent letting (if field 5 = 1 - 4 or 9 - 12)","Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8)","Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8) or if 'Other intermediate rent product' is not selected for type of Intermediate Rent (if field 11 is not 3)",Yes,,"Yes, if letting is general needs (if field 4 = 1) or if location code is provided (if field 17 is not empty)","Yes, if letting is general needs (if field 4 = 1)","Yes, if letting is general needs (if field 4 = 1) or if management code is provided (if field 15 is not empty)","Yes, if letting is supported housing (if field 4 = 2) or if the property's postcode is not empty (if fields 23 and 24 contain full and valid entries)","Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",,"Yes, if letting is supported housing (if field 4 = 2)","Yes, if letting is a renewal (if field 6 = 1) or a first-time let (if field 27 = 15 - 17)","Yes, if letting is a renewal (if field 6 = 1)",,"Yes, if letting is supported housing (if field 4 = 2)",,,,"Yes, if letting is a renewal (if field 6 = 1)",,,Yes,,,No,,,"Yes, if 'Other' is not selected for tenancy type (if field 41 is not 3)","Yes, if letting is not a fixed-term tenancy (if field 41 = 2, 3, 5 or 7)","Yes, if letting is general needs (if field 4 = 1)",No,No,,,,,"Yes, if the other fields about this person (fields 52, 53 and 54) are also empty","Yes, if the other fields about this person (fields 51, 53 and 54) are also empty","Yes, if the other fields about this person (fields 51, 52 and 54) are also empty","Yes, if the other fields about this person (fields 51, 52 and 53) are also empty","Yes, if the other fields about this person (fields 56, 57 and 58) are also empty","Yes, if the other fields about this person (fields 55, 57 and 58) are also empty","Yes, if the other fields about this person (fields 55, 56 and 58) are also empty","Yes, if the other fields about this person (fields 55, 56 and 57) are also empty","Yes, if the other fields about this person (fields 60, 61 and 62) are also empty","Yes, if the other fields about this person (fields 59, 61 and 62) are also empty","Yes, if the other fields about this person (fields 59, 60 and 62) are also empty","Yes, if the other fields about this person (fields 59, 60 and 61) are also empty","Yes, if the other fields about this person (fields 64, 65 and 66) are also empty","Yes, if the other fields about this person (fields 63, 65 and 66) are also empty","Yes, if the other fields about this person (fields 63, 64 and 66) are also empty","Yes, if the other fields about this person (fields 63, 64 and 65) are also empty","Yes, if the other fields about this person (fields 68, 69 and 70) are also empty","Yes, if the other fields about this person (fields 67, 69 and 70) are also empty","Yes, if the other fields about this person (fields 67, 68 and 70) are also empty","Yes, if the other fields about this person (fields 67, 68 and 69) are also empty","Yes, if the other fields about this person (fields 72, 73 and 74) are also empty","Yes, if the other fields about this person (fields 71, 73 and 74) are also empty","Yes, if the other fields about this person (fields 71, 72 and 74) are also empty","Yes, if the other fields about this person (fields 71, 72 and 73) are also empty","Yes, if the other fields about this person (fields 76, 77 and 78) are also empty","Yes, if the other fields about this person (fields 75, 77 and 78) are also empty","Yes, if the other fields about this person (fields 75, 76 and 78) are also empty","Yes, if the other fields about this person (fields 75, 76 and 77) are also empty",No,"Yes, if no one in the household is a current or former regular (if field 79 is not 1)","Yes, if no one in the household is a current or former regular or reserve (if field 79 = 2, 3, 5 or 6)",No,"Yes, if no household members have access needs or if it is unknown (if field 87 or 88 = 1)",,,,"Yes, if a household member has an access need (if at least one of fields 83, 84, 85 and 86 = 1)",,No,"Yes, if no one in the household has a physical or mental health condition (if field 89 is 2 or 3).
If someone in the household does have such a condition (if field 89 = 1), then at least 1 of these fields must be 1.",,,,,,,,,,No,"Yes, if letting is a renewal (if field 6 = 1)",No,"Yes, if 'Other' is not selected for reason for leaving last settled home (if field 102 is not 20)","Yes, if letting is a renewal (if field 6 = 1)",No,,"Yes, if postcode of household's last settled home is not known (if 106 = 2)",,Yes,No,"If household was given 'reasonable preference' (if field 110 = 1), at least one of these fields must be 1.
If household was not given 'reasonable preference' (if field 110 = 2 or 3), these fields will be ignored.",,,,,No,,,"Yes, if letting is a renewal (if field 6 = 1)",No,"Yes, if household's income is unknown (if field 120 = 2 or 3)",,No,,"Yes, if all rent and accommodation charges are provided (if fields 127 - 132 are not empty)",No,"Yes, if accommodation is not a care home (if field 125 = 1) and all rent and accommodation charges are provided (if fields 128 - 132 are not empty)","Yes, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty)",Yes,,,"Yes, if submitting data to new CORE, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty)","Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 123 = 3, 9 or 10)","Yes, if the household does not need to pay rent/charges after receiving housing benefits (if field133 = 2 or 3)"
Type of letting the question applies to,,,,,,,,,,Affordable Rent only,Intermediate Rent only,,,,Supported housing only,,,General needs only,,,,,,,,,,,General needs only,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,
Duplicate check field?,Yes,,,,,,Yes,,,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Yes,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Bulk upload field number,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134
1 Setting up this lettings log Property information Tenancy information Household characteristics Household needs Household situation Income, benefits and outgoings
2 Question Which organisation owns this property? Which organisation manages this letting? What is the CORE username of the account this letting log should be assigned to? What is the needs type? What is the letting type? Is this letting a renewal? What is the tenancy start date? - day DD What is the tenancy start date? - month MM What is the tenancy start date? - year YY Is this a London Affordable Rent letting? Which type of Intermediate Rent is this letting? Which 'Other' type of Intermediate Rent is this letting? What is the tenant code? What is the property reference? What management group does this letting belong to? What scheme does this letting belong to? Which location is this letting for? If known, provide this property’s UPRN Address Line 1 Address Line 2 Town or city County Part 1 of the property's postcode Part 2 of the property's postcode What is the property's local authority? What type was the property most recently let as? What is the reason for the property being vacant? How many times was the property offered between becoming vacant and this letting? What type of unit is the property? Which type of building is the property? Is the property built or adapted to wheelchair-user standards? How many bedrooms does the property have? What is the void date? - day DD What is the void date? - month MM What is the void date? - year YYYY What date were any major repairs completed on? - day DD What date were any major repairs completed on? - month MM What date were any major repairs completed on? - year YY Is this a joint tenancy? Is this a starter tenancy? What is the type of tenancy? If 'Other', what is the type of tenancy? What is the length of the fixed-term tenancy to the nearest year? Is this letting in sheltered accommodation? Has the tenant seen the DLUHC privacy notice? What is the lead tenant’s age? Which of these best describes the lead tenant’s gender identity? Which of these best describes the lead tenant's ethnic background? What is the lead tenant’s nationality? Which of these best describes the lead tenant’s working situation? What is person 2's relationship to the lead tenant? What is person 2's age? Which of these best describes person 2's gender identity? Which of these best describes person 2's working situation? What is person 3's relationship to the lead tenant? What is person 3's age? Which of these best describes person 3's gender identity? Which of these best describes person 3's working situation? What is person 4's relationship to the lead tenant? What is person 4's age? Which of these best describes person 4's gender identity? Which of these best describes person 4's working situation? What is person 5's relationship to the lead tenant? What is person 5's age? Which of these best describes person 5's gender identity? Which of these best describes person 5's working situation? What is person 6's relationship to the lead tenant? What is person 6's age? Which of these best describes person 6's gender identity? Which of these best describes person 6's working situation? What is person 7's relationship to the lead tenant? What is person 7's age? Which of these best describes person 7's gender identity? Which of these best describes person 7's working situation? What is person 8's relationship to the lead tenant? What is person 8's age? Which of these best describes person 8's gender identity? Which of these best describes person 8's working situation? Does anybody in the household have links to the UK armed forces? Is this person still serving in the UK armed forces? Was this person seriously injured or ill as a result of serving in the UK armed forces? Is anybody in the household pregnant? Disabled access needs a) Fully wheelchair-accessible housing Disabled access needs b) Wheelchair access to essential rooms Disabled access needs c) Level access housing Disabled access needs f) Other disabled access needs Disabled access needs g) No disabled access needs Disabled access needs h) Don’t know Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more? Does this person's condition affect their dexterity? Does this person's condition affect their learning or understanding or concentrating? Does this person's condition affect their hearing? Does this person's condition affect their memory? Does this person's condition affect their mental health? Does this person's condition affect their mobility? Does this person's condition affect them socially or behaviourally? Does this person's condition affect their stamina or breathing or fatigue? Does this person's condition affect their vision? Does this person's condition affect them in another way? How long has the household continuously lived in the local authority area of the new letting? How long has the household been on the local authority waiting list for the new letting? What is the tenant’s main reason for the household leaving their last settled home? If 'Other', what was the main reason for leaving their last settled home? Where was the household immediately before this letting? Did the household experience homelessness immediately before this letting? Do you know the postcode of the household's last settled home? Part 1 of postcode of last settled home Part 2 of postcode of last settled home What is the local authority of the household's last settled home? Was the household given 'reasonable preference' by the local authority? Reasonable preference reason They were homeless or about to lose their home (within 56 days) Reasonable preference reason They were living in unsanitary, overcrowded or unsatisfactory housing Reasonable preference reason They needed to move due to medical and welfare reasons (including disability) Reasonable preference reason They needed to move to avoid hardship to themselves or others Reasonable preference reason Don't know Was the letting made under Choice-Based Lettings (CBL)? Was the letting made under the Common Allocation Policy (CAP)? Was the letting made under the Common Housing Register (CHR)? What was the source of referral for this letting? Do you know the household's combined total income after tax? How often does the household receive income? How much income does the household have in total? Is the tenant likely to be receiving any of these housing-related benefits? How much of the household's income is from Universal Credit, state pensions or benefits? Does the household pay rent or other charges for the accommodation? How often does the household pay rent and other charges? If this is a care home, how much does the household pay every [time period]? What is the basic rent? What is the service charge? What is the personal service charge? What is the support charge? Total charge After the household has received any housing-related benefits, will they still need to pay for rent and charges? What do you expect the outstanding amount to be?
3 Additional info Organisation's CORE ID If using new core then this will be the email address. If left empty, the letting log will be assigned to the account used to upload the log. General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing includes direct access hostels, group homes, residential care and nursing homes. This is a letting to the same tenant in the same property This is how you usually refer to this tenancy on your own systems This is how you usually refer to this property on your own systems Provide management code if you have one Provide scheme code, include the 'S' at the beginning if it has one Provide location code if you have one The UPRN is the Unique Property Reference Number. It's created by the Ordnance Survey so it's a unique number system used across all housing providers, all sectors (i.e. not just social housing) and all across the UK. Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0. If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom. This is the date the property became available to let. For a re-let, it's the day after the previous tenant's contract ends. For a new build, conversion, acquisition or lease it's the day after the provider legally took over possession or management. Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs. Also known as an ‘introductory period’ Fixed-term tenancies are for a set time (up to 20 years). Licence agreements are on a rolling basis, mainly for supported housing. Local authorities mostly provide secure tenancies, and housing associations mostly provide assured (ASTs). Not including starter or introductory period Make sure the tenant has seen the attached privacy notice before completing this log This is the household member who does the most paid work. If several people do the same paid work, it's the oldest household member. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. Excluding national service. If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners. For example, lifting and carrying objects, or using a keyboard For example, deafness or partial hearing For example, depression or anxiety Anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD) For example, blindness or partial sight ‘Last settled home' means last long-standing home. For tenants who had temporary accommodation or slept rough, it's where they lived previously. Social housing 'reasonable preference' is also known as 'priority need' Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support. If rent is charged on the property then answer Yes, even if tenants do not pay it themselves. Amount paid before any service charges, for example hot water or cleaning. Households may get household benefits towards basic rent. For example, cleaning. Households may get household benefits towards service charge For example heating or hot water. This doesn’t include housing benefit or Universal Credit. Any support service charges included in the tenancy agreement Unnecessary for new CORE users Approximate figure only
4 Values Numeric Email format if using new CORE. Alphanumeric, except for commas if using old CORE. 1 - 2 1 - 12 1 - 2 1 - 31 1 - 12 23 - 24 1 - 3 Text Alphanumeric, max 13 characters Alphanumeric, max 12 characters 1 - 999 Alphanumeric 1 - 999 Numeric Alphanumeric Text XX(XX) XXX ONS CODE: Alphanumeric, 9 characters beginning with 'E' 1 - 3 or 5 - 8 5 - 6, or 8 - 20 0+ 1 - 2, 4 or 6 - 10 1 - 2 1 - 7 1 - 31 1 - 12 20 - 24 1 - 31 1 - 12 14 - 24 1 - 3 1 - 2 2 - 7 Text 1 - 99 1 - 5 1 16 - 120 or R F, M, X or R 1 - 19 12 - 13, 17 - 21 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 1 - 6 3 - 6 1 - 3 1 or empty 1 - 3 1 or empty 1 - 2 or 5 - 10 2 or 5 - 10 1 - 2, 4, 8 - 14, 16 - 20, 28 - 31 or 34 - 49 Text 3 - 4, 6 - 7, 9 - 10, 13 - 14, 18 - 19, 21 or 23 - 37 1 or 11 1 - 2 XX(XX) XXX ONS CODE: Alphanumeric, 9 characters beginning with 'E' 1 - 3 1 or empty 1 - 2 1 - 4, 7 - 10, 12 - 17 1 - 3 0 - 99999 1, 3, 6, 9 or 10 1 - 4 0 - 1 1 - 10 xxxx.xx 1 - 3 xxxx.xx
5 Can be empty? No Yes No No Yes, if letting type is not an Affordable Rent letting (if field 5 = 1 - 4 or 9 - 12) Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8) Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8) or if 'Other intermediate rent product' is not selected for type of Intermediate Rent (if field 11 is not 3) Yes Yes, if letting is general needs (if field 4 = 1) or if location code is provided (if field 17 is not empty) Yes, if letting is general needs (if field 4 = 1) Yes, if letting is general needs (if field 4 = 1) or if management code is provided (if field 15 is not empty) Yes, if letting is supported housing (if field 4 = 2) or if the property's postcode is not empty (if fields 23 and 24 contain full and valid entries) Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty) Yes Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty) Yes Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty) Yes, if letting is supported housing (if field 4 = 2) Yes, if letting is a renewal (if field 6 = 1) or a first-time let (if field 27 = 15 - 17) Yes, if letting is a renewal (if field 6 = 1) Yes, if letting is supported housing (if field 4 = 2) Yes, if letting is a renewal (if field 6 = 1) Yes No Yes, if 'Other' is not selected for tenancy type (if field 41 is not 3) Yes, if letting is not a fixed-term tenancy (if field 41 = 2, 3, 5 or 7) Yes, if letting is general needs (if field 4 = 1) No No Yes, if the other fields about this person (fields 52, 53 and 54) are also empty Yes, if the other fields about this person (fields 51, 53 and 54) are also empty Yes, if the other fields about this person (fields 51, 52 and 54) are also empty Yes, if the other fields about this person (fields 51, 52 and 53) are also empty Yes, if the other fields about this person (fields 56, 57 and 58) are also empty Yes, if the other fields about this person (fields 55, 57 and 58) are also empty Yes, if the other fields about this person (fields 55, 56 and 58) are also empty Yes, if the other fields about this person (fields 55, 56 and 57) are also empty Yes, if the other fields about this person (fields 60, 61 and 62) are also empty Yes, if the other fields about this person (fields 59, 61 and 62) are also empty Yes, if the other fields about this person (fields 59, 60 and 62) are also empty Yes, if the other fields about this person (fields 59, 60 and 61) are also empty Yes, if the other fields about this person (fields 64, 65 and 66) are also empty Yes, if the other fields about this person (fields 63, 65 and 66) are also empty Yes, if the other fields about this person (fields 63, 64 and 66) are also empty Yes, if the other fields about this person (fields 63, 64 and 65) are also empty Yes, if the other fields about this person (fields 68, 69 and 70) are also empty Yes, if the other fields about this person (fields 67, 69 and 70) are also empty Yes, if the other fields about this person (fields 67, 68 and 70) are also empty Yes, if the other fields about this person (fields 67, 68 and 69) are also empty Yes, if the other fields about this person (fields 72, 73 and 74) are also empty Yes, if the other fields about this person (fields 71, 73 and 74) are also empty Yes, if the other fields about this person (fields 71, 72 and 74) are also empty Yes, if the other fields about this person (fields 71, 72 and 73) are also empty Yes, if the other fields about this person (fields 76, 77 and 78) are also empty Yes, if the other fields about this person (fields 75, 77 and 78) are also empty Yes, if the other fields about this person (fields 75, 76 and 78) are also empty Yes, if the other fields about this person (fields 75, 76 and 77) are also empty No Yes, if no one in the household is a current or former regular (if field 79 is not 1) Yes, if no one in the household is a current or former regular or reserve (if field 79 = 2, 3, 5 or 6) No Yes, if no household members have access needs or if it is unknown (if field 87 or 88 = 1) Yes, if a household member has an access need (if at least one of fields 83, 84, 85 and 86 = 1) No Yes, if no one in the household has a physical or mental health condition (if field 89 is 2 or 3). If someone in the household does have such a condition (if field 89 = 1), then at least 1 of these fields must be 1. No Yes, if letting is a renewal (if field 6 = 1) No Yes, if 'Other' is not selected for reason for leaving last settled home (if field 102 is not 20) Yes, if letting is a renewal (if field 6 = 1) No Yes, if postcode of household's last settled home is not known (if 106 = 2) Yes No If household was given 'reasonable preference' (if field 110 = 1), at least one of these fields must be 1. If household was not given 'reasonable preference' (if field 110 = 2 or 3), these fields will be ignored. No Yes, if letting is a renewal (if field 6 = 1) No Yes, if household's income is unknown (if field 120 = 2 or 3) No Yes, if all rent and accommodation charges are provided (if fields 127 - 132 are not empty) No Yes, if accommodation is not a care home (if field 125 = 1) and all rent and accommodation charges are provided (if fields 128 - 132 are not empty) Yes, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty) Yes Yes, if submitting data to new CORE, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty) Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 123 = 3, 9 or 10) Yes, if the household does not need to pay rent/charges after receiving housing benefits (if field133 = 2 or 3)
6 Type of letting the question applies to Affordable Rent only Intermediate Rent only Supported housing only General needs only General needs only Supported housing only Supported housing only
7 Duplicate check field? Yes Yes Yes Yes Yes
8 Bulk upload field number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

49
spec/fixtures/files/2023_24_lettings_bulk_upload_empty_with_headers.csv vendored

@ -0,0 +1,49 @@
,Setting up this lettings log,,,,,,,,,,,,,,,,,Property information,,,,,,,,,,,,,,,,,,,,,Tenancy information,,,,,,Household characteristics,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Household needs,,,,,,,,,,,,,,,,,,,,,Household situation,,,,,,,,,,,,,,,,,,,,"Income, benefits and outgoings",,,,,,,,,,,,,,
Question,Which organisation owns this property?,Which organisation manages this letting?,What is the CORE username of the account this letting log should be assigned to? ,What is the needs type?,What is the letting type?,Is this letting a renewal?,What is the tenancy start date? - day DD,What is the tenancy start date? - month MM,What is the tenancy start date? - year YY,Is this a London Affordable Rent letting?,Which type of Intermediate Rent is this letting?,Which 'Other' type of Intermediate Rent is this letting?,What is the tenant code?,What is the property reference?,What management group does this letting belong to?,What scheme does this letting belong to?,Which location is this letting for?,"If known, provide this property’s UPRN",Address Line 1,Address Line 2,Town or city,County,Part 1 of the property's postcode,Part 2 of the property's postcode,What is the property's local authority?,What type was the property most recently let as?,What is the reason for the property being vacant?,How many times was the property offered between becoming vacant and this letting?,What type of unit is the property?,Which type of building is the property?,Is the property built or adapted to wheelchair-user standards?,How many bedrooms does the property have?,What is the void date? - day DD,What is the void date? - month MM,What is the void date? - year YYYY,What date were any major repairs completed on? - day DD,What date were any major repairs completed on? - month MM,What date were any major repairs completed on? - year YY,Is this a joint tenancy?,Is this a starter tenancy?,What is the type of tenancy?,"If 'Other', what is the type of tenancy?",What is the length of the fixed-term tenancy to the nearest year?,Is this letting in sheltered accommodation?,Has the tenant seen the DLUHC privacy notice?,What is the lead tenant’s age?,Which of these best describes the lead tenant’s gender identity? ,Which of these best describes the lead tenant's ethnic background?,What is the lead tenant’s nationality?,Which of these best describes the lead tenant’s working situation?,What is person 2's relationship to the lead tenant?,What is person 2's age?,Which of these best describes person 2's gender identity?,Which of these best describes person 2's working situation?,What is person 3's relationship to the lead tenant?,What is person 3's age?,Which of these best describes person 3's gender identity?,Which of these best describes person 3's working situation?,What is person 4's relationship to the lead tenant?,What is person 4's age?,Which of these best describes person 4's gender identity?,Which of these best describes person 4's working situation?,What is person 5's relationship to the lead tenant?,What is person 5's age?,Which of these best describes person 5's gender identity?,Which of these best describes person 5's working situation?,What is person 6's relationship to the lead tenant?,What is person 6's age?,Which of these best describes person 6's gender identity?,Which of these best describes person 6's working situation?,What is person 7's relationship to the lead tenant?,What is person 7's age?,Which of these best describes person 7's gender identity?,Which of these best describes person 7's working situation?,What is person 8's relationship to the lead tenant?,What is person 8's age?,Which of these best describes person 8's gender identity?,Which of these best describes person 8's working situation?,Does anybody in the household have links to the UK armed forces?,Is this person still serving in the UK armed forces?,Was this person seriously injured or ill as a result of serving in the UK armed forces?,Is anybody in the household pregnant?,"Disabled access needs
a) Fully wheelchair-accessible housing","Disabled access needs
b) Wheelchair access to essential rooms","Disabled access needs
c) Level access housing","Disabled access needs
f) Other disabled access needs","Disabled access needs
g) No disabled access needs","Disabled access needs
h) Don’t know",Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?,Does this person's condition affect their dexterity?,Does this person's condition affect their learning or understanding or concentrating?,Does this person's condition affect their hearing?,Does this person's condition affect their memory?,Does this person's condition affect their mental health?,Does this person's condition affect their mobility?,Does this person's condition affect them socially or behaviourally?,Does this person's condition affect their stamina or breathing or fatigue?,Does this person's condition affect their vision?,Does this person's condition affect them in another way?,How long has the household continuously lived in the local authority area of the new letting?,How long has the household been on the local authority waiting list for the new letting?,What is the tenant’s main reason for the household leaving their last settled home?,"If 'Other', what was the main reason for leaving their last settled home?",Where was the household immediately before this letting?,Did the household experience homelessness immediately before this letting?,Do you know the postcode of the household's last settled home?,Part 1 of postcode of last settled home,Part 2 of postcode of last settled home,What is the local authority of the household's last settled home?,Was the household given 'reasonable preference' by the local authority?,"Reasonable preference reason
They were homeless or about to lose their home (within 56 days)","Reasonable preference reason
They were living in unsanitary, overcrowded or unsatisfactory housing","Reasonable preference reason
They needed to move due to medical and welfare reasons (including disability)","Reasonable preference reason
They needed to move to avoid hardship to themselves or others","Reasonable preference reason
Don't know",Was the letting made under Choice-Based Lettings (CBL)?,Was the letting made under the Common Allocation Policy (CAP)? ,Was the letting made under the Common Housing Register (CHR)?,What was the source of referral for this letting?,Do you know the household's combined total income after tax?,How often does the household receive income?,How much income does the household have in total?,Is the tenant likely to be receiving any of these housing-related benefits?,"How much of the household's income is from Universal Credit, state pensions or benefits?",Does the household pay rent or other charges for the accommodation?,How often does the household pay rent and other charges?,"If this is a care home, how much does the household pay every [time period]?",What is the basic rent?,What is the service charge?,What is the personal service charge?,What is the support charge?,Total charge,"After the household has received any housing-related benefits, will they still need to pay for rent and charges?",What do you expect the outstanding amount to be?
Additional info,Organisation's CORE ID,,"If using new core then this will be the email address. If left empty, the letting log will be assigned to the account used to upload the log.","General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing includes direct access hostels, group homes, residential care and nursing homes.",,This is a letting to the same tenant in the same property,,,,,,,This is how you usually refer to this tenancy on your own systems,This is how you usually refer to this property on your own systems,Provide management code if you have one,"Provide scheme code, include the 'S' at the beginning if it has one",Provide location code if you have one,"The UPRN is the Unique Property Reference Number. It's created by the Ordnance Survey so it's a unique number system used across all housing providers, all sectors (i.e. not just social housing) and all across the UK.",,,,,,,,,,"Do not include the offer that led to this letting.
This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0.",,,,"If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom.","This is the date the property became available to let. For a re-let, it's the day after the previous tenant's contract ends. For a new build, conversion, acquisition or lease it's the day after the provider legally took over possession or management.",,,"Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs.",,,,Also known as an ‘introductory period’,"Fixed-term tenancies are for a set time (up to 20 years). Licence agreements are on a rolling basis, mainly for supported housing. Local authorities mostly provide secure tenancies, and housing associations mostly provide assured (ASTs).",,Not including starter or introductory period,,Make sure the tenant has seen the attached privacy notice before completing this log,"This is the household member who does the most paid work. If several people do the same paid work, it's the oldest household member.",,,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education.,Mark children under 1 as 1.,,,"Excluding national service.
If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners.",,,,,,,,,,,"For example, lifting and carrying objects, or using a keyboard",,"For example, deafness or partial hearing",,"For example, depression or anxiety",,"Anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD)",,"For example, blindness or partial sight",,,,"‘Last settled home' means last long-standing home. For tenants who had temporary accommodation or slept rough, it's where they lived previously.",,,,,,,,Social housing 'reasonable preference' is also known as 'priority need',,,,,,,,,,,,"Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support.",,,"If rent is charged on the property then answer Yes, even if tenants do not pay it themselves.",,,"Amount paid before any service charges, for example hot water or cleaning. Households may get household benefits towards basic rent.","For example, cleaning. Households may get household benefits towards service charge",For example heating or hot water. This doesn’t include housing benefit or Universal Credit.,Any support service charges included in the tenancy agreement,Unnecessary for new CORE users,,Approximate figure only
Values,Numeric,,"Email format if using new CORE.
Alphanumeric, except for commas if using old CORE.",1 - 2,1 - 12,1 - 2,1 - 31,1 - 12,23 - 24,1 - 3,,Text,"Alphanumeric, max 13 characters","Alphanumeric, max 12 characters",1 - 999,Alphanumeric,1 - 999,Numeric,Alphanumeric,,Text,,XX(XX),XXX,"ONS CODE: Alphanumeric, 9 characters beginning with 'E'",1 - 3 or 5 - 8,"5 - 6, or 8 - 20",0+,"1 - 2, 4 or 6 - 10",1 - 2,,1 - 7,1 - 31,1 - 12,20 - 24,1 - 31,1 - 12,14 - 24,1 - 3,1 - 2,2 - 7,Text,1 - 99,1 - 5,1,16 - 120 or R,"F, M, X or R",1 - 19,"12 - 13, 17 - 21",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,"P, C, X or R","Numeric, range 1 - 120 or text (upper case 'R')
Must be >= 16 if working situation = 1 - 8 or 0
Must be <16 if working situation = 9","F, M, X or R",0 - 10,1 - 6,3 - 6,1 - 3,,1 or empty,,,,,,1 - 3,1 or empty,,,,,,,,,,1 - 2 or 5 - 10,2 or 5 - 10,"1 - 2, 4, 8 - 14, 16 - 20, 28 - 31 or 34 - 49",Text,"3 - 4, 6 - 7, 9 - 10, 13 - 14, 18 - 19, 21 or 23 - 37",1 or 11,1 - 2,XX(XX),XXX,"ONS CODE: Alphanumeric, 9 characters beginning with 'E'",1 - 3,1 or empty,,,,,1 - 2,,,"1 - 4, 7 - 10, 12 - 17",1 - 3,,0 - 99999,"1, 3, 6, 9 or 10",1 - 4,0 - 1,1 - 10,xxxx.xx,,,,,,1 - 3,xxxx.xx
Can be empty?,No,,Yes,No,,,No,,,"Yes, if letting type is not an Affordable Rent letting (if field 5 = 1 - 4 or 9 - 12)","Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8)","Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8) or if 'Other intermediate rent product' is not selected for type of Intermediate Rent (if field 11 is not 3)",Yes,,"Yes, if letting is general needs (if field 4 = 1) or if location code is provided (if field 17 is not empty)","Yes, if letting is general needs (if field 4 = 1)","Yes, if letting is general needs (if field 4 = 1) or if management code is provided (if field 15 is not empty)","Yes, if letting is supported housing (if field 4 = 2) or if the property's postcode is not empty (if fields 23 and 24 contain full and valid entries)","Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",Yes,"Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty)",,"Yes, if letting is supported housing (if field 4 = 2)","Yes, if letting is a renewal (if field 6 = 1) or a first-time let (if field 27 = 15 - 17)","Yes, if letting is a renewal (if field 6 = 1)",,"Yes, if letting is supported housing (if field 4 = 2)",,,,"Yes, if letting is a renewal (if field 6 = 1)",,,Yes,,,No,,,"Yes, if 'Other' is not selected for tenancy type (if field 41 is not 3)","Yes, if letting is not a fixed-term tenancy (if field 41 = 2, 3, 5 or 7)","Yes, if letting is general needs (if field 4 = 1)",No,No,,,,,"Yes, if the other fields about this person (fields 52, 53 and 54) are also empty","Yes, if the other fields about this person (fields 51, 53 and 54) are also empty","Yes, if the other fields about this person (fields 51, 52 and 54) are also empty","Yes, if the other fields about this person (fields 51, 52 and 53) are also empty","Yes, if the other fields about this person (fields 56, 57 and 58) are also empty","Yes, if the other fields about this person (fields 55, 57 and 58) are also empty","Yes, if the other fields about this person (fields 55, 56 and 58) are also empty","Yes, if the other fields about this person (fields 55, 56 and 57) are also empty","Yes, if the other fields about this person (fields 60, 61 and 62) are also empty","Yes, if the other fields about this person (fields 59, 61 and 62) are also empty","Yes, if the other fields about this person (fields 59, 60 and 62) are also empty","Yes, if the other fields about this person (fields 59, 60 and 61) are also empty","Yes, if the other fields about this person (fields 64, 65 and 66) are also empty","Yes, if the other fields about this person (fields 63, 65 and 66) are also empty","Yes, if the other fields about this person (fields 63, 64 and 66) are also empty","Yes, if the other fields about this person (fields 63, 64 and 65) are also empty","Yes, if the other fields about this person (fields 68, 69 and 70) are also empty","Yes, if the other fields about this person (fields 67, 69 and 70) are also empty","Yes, if the other fields about this person (fields 67, 68 and 70) are also empty","Yes, if the other fields about this person (fields 67, 68 and 69) are also empty","Yes, if the other fields about this person (fields 72, 73 and 74) are also empty","Yes, if the other fields about this person (fields 71, 73 and 74) are also empty","Yes, if the other fields about this person (fields 71, 72 and 74) are also empty","Yes, if the other fields about this person (fields 71, 72 and 73) are also empty","Yes, if the other fields about this person (fields 76, 77 and 78) are also empty","Yes, if the other fields about this person (fields 75, 77 and 78) are also empty","Yes, if the other fields about this person (fields 75, 76 and 78) are also empty","Yes, if the other fields about this person (fields 75, 76 and 77) are also empty",No,"Yes, if no one in the household is a current or former regular (if field 79 is not 1)","Yes, if no one in the household is a current or former regular or reserve (if field 79 = 2, 3, 5 or 6)",No,"Yes, if no household members have access needs or if it is unknown (if field 87 or 88 = 1)",,,,"Yes, if a household member has an access need (if at least one of fields 83, 84, 85 and 86 = 1)",,No,"Yes, if no one in the household has a physical or mental health condition (if field 89 is 2 or 3).
If someone in the household does have such a condition (if field 89 = 1), then at least 1 of these fields must be 1.",,,,,,,,,,No,"Yes, if letting is a renewal (if field 6 = 1)",No,"Yes, if 'Other' is not selected for reason for leaving last settled home (if field 102 is not 20)","Yes, if letting is a renewal (if field 6 = 1)",No,,"Yes, if postcode of household's last settled home is not known (if 106 = 2)",,Yes,No,"If household was given 'reasonable preference' (if field 110 = 1), at least one of these fields must be 1.
If household was not given 'reasonable preference' (if field 110 = 2 or 3), these fields will be ignored.",,,,,No,,,"Yes, if letting is a renewal (if field 6 = 1)",No,"Yes, if household's income is unknown (if field 120 = 2 or 3)",,No,,"Yes, if all rent and accommodation charges are provided (if fields 127 - 132 are not empty)",No,"Yes, if accommodation is not a care home (if field 125 = 1) and all rent and accommodation charges are provided (if fields 128 - 132 are not empty)","Yes, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty)",Yes,,,"Yes, if submitting data to new CORE, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty)","Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 123 = 3, 9 or 10)","Yes, if the household does not need to pay rent/charges after receiving housing benefits (if field133 = 2 or 3)"
Type of letting the question applies to,,,,,,,,,,Affordable Rent only,Intermediate Rent only,,,,Supported housing only,,,General needs only,,,,,,,,,,,General needs only,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Supported housing only,,,,,,,,,
Duplicate check field?,Yes,,,,,,Yes,,,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Yes,,,,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Bulk upload field number,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134
1 Setting up this lettings log Property information Tenancy information Household characteristics Household needs Household situation Income, benefits and outgoings
2 Question Which organisation owns this property? Which organisation manages this letting? What is the CORE username of the account this letting log should be assigned to? What is the needs type? What is the letting type? Is this letting a renewal? What is the tenancy start date? - day DD What is the tenancy start date? - month MM What is the tenancy start date? - year YY Is this a London Affordable Rent letting? Which type of Intermediate Rent is this letting? Which 'Other' type of Intermediate Rent is this letting? What is the tenant code? What is the property reference? What management group does this letting belong to? What scheme does this letting belong to? Which location is this letting for? If known, provide this property’s UPRN Address Line 1 Address Line 2 Town or city County Part 1 of the property's postcode Part 2 of the property's postcode What is the property's local authority? What type was the property most recently let as? What is the reason for the property being vacant? How many times was the property offered between becoming vacant and this letting? What type of unit is the property? Which type of building is the property? Is the property built or adapted to wheelchair-user standards? How many bedrooms does the property have? What is the void date? - day DD What is the void date? - month MM What is the void date? - year YYYY What date were any major repairs completed on? - day DD What date were any major repairs completed on? - month MM What date were any major repairs completed on? - year YY Is this a joint tenancy? Is this a starter tenancy? What is the type of tenancy? If 'Other', what is the type of tenancy? What is the length of the fixed-term tenancy to the nearest year? Is this letting in sheltered accommodation? Has the tenant seen the DLUHC privacy notice? What is the lead tenant’s age? Which of these best describes the lead tenant’s gender identity? Which of these best describes the lead tenant's ethnic background? What is the lead tenant’s nationality? Which of these best describes the lead tenant’s working situation? What is person 2's relationship to the lead tenant? What is person 2's age? Which of these best describes person 2's gender identity? Which of these best describes person 2's working situation? What is person 3's relationship to the lead tenant? What is person 3's age? Which of these best describes person 3's gender identity? Which of these best describes person 3's working situation? What is person 4's relationship to the lead tenant? What is person 4's age? Which of these best describes person 4's gender identity? Which of these best describes person 4's working situation? What is person 5's relationship to the lead tenant? What is person 5's age? Which of these best describes person 5's gender identity? Which of these best describes person 5's working situation? What is person 6's relationship to the lead tenant? What is person 6's age? Which of these best describes person 6's gender identity? Which of these best describes person 6's working situation? What is person 7's relationship to the lead tenant? What is person 7's age? Which of these best describes person 7's gender identity? Which of these best describes person 7's working situation? What is person 8's relationship to the lead tenant? What is person 8's age? Which of these best describes person 8's gender identity? Which of these best describes person 8's working situation? Does anybody in the household have links to the UK armed forces? Is this person still serving in the UK armed forces? Was this person seriously injured or ill as a result of serving in the UK armed forces? Is anybody in the household pregnant? Disabled access needs a) Fully wheelchair-accessible housing Disabled access needs b) Wheelchair access to essential rooms Disabled access needs c) Level access housing Disabled access needs f) Other disabled access needs Disabled access needs g) No disabled access needs Disabled access needs h) Don’t know Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more? Does this person's condition affect their dexterity? Does this person's condition affect their learning or understanding or concentrating? Does this person's condition affect their hearing? Does this person's condition affect their memory? Does this person's condition affect their mental health? Does this person's condition affect their mobility? Does this person's condition affect them socially or behaviourally? Does this person's condition affect their stamina or breathing or fatigue? Does this person's condition affect their vision? Does this person's condition affect them in another way? How long has the household continuously lived in the local authority area of the new letting? How long has the household been on the local authority waiting list for the new letting? What is the tenant’s main reason for the household leaving their last settled home? If 'Other', what was the main reason for leaving their last settled home? Where was the household immediately before this letting? Did the household experience homelessness immediately before this letting? Do you know the postcode of the household's last settled home? Part 1 of postcode of last settled home Part 2 of postcode of last settled home What is the local authority of the household's last settled home? Was the household given 'reasonable preference' by the local authority? Reasonable preference reason They were homeless or about to lose their home (within 56 days) Reasonable preference reason They were living in unsanitary, overcrowded or unsatisfactory housing Reasonable preference reason They needed to move due to medical and welfare reasons (including disability) Reasonable preference reason They needed to move to avoid hardship to themselves or others Reasonable preference reason Don't know Was the letting made under Choice-Based Lettings (CBL)? Was the letting made under the Common Allocation Policy (CAP)? Was the letting made under the Common Housing Register (CHR)? What was the source of referral for this letting? Do you know the household's combined total income after tax? How often does the household receive income? How much income does the household have in total? Is the tenant likely to be receiving any of these housing-related benefits? How much of the household's income is from Universal Credit, state pensions or benefits? Does the household pay rent or other charges for the accommodation? How often does the household pay rent and other charges? If this is a care home, how much does the household pay every [time period]? What is the basic rent? What is the service charge? What is the personal service charge? What is the support charge? Total charge After the household has received any housing-related benefits, will they still need to pay for rent and charges? What do you expect the outstanding amount to be?
3 Additional info Organisation's CORE ID If using new core then this will be the email address. If left empty, the letting log will be assigned to the account used to upload the log. General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing includes direct access hostels, group homes, residential care and nursing homes. This is a letting to the same tenant in the same property This is how you usually refer to this tenancy on your own systems This is how you usually refer to this property on your own systems Provide management code if you have one Provide scheme code, include the 'S' at the beginning if it has one Provide location code if you have one The UPRN is the Unique Property Reference Number. It's created by the Ordnance Survey so it's a unique number system used across all housing providers, all sectors (i.e. not just social housing) and all across the UK. Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0. If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom. This is the date the property became available to let. For a re-let, it's the day after the previous tenant's contract ends. For a new build, conversion, acquisition or lease it's the day after the provider legally took over possession or management. Major repairs are works that could not be reasonably carried out with a tenant living at the property. For example, structural repairs. Also known as an ‘introductory period’ Fixed-term tenancies are for a set time (up to 20 years). Licence agreements are on a rolling basis, mainly for supported housing. Local authorities mostly provide secure tenancies, and housing associations mostly provide assured (ASTs). Not including starter or introductory period Make sure the tenant has seen the attached privacy notice before completing this log This is the household member who does the most paid work. If several people do the same paid work, it's the oldest household member. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. A child is anyone eligible for child benefit: under age 16 or under 20 if still in full-time education. Mark children under 1 as 1. Excluding national service. If several household members have these links, answer for regular first. If no regular, answer for reserve. If no reserve, answer for spouses or civil partners. For example, lifting and carrying objects, or using a keyboard For example, deafness or partial hearing For example, depression or anxiety Anything associated with autism spectrum disorder (ASD), including Asperger’s or attention deficit hyperactivity disorder (ADHD) For example, blindness or partial sight ‘Last settled home' means last long-standing home. For tenants who had temporary accommodation or slept rough, it's where they lived previously. Social housing 'reasonable preference' is also known as 'priority need' Include any income after tax from employment, pensions, and Universal Credit. Don't include National Insurance (NI) contributions and tax, housing benefit, child benefit, or council tax support. If rent is charged on the property then answer Yes, even if tenants do not pay it themselves. Amount paid before any service charges, for example hot water or cleaning. Households may get household benefits towards basic rent. For example, cleaning. Households may get household benefits towards service charge For example heating or hot water. This doesn’t include housing benefit or Universal Credit. Any support service charges included in the tenancy agreement Unnecessary for new CORE users Approximate figure only
4 Values Numeric Email format if using new CORE. Alphanumeric, except for commas if using old CORE. 1 - 2 1 - 12 1 - 2 1 - 31 1 - 12 23 - 24 1 - 3 Text Alphanumeric, max 13 characters Alphanumeric, max 12 characters 1 - 999 Alphanumeric 1 - 999 Numeric Alphanumeric Text XX(XX) XXX ONS CODE: Alphanumeric, 9 characters beginning with 'E' 1 - 3 or 5 - 8 5 - 6, or 8 - 20 0+ 1 - 2, 4 or 6 - 10 1 - 2 1 - 7 1 - 31 1 - 12 20 - 24 1 - 31 1 - 12 14 - 24 1 - 3 1 - 2 2 - 7 Text 1 - 99 1 - 5 1 16 - 120 or R F, M, X or R 1 - 19 12 - 13, 17 - 21 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 P, C, X or R Numeric, range 1 - 120 or text (upper case 'R') Must be >= 16 if working situation = 1 - 8 or 0 Must be <16 if working situation = 9 F, M, X or R 0 - 10 1 - 6 3 - 6 1 - 3 1 or empty 1 - 3 1 or empty 1 - 2 or 5 - 10 2 or 5 - 10 1 - 2, 4, 8 - 14, 16 - 20, 28 - 31 or 34 - 49 Text 3 - 4, 6 - 7, 9 - 10, 13 - 14, 18 - 19, 21 or 23 - 37 1 or 11 1 - 2 XX(XX) XXX ONS CODE: Alphanumeric, 9 characters beginning with 'E' 1 - 3 1 or empty 1 - 2 1 - 4, 7 - 10, 12 - 17 1 - 3 0 - 99999 1, 3, 6, 9 or 10 1 - 4 0 - 1 1 - 10 xxxx.xx 1 - 3 xxxx.xx
5 Can be empty? No Yes No No Yes, if letting type is not an Affordable Rent letting (if field 5 = 1 - 4 or 9 - 12) Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8) Yes, if letting type is not an Intermediate Rent letting (if field 5 = 1 - 8) or if 'Other intermediate rent product' is not selected for type of Intermediate Rent (if field 11 is not 3) Yes Yes, if letting is general needs (if field 4 = 1) or if location code is provided (if field 17 is not empty) Yes, if letting is general needs (if field 4 = 1) Yes, if letting is general needs (if field 4 = 1) or if management code is provided (if field 15 is not empty) Yes, if letting is supported housing (if field 4 = 2) or if the property's postcode is not empty (if fields 23 and 24 contain full and valid entries) Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty) Yes Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty) Yes Yes, if letting is supported housing (if field 4 = 2) or if property's UPRN and local authority are known (if fields 18 and 25 are not empty) Yes, if letting is supported housing (if field 4 = 2) Yes, if letting is a renewal (if field 6 = 1) or a first-time let (if field 27 = 15 - 17) Yes, if letting is a renewal (if field 6 = 1) Yes, if letting is supported housing (if field 4 = 2) Yes, if letting is a renewal (if field 6 = 1) Yes No Yes, if 'Other' is not selected for tenancy type (if field 41 is not 3) Yes, if letting is not a fixed-term tenancy (if field 41 = 2, 3, 5 or 7) Yes, if letting is general needs (if field 4 = 1) No No Yes, if the other fields about this person (fields 52, 53 and 54) are also empty Yes, if the other fields about this person (fields 51, 53 and 54) are also empty Yes, if the other fields about this person (fields 51, 52 and 54) are also empty Yes, if the other fields about this person (fields 51, 52 and 53) are also empty Yes, if the other fields about this person (fields 56, 57 and 58) are also empty Yes, if the other fields about this person (fields 55, 57 and 58) are also empty Yes, if the other fields about this person (fields 55, 56 and 58) are also empty Yes, if the other fields about this person (fields 55, 56 and 57) are also empty Yes, if the other fields about this person (fields 60, 61 and 62) are also empty Yes, if the other fields about this person (fields 59, 61 and 62) are also empty Yes, if the other fields about this person (fields 59, 60 and 62) are also empty Yes, if the other fields about this person (fields 59, 60 and 61) are also empty Yes, if the other fields about this person (fields 64, 65 and 66) are also empty Yes, if the other fields about this person (fields 63, 65 and 66) are also empty Yes, if the other fields about this person (fields 63, 64 and 66) are also empty Yes, if the other fields about this person (fields 63, 64 and 65) are also empty Yes, if the other fields about this person (fields 68, 69 and 70) are also empty Yes, if the other fields about this person (fields 67, 69 and 70) are also empty Yes, if the other fields about this person (fields 67, 68 and 70) are also empty Yes, if the other fields about this person (fields 67, 68 and 69) are also empty Yes, if the other fields about this person (fields 72, 73 and 74) are also empty Yes, if the other fields about this person (fields 71, 73 and 74) are also empty Yes, if the other fields about this person (fields 71, 72 and 74) are also empty Yes, if the other fields about this person (fields 71, 72 and 73) are also empty Yes, if the other fields about this person (fields 76, 77 and 78) are also empty Yes, if the other fields about this person (fields 75, 77 and 78) are also empty Yes, if the other fields about this person (fields 75, 76 and 78) are also empty Yes, if the other fields about this person (fields 75, 76 and 77) are also empty No Yes, if no one in the household is a current or former regular (if field 79 is not 1) Yes, if no one in the household is a current or former regular or reserve (if field 79 = 2, 3, 5 or 6) No Yes, if no household members have access needs or if it is unknown (if field 87 or 88 = 1) Yes, if a household member has an access need (if at least one of fields 83, 84, 85 and 86 = 1) No Yes, if no one in the household has a physical or mental health condition (if field 89 is 2 or 3). If someone in the household does have such a condition (if field 89 = 1), then at least 1 of these fields must be 1. No Yes, if letting is a renewal (if field 6 = 1) No Yes, if 'Other' is not selected for reason for leaving last settled home (if field 102 is not 20) Yes, if letting is a renewal (if field 6 = 1) No Yes, if postcode of household's last settled home is not known (if 106 = 2) Yes No If household was given 'reasonable preference' (if field 110 = 1), at least one of these fields must be 1. If household was not given 'reasonable preference' (if field 110 = 2 or 3), these fields will be ignored. No Yes, if letting is a renewal (if field 6 = 1) No Yes, if household's income is unknown (if field 120 = 2 or 3) No Yes, if all rent and accommodation charges are provided (if fields 127 - 132 are not empty) No Yes, if accommodation is not a care home (if field 125 = 1) and all rent and accommodation charges are provided (if fields 128 - 132 are not empty) Yes, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty) Yes Yes, if submitting data to new CORE, if the household does not pay rent (if field 125 = 1) or if the accommodation is not a care home (if field 127 is empty) Yes, if the household doesn't receive housing benefits, or if it is unknown (if field 123 = 3, 9 or 10) Yes, if the household does not need to pay rent/charges after receiving housing benefits (if field133 = 2 or 3)
6 Type of letting the question applies to Affordable Rent only Intermediate Rent only Supported housing only General needs only General needs only Supported housing only Supported housing only
7 Duplicate check field? Yes Yes Yes Yes Yes
8 Bulk upload field number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

46
spec/services/bulk_upload/lettings/validator_spec.rb

@ -11,12 +11,6 @@ RSpec.describe BulkUpload::Lettings::Validator do
let(:file) { Tempfile.new } let(:file) { Tempfile.new }
describe "validations" do describe "validations" do
context "when file is empty" do
it "is not valid" do
expect(validator).not_to be_valid
end
end
context "when 2022" do context "when 2022" do
let(:bulk_upload) { create(:bulk_upload, user:, year: 2022) } let(:bulk_upload) { create(:bulk_upload, user:, year: 2022) }
@ -34,6 +28,25 @@ RSpec.describe BulkUpload::Lettings::Validator do
end end
end end
context "and is empty" do
it "is not valid" do
expect(validator).not_to be_valid
expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."])
end
end
context "and has a new line in it (empty)" do
before do
file.write("\n")
file.rewind
end
it "is not valid" do
expect(validator).not_to be_valid
expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."])
end
end
context "and doesn't have too many columns" do context "and doesn't have too many columns" do
before do before do
file.write(("a" * 95).chars.join(",")) file.write(("a" * 95).chars.join(","))
@ -71,6 +84,13 @@ RSpec.describe BulkUpload::Lettings::Validator do
end end
end end
context "and is empty" do
it "is not valid" do
expect(validator).not_to be_valid
expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."])
end
end
context "and file has too few valid headers" do context "and file has too few valid headers" do
let(:seed) { rand } let(:seed) { rand }
let(:log_to_csv) { BulkUpload::LettingsLogToCsv.new(log:) } let(:log_to_csv) { BulkUpload::LettingsLogToCsv.new(log:) }
@ -128,6 +148,13 @@ RSpec.describe BulkUpload::Lettings::Validator do
end end
end end
context "and is empty" do
it "is not valid" do
expect(validator).not_to be_valid
expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."])
end
end
context "and doesn't have too many columns" do context "and doesn't have too many columns" do
before do before do
file.write(("a" * 142).chars.join(",")) file.write(("a" * 142).chars.join(","))
@ -142,6 +169,13 @@ RSpec.describe BulkUpload::Lettings::Validator do
end end
context "when file has headers" do context "when file has headers" do
context "and is empty" do
it "is not valid" do
expect(validator).not_to be_valid
expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."])
end
end
context "and file has extra invalid headers" do context "and file has extra invalid headers" do
let(:seed) { rand } let(:seed) { rand }
let(:log_to_csv) { BulkUpload::LettingsLogToCsv.new(log:) } let(:log_to_csv) { BulkUpload::LettingsLogToCsv.new(log:) }

92
spec/services/bulk_upload/processor_spec.rb

@ -207,6 +207,98 @@ RSpec.describe BulkUpload::Processor do
end end
end end
context "when processing an empty file" do
let(:mock_downloader) do
instance_double(
BulkUpload::Downloader,
call: nil,
path:,
delete_local_file!: nil,
)
end
let(:file) { Tempfile.new }
let(:path) { file.path }
before do
allow(BulkUpload::Downloader).to receive(:new).with(bulk_upload:).and_return(mock_downloader)
end
it "sends failure email" do
mail_double = instance_double("ActionMailer::MessageDelivery", deliver_later: nil)
allow(BulkUploadMailer).to receive(:send_bulk_upload_failed_service_error_mail).and_return(mail_double)
processor.call
expect(BulkUploadMailer).to have_received(:send_bulk_upload_failed_service_error_mail).with(
bulk_upload:,
errors: ["Template is blank - The template must be filled in for us to create the logs and check if data is correct."],
)
expect(mail_double).to have_received(:deliver_later)
end
end
context "when processing an empty file with headers" do
context "when 2022-23" do
let(:mock_downloader) do
instance_double(
BulkUpload::Downloader,
call: nil,
path: file_fixture("2022_23_lettings_bulk_upload_empty_with_headers.csv"),
delete_local_file!: nil,
)
end
before do
allow(BulkUpload::Downloader).to receive(:new).with(bulk_upload:).and_return(mock_downloader)
end
it "sends failure email" do
mail_double = instance_double("ActionMailer::MessageDelivery", deliver_later: nil)
allow(BulkUploadMailer).to receive(:send_bulk_upload_failed_service_error_mail).and_return(mail_double)
processor.call
expect(BulkUploadMailer).to have_received(:send_bulk_upload_failed_service_error_mail).with(
bulk_upload:,
errors: ["Template is blank - The template must be filled in for us to create the logs and check if data is correct."],
)
expect(mail_double).to have_received(:deliver_later)
end
end
end
context "when 2023-24" do
let(:mock_downloader) do
instance_double(
BulkUpload::Downloader,
call: nil,
path: file_fixture("2023_24_lettings_bulk_upload_empty_with_headers.csv"),
delete_local_file!: nil,
)
end
before do
allow(BulkUpload::Downloader).to receive(:new).with(bulk_upload:).and_return(mock_downloader)
end
it "sends failure email" do
mail_double = instance_double("ActionMailer::MessageDelivery", deliver_later: nil)
allow(BulkUploadMailer).to receive(:send_bulk_upload_failed_service_error_mail).and_return(mail_double)
processor.call
expect(BulkUploadMailer).to have_received(:send_bulk_upload_failed_service_error_mail).with(
bulk_upload:,
errors: ["Template is blank - The template must be filled in for us to create the logs and check if data is correct."],
)
expect(mail_double).to have_received(:deliver_later)
end
end
context "when a bulk upload has an in progress log" do context "when a bulk upload has an in progress log" do
let(:mock_downloader) do let(:mock_downloader) do
instance_double( instance_double(

13
spec/services/bulk_upload/sales/validator_spec.rb

@ -13,6 +13,19 @@ RSpec.describe BulkUpload::Sales::Validator do
context "when file is empty" do context "when file is empty" do
it "is not valid" do it "is not valid" do
expect(validator).not_to be_valid expect(validator).not_to be_valid
expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."])
end
end
context "and has a new line in it (empty)" do
before do
file.write("\n")
file.rewind
end
it "is not valid" do
expect(validator).not_to be_valid
expect(validator.errors["base"]).to eql(["Template is blank - The template must be filled in for us to create the logs and check if data is correct."])
end end
end end

Loading…
Cancel
Save