Browse Source

Remove repeating deposit question

pull/2548/head
Kat 2 years ago
parent
commit
0a0a4a940a
  1. 6
      app/models/form/sales/subsections/shared_ownership_scheme.rb
  2. 3
      spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb

6
app/models/form/sales/subsections/shared_ownership_scheme.rb

@ -39,14 +39,12 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection
Form::Sales::Pages::MortgageLenderOther.new("mortgage_lender_other_shared_ownership", nil, self, ownershipsch: 1),
Form::Sales::Pages::MortgageLength.new("mortgage_length_shared_ownership", nil, self, ownershipsch: 1),
Form::Sales::Pages::ExtraBorrowing.new("extra_borrowing_shared_ownership", nil, self, ownershipsch: 1),
Form::Sales::Pages::Deposit.new("deposit", nil, self, optional: false, ownershipsch: 1),
Form::Sales::Pages::Discount.new("discount", nil, self, optional: false),
(Form::Sales::Pages::Deposit.new("deposit_optional", nil, self, optional: true, ownershipsch: 1) if form.start_year_after_2024?),
(Form::Sales::Pages::Discount.new("discount_optional", nil, self, optional: true) if form.start_year_after_2024?),
Form::Sales::Pages::Deposit.new("deposit_shared_ownership", nil, self, ownershipsch: 1, optional: false),
(Form::Sales::Pages::Deposit.new("deposit_shared_ownership_optional", nil, self, ownershipsch: 1, optional: true) if form.start_year_after_2024?),
Form::Sales::Pages::DepositValueCheck.new("deposit_joint_purchase_value_check", nil, self, joint_purchase: true),
Form::Sales::Pages::DepositValueCheck.new("deposit_value_check", nil, self, joint_purchase: false),
Form::Sales::Pages::Discount.new("discount", nil, self, optional: false),
(Form::Sales::Pages::Discount.new("discount_optional", nil, self, optional: true) if form.start_year_after_2024?),
Form::Sales::Pages::SharedOwnershipDepositValueCheck.new("shared_ownership_deposit_value_check", nil, self),
Form::Sales::Pages::MonthlyRent.new(nil, nil, self),
Form::Sales::Pages::LeaseholdCharges.new("leasehold_charges_shared_ownership", nil, self, ownershipsch: 1),

3
spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb

@ -49,11 +49,10 @@ RSpec.describe Form::Sales::Subsections::SharedOwnershipScheme, type: :model do
mortgage_lender_other_shared_ownership
mortgage_length_shared_ownership
extra_borrowing_shared_ownership
deposit
discount
deposit_shared_ownership
deposit_joint_purchase_value_check
deposit_value_check
discount
shared_ownership_deposit_value_check
monthly_rent
leasehold_charges_shared_ownership

Loading…
Cancel
Save