* add a validation to prevent an inconsistent combination of values and tests for this validation
* show related method in diff
* remove comment
* extract reusable logic from SalesLogVariables to independent module
* update lettings log tests around derivations related to renewal
* refactor derivation logic to share functionality with sales logs where possible
* remove some tests which are now duplicated above, refactor tests using Jack's wonderful :change suggestion, add in tests about logic deriving vacdays that was not previously covered
* minor changes after tech review
* Add new organisation address fields to merge requests
* Add new organisation address page
* Add new organisation telephone number placeholder page
* close the div
* Add new organisation name column
* Update new organisation name page
* Refactor validate_response
* Add placeholder new_organisation_address page
* Add existing organisation name validation
* Refactor error messages
* Extract some validations to the model
* Update which field we add the errors to
* add several methods to the sales log to allow subsequent work to be human readable
* add a validation to prevent an inconsistent combination of values and tests for this validation
* handle derivation of values around buyers living in the property
- derive values where appropriate
- clear these values when the derived state no longer holds
- update the routing for pages holding questions about whether particular buyers will live in the property to reflect when they are derived
- test the deriving and associated clearing of values
- update tests on page routing and sales log factory
* update a page routing condition for human readability using an existing method and update test to reflect this change
* show related method in diff
* minor amendments after tech review
* simplify reset_derived_questions after tech review
* refactor on deriving and clearing invalid derived values on sales log
* correct linter complaints
* remove comment
* add validation to one more field with a new error message as it is in fact possible to tirgger the validation in the setup section
* CLDC-2056 Add absorbing organisation question
* Handle next page and previous_template with `page`
* Hardcode backlinks
* Refactor flow to store value when selecting new org option
* Handle unanswered question
* Update error copy
* feat: add validation for number of field labels
* feat: check field labels are numbers
* feat: remove validations for number of columns
* refactor: rename non_blank_fields_count to valid_field_numbers_count
* test: add functions to generate custom field labels/values
* test: that extra invalid field labels don't cause issues
* test: that removing a valid field label reduces count by 1
* test: that adding a valid field label increases count by 1
* refactor: rename validate_fields_count and wrong_field_count
* feat: add validation that max col count not exceeded when no headers
* fix: convert numbers to strings in default_field_numbers
* feat: add leniency to max cols count (in case of 1 extra col)
* test: explicitly set year of bulk upload to be 2022
* test: add/update tests in validator_spec
* chore: lint
* test: remove tests from csv_parser_spec that were moved to validator_spec
* feat: update 2022 csv_parser to work with new validations
* refactor: define number of valid 2022 fields in one place
* refactor: remove redundant headers definition
* feat: update 2022 csv parser to have col flexibility like 2023
* test: for validator 2022 as well as 2023
* test: simplify 2022/2023 logic and improve layout
* chore: lint
* test: ensure context descriptions start with "when"
* refactor: check fields/columns count within csv parser, not validator
* test: update 2022 csv parser tests to work like 2023
* chore: lint
* 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
* Create merge_request table and paths
* Save merging organisations wip
* Add update organisations
* Add merging organisations validation
* merge fixes
* Update schema to have merge_request_organisations
* Add relationships between merge request and organisations
* Update validations and saving organisations
* Add ability to remove merging orgs from the list
* Allow support users to create merge request for any organisation
* Update wording in organisations view
* Allow adding other merging organisations
* Add back button, update content
* Add validation if the organisation is not selected
* Fix path
* Use generic update method
* Update validations
* fix remove organisation
* remove reloads
* Update routes
* Authenticate scope
* PR review changes
* Add status, run validations unless the status is unsubmitted and save requesting organisation as a merging organisation as well
* PR comments
* Display continue button when there are at least 2 merging organisations
* 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
# Context
- https://digital.dclg.gov.uk/jira/browse/CLDC-2279
# Changes
- split bulk upload feature toggle by log type ie lettings and sales
- this allows us to toggle with finer granularity
- moved `FeatureToggle` from initializer to service class. not sure why it was an initializer in the first place? this means its available to zeitwerk and will be reloaded when needed
* feat: update scheme status so incomplete unless has active locations
* feat: update scheme typeahead text
* feat: reject incomplete locations
* feat: show completed/incomplete locations and validate when completed == 0
* feat: improve copy
* feat: change active -> completed
* feat: update scheme typeahead text
* feat: reject incomplete locations
* feat: show completed/incomplete locations and validate when completed == 0
* feat: improve copy
* feat: change to confirmed to add clarification in code
* feat: update scheme typeahead text
* feat: reject incomplete locations
* feat: show completed/incomplete locations and validate when completed == 0
* feat: improve copy
* feat: update scheme typeahead text
* feat: reject incomplete locations
* feat: only confirm locations if complete (old) AND save button clicked (new)
* feat: add unconfirmed scope
* refactor: complete -> confirm
* feat: fix tests
* feat: update scheme typeahead text
* feat: reject incomplete locations
* feat: show completed/incomplete locations and validate when completed == 0
* feat: improve copy
* feat: update scheme typeahead text
* feat: reject incomplete locations
* feat: only confirm locations if complete (old) AND save button clicked (new)
* feat: add unconfirmed scope
* refactor: complete -> confirm
* feat: fix tests
* feat: fix more tests
* feat: fix more tests
* refactor: rubocop
* refactor: rubocop
* refactor: rubocop
* feat: add tests for incomplete schemes
* refactor: linting
* feat: test incomplete count too
* feat: test unconfirmed locations aren't options in location_id
* feat: test validation
* feat: test when scheme is confirmed
* feat: test when scheme is confirmed for support user
* feat: test when location is confirmed
* refactor: linting
* refactor: consistent use of factorybot or not within a file
* feat: confirm locations when complete even if save button not clicked, and update tests
* refactor: simplify
* refactor: simplify
* refactor: move location helper methods to helpers
* refactor: move scheme helper methods to helpers
* refactor: formatting
* refactor: po response
* refactor: review response
* 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
* Move and rename some tests
* Add a merge organisation link
* Add merge page
* Don't display a second nav bar for support
* Fix spacing
* fix spacing and typos
* Allow interruption screens to format money values
* Remove formatting from saleslog method
* Use money flag
* Use pre exhisting method to format values
* Update config/locales/en.yml
Co-authored-by: Arthur Campbell <51094020+arfacamble@users.noreply.github.com>
---------
Co-authored-by: Arthur Campbell <51094020+arfacamble@users.noreply.github.com>
* Format errors on money amounts with 2 decimals
* CLDC-1975 Format money input and error messages
* format discounted_ownership_value
* Format more locales
* Update lettings_log tests
* Fix import service spec
* create method to test whether we are currently in the crossover period and associated tests
* update copy, use method for testing whether we are in the crossover period, remove focus from test file
* reuse existing method to determine whether we are in a collection period
* use the existing method and update validations
* fix test broken by changes
* update location in same way as scheme
* create method on FormHandler that finds the start date of the earliest collection period
* ensure that default deactivation and reactivation dates also reflect the changes
* create tests for the new validations
* lint correction
* minor copy change
* minor logic change
* amend naming error after rebase conflict
remove test that is no longer correct after change on another branch to functionality
update a test after a copy change
* add first page for bulk upload resume journey
* bulk upload resume handles upload again
* add confirm page to bulk upload resume journey
* replace placeholder count with correct value
* apply recommendation for bulk upload resume choice
* add how to fix bulk upload mailer
* integrate new bulk upload approve journey
* add missing bulk upload error mappings
* remove test
* prevent approve being called multiple times
* bulk upload creates invisible logs ahead of time
* work invisible logs into bulk upload flow
* sort errors so deterministic
* remove unused ensure
* remove expected_log_count and processed
- these fields are no longer used or needed
* introduce pending status
* swap visible for pending logs
* only show visible lettings logs
* hard code status filters
* remove unused model methods
* only show visible sales logs
* form controller ignores hidden logs
* locations and schemes only affect visible logs
* add a validation against the case where monthly leashold charges are zero, test this, remove unnecessary validation on cash discount as this is covered by validate_numeric_min_max
* remove focus: true from describe block
* minor changes for testing and linting
* correct minor bug found in PO
* make minor amendments to failing tests
* 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>
* Clear import fields failing non_temp_accommodation validation
* Clear joint tenancy if there is only 1 person in the household
* Clear offered if the value is above the maximum of 20
* Display error message on ecstat
* Remove ecstat if the income is too high for it
* Update service charge validations
* Create location deactivation periods instead of setting a scheme end date
* Add test for deactivation period
* Update ranges in tests
* Remove scheme validation test
* Check that the location gets confirmed
---------
Co-authored-by: Kat <katrina@kosiak.co.uk>
* add method to sales log and use in depends on to increase readability
* increase minimum allowed value for mortgage
* write tests and add validation error to config for new validation
* write validation
* adjust validation so it doesn't trigger when mortgage value is derived as 0
* correct linting problem and update tests to account for change in validation
* 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