* Add discounted_sale_value_check to sales
* Add DiscountedSaleValueCheck pages and questions
* Add value check to the form
* Only run validate_discounted_ownership_value as a hard validation on and after 24/25
* Rebase fix
* Fix form spec
* Update discounted_ownership_value_invalid?
* update validation
* Update soft validation content
* PR comments
* typo
* lint
* Default discounted_sale_value_check on import
* Add mortgage value check after mortgage used and mortgage amount pages
* Run the mortgage amount validation on non joint purchases as well
* Add validation to disounted and outright sales
* only show buyer 2 checks if it's a jjoint purchase
* Add monthly_charges_value_check field to sales
* Add monthly_charges_over_soft_max soft validation
* Add monthly_charges_value_check page and question
* Add monthly_charges_value_check pages to the relevant subsections
* Fix optional field name, add validation message
* test
* change percent to % so that suffix is consistent with other similar questions
* fix rebase conflicts
* add hard validation that percentage owned after a staircasing transaction cannot be less than the percentage bought in that transaction, with associated tests
* add compound validation to ensure that logs of type older person shared ownership may not have a stairbought value of greater than 75% \n associated tests included
* remove duplicate method and use existing version
* fix rebase conflicts
* ensure schema correct and test of page number correct
* fix form handler test after rebase
* fix tests and ensure schema correct after rebase
* fix rebase conflicts
* fix rebase conflicts
* feat: update validation
* fix rebase conflicts
* fix rebase conflicts
* test: update
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* implement before validation check to ensure that if the user declares no mortgage will be used, mortgage value is set to 0
* fix rebase conflicts
* fix rebase conflicts
* remove comment
* fix rebase conflicts
* Update config/locales/en.yml
Co-authored-by: James Rose <james@jbpr.net>
* alter order of before validation methods on sales log so that derived fields are calculated after invalidated dependent fields are cleared, fix tests broken by this change
* add mortgage to derived variables so that mortgage value is set to 0 if a mortgage is not being used in the sale
* remove hard validation of range for discount question and allow shared validation of numeric questions to handle this case
* amend tests after rebasing
* fix tests after rebasing
* fix test and ensure schema correct after rebase
---------
Co-authored-by: natdeanlewissoftwire <nat.dean-lewis@softwire.com>
Co-authored-by: James Rose <james@jbpr.net>
* Add income error to ownership type and ecstat fields
* Add shared_ownership_deposit_value_check field
* Add shared_ownership_deposit_invalid? soft validation
* Add shared ownership deposit check pages and questions
* Add pages to the subsection and update validation message
* tests
* Update validation to only trigger if la is given
* Run the soft validation when mortgage isn't used or cash discount isn't given
* test
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* implement soft validation of grant value
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* fix final test from added page
* update test after rebase
* Add savings soft validation page and question
* Add savings saof validation page to the income subsection
* add savings_over_soft_max? soft validation
* Add deposit value check soft validation page and question
* Add deposit soft validation page to the income and benefits subsection
* Add deposit, savings and deposit value check fields to the db
* Add deposit over soft max validation
* Add the value check to the new sections
* Include shared validations in sales log model and run validate_numeric_min_max method
* Add non london hard max income validation
* Add london income validation
* Remove child vlidation because buyer cannot be a child
* Add income1_value_check column
* Add buyer_1_income_value_check question and page
* Update income1_under_soft_min?
* Add mortgage and value check column
* Add mortgage value check page
* Update mortgage_over_soft_max? in soft validateions
* Remove unused error message