* Clear all the charges if the error is on tcharge
* Round earnings value upon import
* Rounds savings to the nearest 10
* Clear income on over_hard_max_for_london validation
* Refactor sale import validations to be consistent with lettings
* Extract charges attributes into a variable
@ -631,7 +631,8 @@ RSpec.describe Imports::SalesLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing previous postcode known and previous postcode as the postcode is invalid/)
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/)
@ -726,7 +727,7 @@ RSpec.describe Imports::SalesLogsImportService do
end
it"intercepts the relevant validation error"do
expect(logger).toreceive(:warn).with(/Removing mortgage because it cannot be 0/)
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/)
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/)