diff --git a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb b/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb index 907968028..be2126482 100644 --- a/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb +++ b/app/models/form/sales/pages/shared_ownership_deposit_value_check.rb @@ -8,7 +8,7 @@ class Form::Sales::Pages::SharedOwnershipDepositValueCheck < ::Form::Page ] @informative_text = {} @title_text = { - "translation" => "soft_validations.shared_owhership_deposit.title_text", + "translation" => "soft_validations.shared_ownership_deposit.title_text", "arguments" => [ { "key" => "expected_shared_ownership_deposit_value", diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb index c2a6f5e30..d6f992c51 100644 --- a/app/models/validations/sales/sale_information_validations.rb +++ b/app/models/validations/sales/sale_information_validations.rb @@ -67,7 +67,7 @@ module Validations::Sales::SaleInformationValidations def validate_basic_monthly_rent(record) return unless record.mrent && record.ownershipsch && record.type - if record.shared_owhership_scheme? && !record.old_persons_shared_ownership? && record.mrent > 9999 + if record.shared_ownership_scheme? && !record.old_persons_shared_ownership? && record.mrent > 9999 record.errors.add :mrent, I18n.t("validations.sale_information.monthly_rent.higher_than_expected") record.errors.add :type, I18n.t("validations.sale_information.monthly_rent.higher_than_expected") end diff --git a/config/locales/en.yml b/config/locales/en.yml index 63f70771a..1ca83fd3c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -467,7 +467,7 @@ en: title_text: "You told us the time between the start of the tenancy and the major repairs completion date is more than 2 years" void_date: title_text: "You told us the time between the start of the tenancy and the void date is more than 2 years" - shared_owhership_deposit: + shared_ownership_deposit: title_text: "Mortgage, deposit and cash discount total should equal £%{expected_shared_ownership_deposit_value}" devise: diff --git a/db/schema.rb b/db/schema.rb index 4b5e65a4e..ad89e0809 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -70,6 +70,17 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_26_145529) 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" @@ -487,9 +498,9 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_26_145529) 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" @@ -502,12 +513,12 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_26_145529) 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.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id" t.integer "shared_ownership_deposit_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" t.index ["updated_by_id"], name: "index_sales_logs_on_updated_by_id" diff --git a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb index afe25f4d3..893a5cb5b 100644 --- a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb @@ -33,7 +33,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.shared_owhership_deposit.title_text", + "translation" => "soft_validations.shared_ownership_deposit.title_text", "arguments" => [ { "key" => "expected_shared_ownership_deposit_value", diff --git a/spec/models/validations/sales/sale_information_validations_spec.rb b/spec/models/validations/sales/sale_information_validations_spec.rb index 9823f8493..e796300cf 100644 --- a/spec/models/validations/sales/sale_information_validations_spec.rb +++ b/spec/models/validations/sales/sale_information_validations_spec.rb @@ -361,7 +361,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do end end - context "when owhership is not discounted" do + context "when ownership is not discounted" do let(:record) { FactoryBot.build(:sales_log, mortgage: 10_000, deposit: 5_000, grant: 3_000, value: 20_000, discount: 10, ownershipsch: 1) } it "does not add an error" do