* 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
* Change enabled? subsection method to check depends on using log questions and methods instead of a subsection status
* Update sales subsections
* Update rent validation tests to check all the affected fields
* Update setup_completed? to check all the setup sections
* feat: add 2022 rent range data, update rake task for population of this
* feat: change file format so ranges_rent_id is recognised
* feat: add updated error messages and casing
* tests: make tests pass
* feat: ensure there is a location_code in all locations and use this (and beds = 0) for supported housing rent validations
* feat: fix general needs validation behaviour
* feat: add local authorities enum to location.rb
* feat: ensure case when beds > 4 is accounted for
* feat: add error messages on property postcode page as well as la page
* feat: add error messages on scheme_id and location_id as well as la page
* feat: add error messages on scheme_id and location_id as well as la page
* feat: null coalescing and validations on changing las to one that invalidates rent in supported housing
* feat: nil protection
* refactor: linting
* refactor: combining duplicated logic
* tests: add hard validation tests split by needstype
* feat: update validations when beds > 4
* feat: update validations when beds > 4
* refactor: simplification, use preivous la method
* refactor: response to PR comments, fixing beds.negative validation
* feat: remove dynamic local auth name text from interruption screens - to be added back in later if this becomes a priority, would need some work on adding local auth name to log for supported housing logs not just leaving it in the location
Previous to this change, the `reservist` field mapped `0` to yes and `1` to no. This change adjusts the mapping from `1` to yes, `2` to no, and `3` to prefer not to say.
* feat: core functionality
* feat: update schema.rb
* feat: add link for privacy notice, refactor to separate tenant/buyer
* feat: make privacy notices open in new tab
* test: make previous tests pass
* test: add new tests
* wip
* add missing values to factory bot and lint
* remove irrelevand methods
* dont infer housingneeds
* typo
* update method name
* Remove housingneeds_present? method
* move set housing needs fields to case log variables file
* Only set all housing needs values to 1 if there are no housingneeds
* update json form fixture
* link
* update csv test
Co-authored-by: Dushan Despotovic <dushan@madetech.com>
* Change property major repairs date validation from 2 years to 10
* add voiddate_date_in_soft_range? and major_repairs_date_in_soft_range? methods
* update error messages for hard validations
* Add property_major_repairs_value_check to the form
* add void_date_value_check and fix some namings
* Update value_check hidden in check answers to depend on whether the questions is answered
* Remove a schema key
* extract constants for number of days
* change error messages wording
* update schema and csv files
* Reset wchair when needstype changes from supported housing to not supported housing
Co-authored-by: James Rose <jamesrose@users.noreply.github.com>
* remove location_id if scheme needstype changes to general needs
* only hide postcode known question from check your answers if it's answered
Co-authored-by: James Rose <jamesrose@users.noreply.github.com>
* infer case_log values from schemes
* only display relevant property information questions
* Add unittype_sh column
* Display the correct number of completed sections
* fix schema and migration
* Fix test failing in CI
This test was failing due to some different between UTC and BST time as the
record from the DB comes back with a UTC timezone. Comparing the integer values
of both will ensure that both timestamps are identical and should fix the
issue in the CI where it thinks the values are different
* only run query for scheme locations size once
Co-authored-by: Dushan <dushan@madetech.com>
* extract TYPE_OF_UNIT_MAP
* lint
* Use find insted of select
Co-authored-by: Dushan Despotovic <dushan@madetech.com>
* Make the needs type question available in non-prod environments
Co-authored-by: Ted-U <Ted-U@users.noreply.github.com>
* lint fixes
* fixes based on review
* add hint text
Co-authored-by: Ted-U <Ted-U@users.noreply.github.com>
* Refactor depends on in the form json to specify the object for the dependency
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Remove org section
* Enable user based depends on
* Add question
* Question is derived
* Log debug message when values get auto cleared
* Enable answer options to be created from a model lookup
* Make organisation fields optional since they won't immediately have one when created by support users
* Add question to check answers page
* 22/23 fix
* Rubocop
* Spec check answers label lookup
* Only set managing organisation if not already set
* Bump deps
* Rescue lack of database connection for CI
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Refactor depends on in the form json to specify the object for the dependency
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Refactor depends_on_met method to execcute methods on given objects
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Remove org section
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Major repairs question should be valid if void date question is
* Add task to reimport major repairs answers
* Correct error message string
* Add logging
* Spec logging
* update hard validation limits for pregnancy age, remove hard validation if there are no females at all
* Add soft validations for pregnancy
* make the error message consistent
* Only check the values for the members with details known in the household
* Show interruption screen when resident details are updated
* Route back to check answers after an interruption screen and back to previous page if no is selected on the interruption screen
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* update validation messages
* fix a test
* fix a typo
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Make tshortfall optional based on hidden tshortfall_known question
* Add test for optional
* Add test for JSON derived and dependent on false options
* Test routing
* Fix optionality