* 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>
* Refactor working situation to take in person index
* Refactor age to take in person index
* Remove unused methods
* Cleanup
* Change person_index to a named argument
* extract details_known_question_id
* Fix answer options
* Add field_for_person methods
* 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
* Validate that the user belongs to either the managing or owning organisation
* do not reset created_by and remove user_organisation_chosen?
* Do not default managing organisation to owning organisation
* validate user belongs to organisation
* update tests to specify created_by
* clear create_by for support users
* refactor
* typo
* rebase lint
* Add `updated_by` to logs to track who was the last person to update a log
- Reset `created_by` automatically when a form is updated and the owner does not belong to the managing or owning organisation
* move reset_invalidated_dependent_fields!, update schema file and fix tests
Co-authored-by: James Rose <james@jbpr.net>
* 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
- It's possible that we import rent periods for an organisation that we haven't yet defined on the new service
- In this instance an organisation as `rent_period` of 10, which correspondsto 'Weekly for 53' in the previous service
- Until we decide how to manage that rent period we should safely generate the rent labels
- the following error seems to occur fairly frequently
```
Cannot cancel a deployment with status: FINALIZED and reason: DEGENERATE
```
- removing rolling deployments to see if this can resolve that
- I don't feel rolling deployments will be missed from review apps
* Display person 2, 3, 4 age question if their details are known
* Infer check answers value for age questions as 'Not known'
* Hide age known question in check answers if it is answered yes or no
* Add card numbers to household characteristics question
* Update gender identity depends on
* lint
* Add a field to completed sales log in factory
* Update person 1 gender identity to depend on the people count
* Do not show buyer 2 questions if it is not a joint purchase
* Add a test to clear the voiddate for unresolved logs
* feat: add reset_voiddate method
* feat: only reset voiddate if log is unresolved
* test: check voiddate not cleared if log is resolved
* feat: remove redundant check for startdate and voiddate being non-nil
* feat: make reset_voiddate into a bang method
* test: add tests for clearing mrcdate
* feat: create reset_mcrdate! method
* refactor
* reset rent values when rent validation triggers
* refactor tests
* Test for checking that other validations aren't impacted
Co-authored-by: Sam Seed <sam.seed@softwire.com>
* CLDC-1688 Affected logs mailer
* CLDC-1688 Correct update_logs path
* CLDC-1688 Review markups
Co-authored-by: James Rose <james@jbpr.net>
Update app/controllers/schemes_controller.rb
Co-authored-by: James Rose <james@jbpr.net>
Update app/controllers/locations_controller.rb
Co-authored-by: James Rose <james@jbpr.net>
* Refactor to queue messages
* Update test
* remove irrelevant test
Co-authored-by: James Rose <james@jbpr.net>
Co-authored-by: Kat <katrina@kosiak.co.uk>
* 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
* feat: start adding scheme validation for when owning org doesn't hold stock
* feat: don't set owning_organisation = nil in validate_owning_organisation
* style: line code
* test: remove redundant test for missing owning org
* test: add test for invalid owning org id (invalid as doesn't hold stock)
* test: add test that including owning org does nothing when user is coordinator
* test: standardise missing params test descriptions in schemes_controller_spec
* test: remove owning org id from required params list for data coordinators
* test: write "support user", not just "support"
* test: fix incorrect test descriptions
* test: test validation raised when updating model with non-stock-owning org
* config: set dummy_org in seeds as holding own stock
* test: test for actual validation string, not the validation lookup
* refactor: change owning_organisation_id: organisation.id to owning_organisation: organisation
* test: move scheme params def onto 1 line
* style: move "validate :validate_owning_organisation" onto new line
* 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
* Conditionally display a correct review log text
* do not allow the aswers from previous collection windows to be changed
* does not let the user navigate to questions for previous collection year logs
* Fix tests
* Add some docs
* Extract collection period check into a before_action and change path to rails route
* update the tasklist message
* Add sorting per org
* Pull out confirmed set to null because they're also not marked as confirmed
* Create relevant tests
* Extract scopes and remove wrong test
* Mark log as impacted by deactivation when location is deactivated
* Display affected logs in the table
* Route affected logs to tenancy start date question
* Update routes to get the tenancy start date page from form
* update next_page_redirect_path
* rename column
* Fix tests
* Add next_unresolved_page_id to pages
* Update unresulved when the log is corrected
* Mark logs as unresolved when scheme gets deactivated
* display correct content when there are no unresolved logs
* mark logs resolved after the user leaves check answers page
* Display link in success banner and reset banner when the link is clicked
* display inset hint text for unresolved log questions
* Display unresolved logs banner
* update banner message
* Persist the link in the banner
* update inset text
* Update success banner text
* Add unresolved and created_by scopes
* rename method
* add unresolved_log_redirect_page_id to form + typo and route
* Add UnresolvedLogHelper and extract flack notice message
* pluralize and return early
* remove flash[:notice] = nil
* to keep it consistent for sales log
* Extract unresolved path and fix a link
* extract resolve method and fix attribute nme
* update path
* typo