* rename variables in test file
* write tests for new validations
* validate that answers to numeric questions are given to the correct level of accuracy and in normal format with only digits
* add error messages for new validations
* add or alter step on numeric questions in sales, amend one test given step changes
* copy change
* remove validation that is specific to number format and fold that functionality into accuracy validation, rejig tests accordingly
* fix various tests
* remove reference to currency in validation message that concerns step only and doesn't check whether firled is currency related
* alter copy to avoid redundant repetition in validaiton message
* save changes made in rebase
* changes after PO review
two step values had been missed in previous work
in various places there were custom validations applied that duplicated the functionality of the generic min max validation that is applied to all numeric questions, in these situations sometimes the min and max on the question class was inconsistent with the limit that triggered validations
these have been corrected and made consistent
various tests were affected by this and have been amended accordingly
* remove tests introduced by mistake in rebase
* amend step value on earnings
* write tests that invalid answers are cleared when the start date of a log is changed
* clear invalid answers when the start date of a log is changed
* correct error
* undo previous work to take new direction
* write tests to cover updated functionality of method in form to reset values when they are not routed to or when answers to radio questions are no longer valid
* update method in form to improve readability and to ensure that when the answers to radio questions are no longer valid, taht they are cleared
* add back an "end" deleted by mistake and fix a linting issue
* make some minor copy and variable name corrections
* fix a broken test after updates
* remove bulk upload tests for adding validations to unpermitted values to radio questions, these are now being cleared before validation
* fix some tests broken after rebasing
* add step to age questions in sales
* remove list of question ids from the form that should not be cleared, this information should be held on the questions themselves
* rename variables
* rename instance variable to be nice and long
* minor changes after rebase
* add in a new option for the period question and reorder existing answer options
* ensure that the lettings log calculates values correctly that relate to the period
* ensure that depends on conditions related to period take account of the new option
relatedly create methods on LettingsLog to allow improved readability in these depends on conditions
refactor depends on conditions with these new method
* update the 22_23 json form to use the new option as well
* update tests to cover deriving variables that depend on period
update test fixture to allow this
* refactor some depends on and amend LEttingsLog method to improve readability
* remove forgotten focus in spec file found in linting check
* amend context descriptino in new tests
* refactor a couple more depends on for readability
* rename variables in test file
* write tests for new validations
* validate that answers to numeric questions are given to the correct level of accuracy and in normal format with only digits
* add error messages for new validations
* add or alter step on numeric questions in sales, amend one test given step changes
* copy change
* remove validation that is specific to number format and fold that functionality into accuracy validation, rejig tests accordingly
* fix various tests
* remove reference to currency in validation message that concerns step only and doesn't check whether firled is currency related
* alter copy to avoid redundant repetition in validaiton message
* save changes made in rebase
* changes after PO review
two step values had been missed in previous work
in various places there were custom validations applied that duplicated the functionality of the generic min max validation that is applied to all numeric questions, in these situations sometimes the min and max on the question class was inconsistent with the limit that triggered validations
these have been corrected and made consistent
various tests were affected by this and have been amended accordingly
* remove tests introduced by mistake in rebase
* feat: add void date guidance partial
* feat: set guidance pos bottom for 22/23 log
* feat: add tests
* refactor: linting
* Update app/models/form/question.rb
Co-authored-by: Phil Lee <asmega@users.noreply.github.com>
* feat: smart quotes
* feat: respond to po comments
* feat: add voiddate/mrcdate validation to mrcdate too
* feat: add ten year validations to startdate too
* feat: fix tests
---------
Co-authored-by: Phil Lee <asmega@users.noreply.github.com>
* Add carehome charges value check field
* Add carehome charges soft validation to 23/24 forms
* Update care_home_charge_expected_not_provided?
* Add care_home_charges_value_check to 22/23
* Update csv
* Add care_home_charges_value_check to 21/22 form
* Update import to set value_chech to yes
* add some methods on lettings log and use them and already existing methods to make depends on human readbale for pages in property information subsection
* reformat answer options for neatness
* ensure that property information subsection is conditionally not shown under correct conditions
* amend method to find the path for the next question to answer so that if no questions in the next section are currently routed to, it goes to the section after that
* make amendments for failing test and linting
* remove unnecessary method
* remove unnecessary conditions from depends on, the displayed in tasklist method override is sufficient
* test the change to the method creating a link to the next subsection
* minor refactor to displayed_is_tasklist condition and changes in testing
* implement the fix on 22/23 form also
* write a test covering the fix
* removal not_renewal? method and tweak depends on for all pages using that method
* linty fluff begone
* correct some errors in tests after changes to factories
* minor testing amendments after rebase
* feat: skip fixed term tenancy length question when tenancy is other
* CLDC-2006 Add 23/24 collection year LAs (#1392)
* Update LAs for 23/24 sales questions
* Update LAs for 23/24 lettings questions
* Update LAs for 23/24 location
* Remove redundant assignments
* Update question files to use the local authorities from db
* Update locations to use local authorities from db
* Rebase changes
* Replace hardcoded date
* Add PaperTrail to OrganisationRelationship (#1406)
* CLDC-1838 update copy for both offered questions (#1401)
* ensure copy is changed for both questions relating to how many times a property has been offered
extract to en.yml so that both questions keep identical copy in the future
* minor typo caught in code review
* copy change for LA (#1407)
* CLDC-1997 Infer new LAs for post 2023 logs (#1398)
* Infer new LAs after year 2023
* Test
* Run CSV export before XML export to CDS (#1393)
- The XML export mutates the `LogsExport` table which determines the period in which logs are exported.
- The CSV export does not change this table, so if the CSV gets ran at the same time as the XML log it could skip records.
* CLDC-1998 Correctly infer 22/23 las if a NEW one is returned by postcodes.io (#1397)
* feat: correctly infer las for 22/23 logs
* feat: copy changes to sales log
* feat: don't reset las when clash with postcode to make tests pass
* feat: align with similar PR for 23/24
* feat: tidying and add test
* refactor: lint
* refactor: use unless
* CLDC-1919 Add 23/24 rent ranges (#1405)
* feat: add 23/24 rent ranges csv
* fix: use new 2023/24 rent ranges after duplicates removed
* test: update seeds test to use new rent ranges count
* fix: resave 2023 CSV as not UTF-8 (#1411)
* CLDC-1820 Update reason for leaving domestic abuse answer options (non-renewal only) (#1391)
* feat: change domestic abuse answer opts
* test: add test for reason question
* CLDC-1808 add previous tenure question for buyer two (#1354)
* create and run migration for new columns related to buyer two previous tenure
* a little refactoring for readability
* create new pages, questions, associated tests and a couple of boolean methods on sales log for depends_on readability
* add new pages to subsection and amend tests to reflect this change
* make new pages only visible for new collection year, rename filesamend tests
* some copy changes and alterations of readability after code review
* CLDC-1816 add hint text to tenancy type options (#1341)
* add hint text to several options on tenancy type, rename question class and a few others to make them pascal case and write test files for all changed questions
* update some depends on for readability and write test files for page classes
* change the condition to avoid conflicts with 2034 and cover that ticket in this one
* also add hints to other tenancy question
* add new answer options to nationality, rename question, write test file (#1339)
* CLDC-2014 remove text field for buyer 1 nationality other (#1388)
* remove question no longer needed and associated test file
* amend page and the other question in that page that determined whether the deleted question should be shown
update associated test files
* createa a migration to remove the column for the deleted question
* update test broken by changes
* fix test broken by changes
* CLDC-1886 Add sales paper form download (#1408)
* Add sales paper form download
* Rename download path
* Add 22/23 sales log download
* Update lettings log form download (#1409)
* Run tests in parallel (#1412)
* Run tests in parallel
* Failing test
* Add parallel tests to prod pipeline
* Remove failing test
* Add PARALLEL_TEST_PROCESSORS env var
* CLDC-1925 ask for buyer 2 nationality when joint purchase (#1390)
* create migration for new column
* create page class and add to household characteristics
* create question for buyer 2 nationality and associated test file
* fix failing test after added page
* rename method after code review
* add question number for the new question to allow CLDC-1864 to progress with fewer conflicts/complications
* fix: get real validation messages for rent range validations (#1413)
* CLDC-1826 lettings log codes only download (#1268)
* update seeds to add self in review env, change spec to reflect this, update config yml to allow csv exports in review
* update interface of relevant methods
EmailCsvJob, LettingsLog.to_csv and LettingsLogCsvService consume codes_only flag
* update tests including adding a new csv file to test against
* update LettingsLogCsvService to output codes only csv
* correct minor error and linting
* enable codes only download in UI
- add link on lettings log index page
- pass codes_only flag through params in relevant links and methods
- convert flag to boolean in controller methods
* ensure link displayed successfully for all renderings of logs_list and params passed through relevant methods in organisations controller
* fix existing tests
* correct linting thing
* correct linting error
* update tests for lettings log controller
* correct linting errors
* update organisations controller tests
* make minor changes after code review
* remove changes made for testing on review app
* make codes only download visible to support users only
* change variable names throughout after info on rauby/rails naming conventions, update tests for change in who can view codes only download link
* rework csv service for readability, remove delegating methods from lettings log to keep all code to do with mapping between our domain and desired export format in one place
* update test name
* correct a small typo and remove a duplicated method after clever git merge conflict suggestion
* point review app at staging csv bucket for csv download
* change variables named codes_only_export to codes_only to avoid inconsistency
* write tests to ensure that differetn user roles have the correct permissions around csv download
* ensure that non support users may not download codes only exports
* correct a small error in a previous commit
* correct minor linting error
* Make tests less dependant (#1415)
* Seed the test db before tests and reset forms after tests
* Update rails
* Remove redundant FormHandler reinitialise
---------
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Co-authored-by: James Rose <james@jbpr.net>
Co-authored-by: Arthur Campbell <51094020+arfacamble@users.noreply.github.com>
Co-authored-by: Phil Lee <asmega@users.noreply.github.com>
Co-authored-by: SamSeed-Softwire <63662292+SamSeed-Softwire@users.noreply.github.com>
* 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
* 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>
* 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>
* Add an organisation question for the support user (WIP)
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* All the things are green
* Add user question
* Restrict shown answer options based on already answered questions
* Derive managing org
* Guard against missing DB connection
* Remove empty file
* Only select the fields we actually need
* All is redundant
* Fix spec description
* Fix comments
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>