diff --git a/app/models/validations/sales/soft_validations.rb b/app/models/validations/sales/soft_validations.rb index b6b393352..e29f69e18 100644 --- a/app/models/validations/sales/soft_validations.rb +++ b/app/models/validations/sales/soft_validations.rb @@ -43,7 +43,6 @@ module Validations::Sales::SoftValidations extrabor != 1 && mortgage + deposit > value - value * discount / 100 end - def hodate_3_years_or_more_exdate? return unless hodate && exdate diff --git a/db/schema.rb b/db/schema.rb index 8722ec6a4..4bc410328 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_01_23_160741) do +ActiveRecord::Schema[7.0].define(version: 2023_01_24_111328) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -69,6 +69,17 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_23_160741) do t.index ["start_year", "lettype", "beds", "la"], name: "index_la_rent_ranges_on_start_year_and_lettype_and_beds_and_la", unique: true end + create_table "la_sale_ranges", force: :cascade do |t| + t.string "la" + t.integer "bedrooms" + t.decimal "soft_min", precision: 10, scale: 2 + t.decimal "soft_max", precision: 10, scale: 2 + t.integer "start_year" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["start_year", "bedrooms", "la"], name: "index_la_sale_ranges_on_start_year_bedrooms_la", unique: true + end + create_table "legacy_users", force: :cascade do |t| t.string "old_user_id" t.integer "user_id" @@ -486,9 +497,9 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_23_160741) do t.integer "hoyear" t.integer "fromprop" t.integer "socprevten" - t.integer "mortlen" t.integer "mortgagelender" t.string "mortgagelenderother" + t.integer "mortlen" t.integer "extrabor" t.integer "hhmemb" t.integer "totadult" @@ -501,10 +512,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_23_160741) do t.boolean "is_la_inferred" t.bigint "bulk_upload_id" t.integer "retirement_value_check" - t.integer "deposit_and_mortgage_value_check" - t.integer "grant_value_check" t.integer "hodate_check" t.integer "extrabor_value_check" + t.integer "grant_value_check" + t.integer "value_value_check" t.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id" t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id" t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id" diff --git a/db/seeds.rb b/db/seeds.rb index 592c489c9..54efda1a8 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -314,7 +314,7 @@ unless Rails.env.test? if LaSaleRange.count.zero? Dir.glob("config/sale_range_data/*.csv").each do |path| start_year = File.basename(path, ".csv") - service = Imports::PurchasePriceRangesService.new(start_year:, path:) + service = Imports::SaleRangesService.new(start_year:, path:) service.call end end