expect(logger).toreceive(:warn).with(/is not completed/).twice
expect(logger).toreceive(:warn).with(/is incomplete but status should be complete/).twice
expect(logger).toreceive(:warn).with(/The following lettings logs had status discrepancies: \[893ufj2s-lq77-42m4-rty6-ej09gh585uy1, 5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd\]/)
lettings_log_service.create_logs(remote_folder)
end
end
end
end
context"when importing a specific log"do
context"when importing a specific log"do
@ -171,9 +137,6 @@ RSpec.describe Imports::LettingsLogsImportService do
@ -251,8 +210,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing earnings with error: Net income cannot be less than £10.00 per week given the tenant’s working situation/)
expect(logger).toreceive(:warn).with(/Removing incfreq with error: Net income cannot be less than £10.00 per week given the tenant’s working situation/)
@ -304,8 +259,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing prevten with error: Answer cannot be a children’s home or foster care as the lead tenant is 26 or older/)
expect(logger).toreceive(:warn).with(/Removing age1 with error: Answer cannot be a children’s home or foster care as the lead tenant is 26 or older/)
@ -386,7 +335,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing referral with error: Answer cannot be internal transfer as the household situation immediately before this letting was Residential care home/)
@ -408,7 +356,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing referral with error: Answer cannot be internal transfer as it’s the same landlord on the tenancy agreement and the household had either a fixed-term or lifetime local authority general needs tenancy immediately before this letting/)
@ -438,8 +385,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing prevten with error: Answer cannot be non-temporary accommodation as this is a re-let to a tenant who occupied the same property as temporary accommodation/)
expect(logger).toreceive(:warn).with(/Removing rsnvac with error: Answer cannot be non-temporary accommodation as this is a re-let to a tenant who occupied the same property as temporary accommodation/)
@ -507,7 +451,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing ecstat1 with error: Net income cannot be greater than £890.00 per week given the tenant’s working situation/)
@ -611,11 +549,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with("Log 0b4a68df-30cc-474a-93c0-a56ce8fdad3b: Removing brent with error: Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’, Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0b4a68df-30cc-474a-93c0-a56ce8fdad3b: Removing scharge with error: Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’, Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0b4a68df-30cc-474a-93c0-a56ce8fdad3b: Removing pscharge with error: Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’, Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0b4a68df-30cc-474a-93c0-a56ce8fdad3b: Removing supcharg with error: Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’, Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0b4a68df-30cc-474a-93c0-a56ce8fdad3b: Removing tcharge with error: Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’, Enter a total charge that is at least £10.00 per week")
@ -639,11 +572,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing brent with error: Enter a value for the service charge between £0 and £480 per week if the landlord is a private registered provider and it is a supported housing letting, Enter an amount above 0, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing scharge with error: Enter a value for the service charge between £0 and £480 per week if the landlord is a private registered provider and it is a supported housing letting, Enter an amount above 0, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing pscharge with error: Enter a value for the service charge between £0 and £480 per week if the landlord is a private registered provider and it is a supported housing letting, Enter an amount above 0, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing supcharg with error: Enter a value for the service charge between £0 and £480 per week if the landlord is a private registered provider and it is a supported housing letting, Enter an amount above 0, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing tcharge with error: Enter a value for the service charge between £0 and £480 per week if the landlord is a private registered provider and it is a supported housing letting, Enter an amount above 0, Service charge must be at least £0 every week/)
@ -698,7 +624,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing referral with error: Answer cannot be this source of referral as this is a re-let to tenant who occupied the same property as temporary accommodation/)
@ -721,11 +646,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing brent with error: Enter a value for the personal service charge between £0 and £30 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing scharge with error: Enter a value for the personal service charge between £0 and £30 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing pscharge with error: Enter a value for the personal service charge between £0 and £30 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing supcharg with error: Enter a value for the personal service charge between £0 and £30 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing tcharge with error: Enter a value for the personal service charge between £0 and £30 per week if the landlord is a private registered provider and it is a general needs letting/)
@ -749,11 +669,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing brent with error: Enter a value for the support charge between £0 and £40 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing scharge with error: Enter a value for the support charge between £0 and £40 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing pscharge with error: Enter a value for the support charge between £0 and £40 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing supcharg with error: Enter a value for the support charge between £0 and £40 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing tcharge with error: Enter a value for the support charge between £0 and £40 per week if the landlord is a private registered provider and it is a general needs letting/)
@ -777,11 +692,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing brent with error: Enter a value for the service charge between £0 and £155 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing scharge with error: Enter a value for the service charge between £0 and £155 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing pscharge with error: Enter a value for the service charge between £0 and £155 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing supcharg with error: Enter a value for the service charge between £0 and £155 per week if the landlord is a private registered provider and it is a general needs letting/)
expect(logger).toreceive(:warn).with(/Removing tcharge with error: Enter a value for the service charge between £0 and £155 per week if the landlord is a private registered provider and it is a general needs letting/)
@ -808,11 +718,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing brent with error: Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing scharge with error: Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing pscharge with error: Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing supcharg with error: Enter a total charge that is at least £10.00 per week")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing tcharge with error: Enter a total charge that is at least £10.00 per week")
@ -850,11 +755,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing brent with error: Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing scharge with error: Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing pscharge with error: Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing supcharg with error: Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms")
expect(logger).toreceive(:warn).with("Log 0ead17cb-1668-442d-898c-0d52879ff592: Removing tcharge with error: Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms")
@ -879,9 +779,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Differences found when saving log/)
expect(logger).toreceive(:warn).with(/Removing location_id with error: The location LS16 6FT was deactivated on 10 October 2021 and was not available on the day you entered./)
expect(logger).toreceive(:warn).with(/Removing scheme_id with error: The location LS16 6FT was deactivated on 10 October 2021 and was not available on the day you entered./)
@ -941,7 +835,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing chcharge with error: Household rent and other charges must be between £10.00 and £5,000.00 if paying weekly for 52 weeks/)
@ -1220,7 +1112,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing joint with error: This cannot be a joint tenancy as you've told us there's only one person in the household/)
@ -1263,8 +1154,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing tshortfall with error: You cannot answer the outstanding amount question if you don’t have outstanding rent or charges/)
expect(logger).toreceive(:warn).with(/Removing hbrentshortfall with error: You cannot answer the outstanding amount question if you don’t have outstanding rent or charges/)
@ -1346,7 +1234,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with("Log 0b4a68df-30cc-474a-93c0-a56ce8fdad3b: Removing period with error: DLUHC does not charge rent weekly for 52 weeks")
@ -1387,7 +1274,6 @@ RSpec.describe Imports::LettingsLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing layear with error: The household cannot have just moved to the local authority area if this letting is a renewal/)
expect(logger).toreceive(:warn).with(/is not completed/).twice
expect(logger).toreceive(:warn).with(/is incomplete but status should be complete/).twice
expect(logger).toreceive(:warn).with(/The following sales logs had status discrepancies: \[shared_ownership_sales_log3, shared_ownership_sales_log4\]/)
sales_log_service.create_logs(remote_folder)
end
end
end
end
context"when importing a specific log"do
context"when importing a specific log"do
@ -537,8 +505,6 @@ RSpec.describe Imports::SalesLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Log discounted_ownership_sales_log: Removing field ecstat2 from log triggering validation: Answer cannot be ‘child under 16’ as you told us the person 2 is older than 16/)
expect(logger).toreceive(:warn).with(/Log discounted_ownership_sales_log: Removing field age2 from log triggering validation: Answer cannot be over 16 as person’s 2 working situation is ‘child under 16‘/)
@ -675,7 +637,6 @@ RSpec.describe Imports::SalesLogsImportService do
end
end
it"intercepts the relevant validation error but does not clear setup fields"do
it"intercepts the relevant validation error but does not clear setup fields"do
expect(logger).toreceive(:warn).with(/Log shared_ownership_sales_log: Removing field stairbought from log triggering validation: The minimum increase in equity while staircasing is 10%/)
@ -693,8 +654,6 @@ RSpec.describe Imports::SalesLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing ppcodenk with error: Buyer's last accommodation and discounted ownership postcodes must match, Last settled accommodation and discounted ownership property postcodes must match/)
expect(logger).toreceive(:warn).with(/Removing ppostcode_full with error: Buyer's last accommodation and discounted ownership postcodes must match, Last settled accommodation and discounted ownership property postcodes must match/)
@ -789,7 +746,6 @@ RSpec.describe Imports::SalesLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing mortgage with error: Mortgage amount must be at least £1, Mortgage value cannot be £0 if a mortgage was used for the purchase of this property/)
@ -841,7 +796,6 @@ RSpec.describe Imports::SalesLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing income2 with error: Combined income must be £80,000 or lower for properties outside London local authorities, Income must be £80,000 or lower for properties outside London local authority/)
@ -893,7 +846,6 @@ RSpec.describe Imports::SalesLogsImportService do
end
end
it"intercepts the relevant validation error"do
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing income2 with error: Combined income must be £90,000 or lower for properties within a London local authority, Income must be £90,000 or lower for properties within a London local authority/)