* CLDC-1849 Add hint to discounted ownership purchase price
* Use PurchasePriceDiscountedOwnership in rtb page
* show question with updated hint to certain types of answers
* rubocop
* Only display shared ownership hint in some occations
* replace range validation with multiple to account for single-ended ranges
* add test for question with min but no max
* add min and max to household count question and remove bespoke validation. Remove code allowing max and no min given this situation does not seem to exist int eh form
* amend minor typo, add back a soft validation that had mysteriously gone missing
* 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
* Display the correct error for privacy notice and display the partial guidance at the top by default
* Always display privacy notice question
* Disable the rest of the housing characteristics questions until privacynotice is answered
* fix tests
* remove duplicate field
* Display the household questions if the buyers were not interviewed
* 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 old_persons_shared_ownership_value_check to sales table
* Move hard validation method to soft validation
* Add old persons shared ownership value check page and question
* Add pages to the household characteristics
* Add soft validation after ownership type
* update a test
* make old_persons_shared_ownership_value_check optional because it's in the setup section
* typo
* 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 min and max for age 1 validation
* Add retirement value check column to the sales table
* Add retirement value check question and page
* Add retirement value check pages to household characteristics
* Reuse soft validations for retirement in sales
* Update person_indexes
* Add old_persons_shared_ownership validation
* Display the retirement value check in correct places depending on the joinpur value
* Update page IDs
* It's always joint purchase if age 2 is displayed
* lint
* lint
* Add min and max to age2 + questions
* validate that under 16s are economic children
* Update factory
* Update test
* Update ecstat, relationship and age validation
* Enable multiple inferred check answers values
* lint and add new conditions to check answers for age1
* Rename method
* Refactor inferred answer value
* rebase update
* update inferred_check_answers_value after rebase
* Move the method to private
* Add a missing test
* rebase changes
* Add prefers not to say as the displayed value for all household members
* update [0] to .first
* replace [0] with .first
* Route to mortagage questions only if mortgage is used
* Fix tests for deposit derived var
* more routing
* Only display mortgage lender questions if mortgage is used
* Add postcode fields
* Add postcode page and questions
* Add postcode page to the property information subsection
* Only display local authority question if the la is not inferred
* Fix migration
* Move postcode validation
* Infer LA fields from postcode
* infer partial postcodes
* Add fromprop field to the sales log
* Fix gender identity typo
* Add previous property type page and questions
* Add previous property type to the shared ownership section
* feat: add gender identity questions for all 4 people, combine into single page/question
* feat: update schema and add tests
* tests: update tests
* feat: update to main
* feat: update db and test
* Mark subsection as completed if it is not displayed in the tasklist and hide it from the UI
* Add sale_information section
* add sales information subsections
* Cldc 1531 staircasing (#1109)
* Add staircase field to sales_logs table
* Add staircase question and page
* add staircase page to the shared ownership scheme subsection fix file name
* Cldc 1539 previous bedrooms (#1108)
* add frombeds field
* Add previous_bedrooms page and question
* add Previous Bedrooms page to the shared ownership subsection
* Cldc 1532 about staircasing (#1110)
* Add stairboughts and stairowned fields to the database
* Add about staircasing page and questions
* Add about staircasing page to the shared wnership scheme subsection
* Add a space before percent
* Cldc 1546 monthly rent (#1111)
* Add monthly rent column to sales logs table
* Add monthly rent question and page
* Add monthly rent page to the shared ownership scheme subsection
* Cldc 1535 exchange contracts (#1112)
* Add exdate to sales logs table
* Add exchange date page and question
* Add exchange contracts page to the shared ownership subsection
* derive exday, exmonth and exyear, tests and lint
* rebase tests
* Cldc 1538 la nominations (#1115)
* Add la nominations column to sales logs table
* Add La nominations page and questions
* Add la nominations to the shared ownership subsection
* Add accidentally removed files
* Cldc 1545 about the deposit (#1113)
* feat: add question(s) without depends_on behaviour
* feat: separate ids for diff sections
* test: update tests
* test: add tests
* tests: test tweaks
* refactor: linting
* Cldc 1538 la nominations (#1115)
* Add la nominations column to sales logs table
* Add La nominations page and questions
* Add la nominations to the shared ownership subsection
* Add accidentally removed files
* feat: add question(s) without depends_on behaviour
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
* Cldc 1533 is resale (#1118)
* feat: add resale question and page
* tests: add new tests
* test: update previous tests
* refactor: linting
* refactor: linting
* Cldc 1576 buyer prp (#1117)
* Add soctenant field to sales logs
* Add buyer previous page and question
* Add buyer previous page to shared ownership scheme subsection
* rebase migrate
* rebase too
* Cldc 1540 about price (#1121)
* add price fields to the sales logs table
* Add about proce questions
* add about proce pages
* Add about price pages to sale information sections
* rebase changes
* happy new year
* Switch the order of sales log sections
* Cldc 1540 fixes (#1130)
* Update order of pages and remove wrong id's
* Add spacing to the hint text
* feat: add page, question, and update db
* Cldc 1521 living before purchase (#1129)
* feat: add new page and question and update db
* test: add and update tests
* feat: reset db
* feat: infer mscharge if mscharge_known == No
* test: add and update tests
* feat: add page, question, and update db
* feat: infer mscharge if mscharge_known == No
* test: add and update tests
* feat: update to main
* test: update tests
* tests: update tests
* faet: move mscharge derivation
Co-authored-by: Kat <katrina@kosiak.co.uk>
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
* Refactor details known to reuse pages and questions
* Refactor page_depends_on
* Use field_for_person
* feat: tweak person_known behaviour to only show for people 2-4, and ask person_known regardless of answer to previous person_known questions. Also remove redundant personx_known files
* test: update tests
* feat: add dynamic cya card titles
* refactor: simplificaiton
* refactor: use check_answers_card_number again
* refactor: linting
* tests: add card title tests for sales log CYA page
* refactor: linting
* feat: make private method private
* feat: update person known behaviour
* test: update tests
* test: update tests
* test: add new person known tests
* feat: remove buyer 1 working situation duplicated header
* refactor: linting
Co-authored-by: Kat <katrina@kosiak.co.uk>
* Add armed forces spouse column to the db
* Add armed forces spouse page and question
* Add armed forces spouse question to the subsection
* rebase test
* Refactor details known to reuse pages and questions
* Refactor page_depends_on
* Use field_for_person
* feat: tweak person_known behaviour to only show for people 2-4, and ask person_known regardless of answer to previous person_known questions. Also remove redundant personx_known files
* test: update tests
* feat: add person 1 known page back in
Co-authored-by: natdeanlewissoftwire <nat.dean-lewis@softwire.com>