* CLDC-853 Added hard validations for sales income2
* CLDC-853 Added soft validation for sales income2
* CLDC-853 Fix tests broken by new code
* CLDC-853 Add new tests for new page and refactor slightly
* CLDC-853 Fix linting errors
* CLDC-853 Rename migration and update schema version
* CLDC-853 Fix broken sales income2 test
* CLDC-853 Rename migration
* CLDC-853 Move income 2 to cya card 2 and commonise combined income validation
* CLDC-853 Actually use the validate_combined_income method
* combine duplicate methods after rebase, ensure hard validations are triggered on all relevant fields
* move validation on child income to financial validations to stop it being triggered on lettings logs, minor amendments to tests broken by changes
* revamp financial validations tests against income to reflect updates
* amend child income validation to reflect specifications and write tests to cover this validation
* correct linting errors and play a little code golf
* change copy for some validations, add sales log method and amend interruption screen helper to support this
* extract duplicate code to private method
* update buyer 1 and 2 income value check to be consistent
* remove ecstat from income checks, the only ecstat we care about is child which is dealt with elsewhere
* rename constant struct with same anme as existing variable
* amend tests to reflect the chagnes in validations and copy
* enable currency formatting of numbers for inserting into informative_text or title_text
* update evil test in form handler spec
* rebase and fix conflicts and tests
* change a variable name and correct minor rebase errors
* update interruption screen helper tests
* correct linting errors, minor test failure and typo
* add tests for new sales log method for formatting currency
* fix merge conflicts
---------
Co-authored-by: Arthur Campbell <arfa.camble@gmail.com>
* bulk upload considers housing needs fields
* bulk upload only permits one housing needs type
* add bulk upload validation
- no disabled needs cannot be selected in conjunction with a disabled need
* add bulk upload validation
- dont know disabled needs cannot be selected in conjunction with a disabled need
* add bulk upload validation
- no and don't know disabled access needs cannot be selected together
* feat: add sales validation to check bedsits have <=1 beds
* test: sales validation to check bedsits have <=1 beds
* fix: typo in property validation method name
* feat: add same bedsit validation to number of bedrooms question
* test: fix typo propert -> property in property validations tests
* test: add test for validate_property_number_of_bedrooms (sales)
* feat: update wording for 'number of bedrooms' validation when bedsit
* test: condense sales property validations tests
* test: strengthen sales property validations error addition test
* refactor: simplify sales property validations into one method
* fix: update error message content to match Beth's choices
* chore: lint
* test: add requests test for invalid sales log params when posting
* refactor: use if rather than unless... not in property validation
* refactor: write method is_bedsit? on SalesLog
* test: check bedsit error not added if proptype or beds is nil
* lint: use update! not update
* feat: update validation messages to improve readability
* fix: provide valid date in request test for invalid proptype/beds
* feat: make is_bedsit and validate_bedsit_number_of_beds more readable
* Schedule data export tasks in sidekiq-cron
- Split combined XML and CSV data jobs into seperate background jobs
- Add sidekiq-cron to the project
- Schedule new XML and CSV jobs to run every day at 5am
- Adjust data export Rake tasks to use new job
* Add specs for DataExport{Xml,Csv}Job
* x
* Run bundle install
* Change review app export bucket name
---------
Co-authored-by: Kat <katrina@kosiak.co.uk>
* Add next years form to the form handler
* Disable collection window validation in non prod/test
* fix the years in the correct file
* Undo year bulk upload change
* initialise missing forms using the new format, disable 14 days validation on non production
* Use only current and previous forms where needed
* refactor
* Refactor
* Remove startdate collection window validation from non production
* feat: add 22/23 year validation
* feat: wip commit
* feat: update i18n
* feat: add one year gap exchange/completion validations
* tests: add tests for new validations
* test: add setup validations tests
* test: update factory to pass saledate validation
* feat: update seeds
* feat: update tests to reflect sales logs shouldn't exist in new service before 2022
* feat: merge with main, improve date behaviour
* refactor: cleanup
* feat: update tests
* feat: enforce saledate not after 22/23 collection year end
* feat: check date is valid
* feat: add hodate/saledate hard validation to saledate as well
* feat: add HandoverDate check to saledate question
* test: update
* db: update
* test: update
* feat: wip po updates
* feat: add soft_validation to setup
* feat: fix bug by making sale date soft validation optional
* feat: add tests
* test: update
* refactor: linting
* remove duplicate bulk validations
- validation was being performed both at CSV level and log level causing
a duplicate validation to appear
* bulk upload valiation errors now store the message
- previouly this was storing just the error type which we do not have a
mechanism to pipe these back to user readable error messages
* replace range validation with multiple to account for single-ended ranges
* add test for question with min but no max
* add min and max to household count question and remove bespoke validation. Remove code allowing max and no min given this situation does not seem to exist int eh form
* amend minor typo, add back a soft validation that had mysteriously gone missing
* Display the correct error for privacy notice and display the partial guidance at the top by default
* Always display privacy notice question
* Disable the rest of the housing characteristics questions until privacynotice is answered
* fix tests
* remove duplicate field
* Display the household questions if the buyers were not interviewed
* Add monthly_charges_value_check field to sales
* Add monthly_charges_over_soft_max soft validation
* Add monthly_charges_value_check page and question
* Add monthly_charges_value_check pages to the relevant subsections
* Fix optional field name, add validation message
* test
* change percent to % so that suffix is consistent with other similar questions
* fix rebase conflicts
* add hard validation that percentage owned after a staircasing transaction cannot be less than the percentage bought in that transaction, with associated tests
* add compound validation to ensure that logs of type older person shared ownership may not have a stairbought value of greater than 75% \n associated tests included
* remove duplicate method and use existing version
* fix rebase conflicts
* ensure schema correct and test of page number correct
* fix form handler test after rebase
* fix tests and ensure schema correct after rebase
* feat: add 22/23 year validation
* feat: wip commit
* feat: update i18n
* feat: add one year gap exchange/completion validations
* tests: add tests for new validations
* test: add setup validations tests
* test: update factory to pass saledate validation
* feat: update seeds
* feat: update tests to reflect sales logs shouldn't exist in new service before 2022
* feat: merge with main, improve date behaviour
* refactor: cleanup
* feat: update tests
* feat: enforce saledate not after 22/23 collection year end
* Add old_persons_shared_ownership_value_check to sales table
* Move hard validation method to soft validation
* Add old persons shared ownership value check page and question
* Add pages to the household characteristics
* Add soft validation after ownership type
* update a test
* make old_persons_shared_ownership_value_check optional because it's in the setup section
* typo
* 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
* refactor with extract method
* can filter logs by bulk upload
* hide log creation button when viewing bulk upload
- this affects the logs index page filtering logs from a specific bulk
upload
* add info banner to bulk upload logs
* placeholder for bulk upload logs header
* when resuming bulk upload set filters
* fill place holder with remaining logs to fix
* add interstitial to resume if logs resolved
* after resolving bulk upload logs show interstitial
* fix linting error
* extract view variable to helper method
- The hard max values for rent ranges in 2022 are too conservative and it blocks logs from being migrated from old CORE.
- We can replace this file with correct value as re-run `Imports::RentRangesService` to upsert the existing values.
* 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 min and max to age2 + questions
* validate that under 16s are economic children
* Update factory
* Update test
* Update ecstat, relationship and age validation
* 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