* 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 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
* 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
* 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
* Cldc 1521 living before purchase (#1129)
* feat: add new page and question and update db
* test: add and update tests
* feat: reset db
* Only display from beds for social housing (#1131)
* Cldc 1544 mortgage amount (#1136)
* feat: add sales log seeds
* feat: add question and page and update db
* tests: add and update tests
* Cldc 1540 fixes part two (#1135)
* Change about_price_social_housing to about_price_shared_ownership and display it in all shared ownership cases
* Change about_price to purchase_price and display it for outright sale
* lint
* Move exchange contracts date page (#1143)
* feat: PO fix and tests (#1144)
* feat: PO fix and tests
* feat: simmplification
* refactor: linting
* feat: copy tweak
Co-authored-by: natdeanlewissoftwire <94526761+natdeanlewissoftwire@users.noreply.github.com>
Co-authored-by: natdeanlewissoftwire <nat.dean-lewis@softwire.com>
* Add person1 working situation question
* Add ecstat3 column to the sales log
* migration
* Add the rest of ecstat questions
* Update schema
* tests
* Reuse pages and questions
* Reuse the same page
* refactor indexes
* Add other ecstat columns
* Extract person methods to parent class
* Add income1_value_check column
* Use dynamic ids for pages
* Display Buyer1IncomeValueCheck twice
* Use id argument and pass in full IDs
* Remove accidental migration
* 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
* add start of bulk upload logs journey
* split upload controller into 2
* add year page to bulk upload journey
* bulk upload years now dynamic
* add placeholder for upload your file page
* handle bulk upload when not in crossover
* add bulk upload csv user journey
* bulk upload now persists and sends to S3
* swap ruby-filemagic for file command
* match csv or text file for validation
* in_crossover_period? now uses overlap of forms
- also moved from Form to FormHandler
* add production env var for CSV bucket
* stub kernel call methods
* remove duplicate env var
* hardcode env var for review apps
* move feature toggle to FeatureToggle
* crossover period checks now specific to the form
* fix typo in bulk upload journey
* Add gender identity 3 comumn to the sales table
* Add gender identity for person 1
* Add gender identity for person 1 when there is only 1 buyer
* Add person 1 gender identity page to subsection
* Rename questions and pages
* fix tests
* feat: wip update scheme summary page
* feat: wip deactivate scheme schemes page
* feat: wip toggle active page
* feat: wip set deactivation_date to a datetime (to be more specific times later_
* Change conditional question controller to accommodate all models
* feat: add specific datetimes for deactivation
* feat: correct date and add notice
* feat: wip error behaviour
* feat: wip errors
* feat: wip errors refactoring
* feat: wip errors more refactoring
* refactor: linting
* feat: add second error in correct position and wip date range error
* feat: remove unneccessary db field
* feat: change type values to strings
* refactor: tidy up controller logic
* refactor: use same structure as locations deactivation
* feat: add general partially missing date input error
* feat: add tests ("updates existing scheme with valid deactivation date and renders scheme page" still wip) and add new partially nil date behaviour to locations controller
* feat: fix tests, add status tag behaviour and remove unnecessary nils
* refactor: linting
* refactor: erblinting
* refactor: remove redundant line
* refactor: respond to PR comments 1
* refactor: respond to PR comments 2
* refactor: respond to PR comments 3
* refactor: respond to PR comments 3 (locations side)
* fix: remove @locations in location model
* fix: remove @locations in location model
* fix: update status names
* feat: wip validation update
* feat: add validation to model layer
* feat: further separate scheme deactivation behaviour
* test: update tests to new flow
* feat: respond to pr comments and add dynamic success text
* feat: duplicate behaviour schemes -> locations (+ tests)
* refactor: linting
* refactor: typo and remove unnecessary line for this PR
* refactor: feature toggle simplification
* Refactor locations and schemes controller actions
- Rename confirmation partials to `deactivate_confirm.html.erb` so that they match the actions in which they belong to
- Make all deactivation date comparision UTC time
* feat: update deactivation_date validation and add tests
* refactor: linting
Co-authored-by: Kat <katrina@kosiak.co.uk>
Co-authored-by: James Rose <james@jbpr.net>
* Add scopes to OrganisationRelationship
* Update seeds to have more than one org relationships
* Pass current_user to questions
* Add new questions
* Use feature flag
* Update specs
* Address comments
* add deactivation_date to locations
* Change conditional question controller to accommodate all models
* UI spike
* Update toggle-active views and render them correctly
* Display 2 errors
* Update errors
* Extract text to translation file
* Add collection start date
* Add out of range validation
* Update affected logs label
* lint
* Add status method
* update the displayed status tags
* Keep deactivation_date_type selected if an error occurs
* refactor deactivation_date_type to use default and other as options instead of 1 and 2
* refactor
* refactor
* update lettings logs
* Add reactivate ocation button and path
* Fix controller and update deactivate confirm page
* Don't actually update the logs data when deactivating a location
* lint and typos
* update a path
* update current_collection_start_date
* Remove unused scope