* clear age2 if it's out of range
* Clear beds if over max
* Clear charges if there are carehome charges given
* Clear charges if scharge is under 0
* Clear tshortfall if it is not positive
* Clear referral if it's an invalid temporary accommodation
* Clear charges if pscharge is outside the range
* Clear charges if supcharg is outside the range
* Refactor clearing charges
* Clear charges is scharge is outside the range
* Clear location and scheme if location is inactive during the tenancy start date
* Remove care home charge if it's outside the range
* Refactor validation error information infor a hash
* Clear age out of range for all people
* Remove unused constant
* Update import logging messages
* Extract earnings validation and remove to_set from hash
* Remove to_delete
* Update logging
* Update bulk upload errors
@ -274,7 +276,8 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing age1 and prevten as incompatible/)
expect(logger).toreceive(:warn).with(/Removing prevten with error: Answer cannot be a children’s home or foster care as the lead tenant is 20 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 20 or older/)
@ -327,7 +330,7 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing internal transfer referral since previous tenancy is a non social housing/)
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/)
@ -349,7 +352,7 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing internal transfer referral since previous tenancy is fixed terms or lifetime/)
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/)
@ -379,12 +382,13 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing vacancy reason and previous tenancy since this accommodation is not temporary/)
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/)
@ -402,12 +406,12 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing offered as the value is above the maximum of 20/)
expect(logger).toreceive(:warn).with(/Removing offered with error: Enter a number between 0 and 20 for the amount of times the property has been re-let/)
@ -424,12 +428,12 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing working situation because income is too high for it/)
expect(logger).toreceive(:warn).with(/Removing ecstat1 with error: Net income cannot be greater than £890 per week given the tenant’s working situation/)
expect(logger).toreceive(:warn).with(/Removing brent with error: Enter a total charge that is at least £10 per week, 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?/)
expect(logger).toreceive(:warn).with(/Removing scharge with error: Enter a total charge that is at least £10 per week, 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?/)
expect(logger).toreceive(:warn).with(/Removing pscharge with error: Enter a total charge that is at least £10 per week, 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?/)
expect(logger).toreceive(:warn).with(/Removing supcharg with error: Enter a total charge that is at least £10 per week, 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?/)
expect(logger).toreceive(:warn).with(/Removing tcharge with error: Enter a total charge that is at least £10 per week, 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?/)
expect(logger).toreceive(:warn).with(/Removing brent with error: Enter an amount above 0, 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, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing scharge with error: Enter an amount above 0, 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, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing pscharge with error: Enter an amount above 0, 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, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing supcharg with error: Enter an amount above 0, 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, Service charge must be at least £0 every week/)
expect(logger).toreceive(:warn).with(/Removing tcharge with error: Enter an amount above 0, 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, Service charge must be at least £0 every week/)
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/)
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/)
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/)
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/)
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./)
expect(logger).toreceive(:warn).with(/Removing chcharge with error: Household rent and other charges must be between £10 and £1000 if paying weekly for 52 weeks/)
@ -655,7 +992,7 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing joint tenancy as there is only 1 person in the household/)
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/)
@ -698,7 +1035,8 @@ RSpec.describe Imports::LettingsLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing tshortfall as there are no outstanding charges/)
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/)