diff --git a/app/services/rates_importer_service.rb b/app/services/rates_importer_service.rb index bad7340f..3de7bf78 100644 --- a/app/services/rates_importer_service.rb +++ b/app/services/rates_importer_service.rb @@ -32,11 +32,9 @@ def import(row, rating_year, council) end rates_bill = RatesBill.find_by(property: property, rating_year: rating_year) - if rates_bill.present? - # current_rates = rates_bill.total_rates.to_f.round(2) - # new_rates = (total_rates.to_f + total_water_rates.to_f).round(2) - # raise 'mismatch total_rates' unless current_rates == new_rates - else + # future work is required to handle when rates change for a property + # this is complicated by the fact we use rates_bills[0] throughout the code + unless rates_bill.present? RatesBill.create!( property: property, rating_year: rating_year, diff --git a/app/services/rebate_forms_service.rb b/app/services/rebate_forms_service.rb index 24664998..0e156da6 100644 --- a/app/services/rebate_forms_service.rb +++ b/app/services/rebate_forms_service.rb @@ -11,9 +11,7 @@ def initialize(rebate_form_attributes) def create! council = find_council! property = find_or_create_property!(council) - rebate_form = create_rebate_form!(property) - - rebate_form + create_rebate_form!(property) end private