* 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
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* implement soft validation of grant value
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* fix rebase conflicts
* fix final test from added page
* update test after rebase
* 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
* test: check managing org not gone from answer opts when relationship deleted
* feat: add current managing org to answer opts
* feat: check if managing org exists before trying to show it
* wip
* test: improve managing orgs opts test when not support
* test: improve managing orgs opts tests when support
* test: make relationship deletion test consistent with other tests
* test: add "(with hint)" to managing org opts test descriptions
* test: refactor managing orgs opts tests for support user case
* fix: don't call user in get_answer_label in CYA component
* style: reorder instance vars and remove old comments in managing_organisation.rb
* refactor: ensure label_from_value always accepts log & nil as args
* lint
* test: pass in log and user in housing provider opts test for support user
* test: update housing provider opts tests for non-support user
* feat: update housing provider answer opts to include current HP in db
* style: add space after user definition
* test: make context definition more human-readable
* test: refactor housing providers opts tests (not support user)
* test: check housing prov. still selectable after deleting relationship
* fix: define log and current_user instance vars in label_from_value (housing prov.)
* lint
* test: update lettings log feature tests
to differentiate between different numbers of stock owners when acting as a data coordinator
* test: check owning & managing orgs set correctly when a log is created
* test: add line breaks and start context descriptions with and (not if)
* test: artificially reference org_rel2 to avoid lint offense
* feat: don't set log owning org as user's org if that org doesn't hold stock
* test: improve test context descriptions in lettings_log_spec
* test: finish overhauling owning and managing org tests in lettings_log_spec
* test: change let! to let where possible in spec/features/lettings_log_spec.rb
* test: change let! to let where possible in spec/models/form/lettings/questions/managing_organisation_spec.rb
* test: change let! to let where possible in spec/models/form/lettings/questions/stock_owner_spec.rb
* test: remove if statement from "coordinator user's org doesn't hold stock" managing org test
* test: remove if statement from "coordinator user's org does hold stock" no managing orgs managing org test
* test: remove if statement from "coordinator user's org does hold stock" >=1 managing orgs managing org test
plus refactor previous test
* test: explicitly reference org rels in "coordinator user's org doesn't hold stock" managing org test
* test: don't create vars inside other vars (for tests edited/created in this branch)
* chore: save schema changes after migration
Co-authored-by: Phil Lee <asmega@users.noreply.github.com>
* add class to create logs from bulk upload
* create logs when processing bulk uploads
* remove bulk_upload_id from csv output
* create bulk upload logs only if all valid
- this will be changed later to allow for partial logs
- and only to create logs when a threshold has been met
* add method to blank invalid non setup fields
* bulk upload log creation blanks invalid fields
* fix incorrect logic for bulk upload renewal
* fix linting
* bulk upload log creation fail logs to sentry
* fix bulk upload line ending parsing
* extract bulk uploading csv parsing to class
* use csv parser in log creator
* change handle line endings mechanism
- we now strip all windows line endings for unix based line endings
- this normalises things making it simpler
* 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
* Add derived household fields
* Derive household variables for sales logs
* Refactor and fix wrong test names
* Count everyone under 20 as children if relationship is "C"
* Route to mortagage questions only if mortgage is used
* Fix tests for deposit derived var
* more routing
* Only display mortgage lender questions if mortgage is used
* Add postcode fields
* Add postcode page and questions
* Add postcode page to the property information subsection
* Only display local authority question if the la is not inferred
* Fix migration
* Move postcode validation
* Infer LA fields from postcode
* infer partial postcodes
* Allow filtering by organisation if organisation has managing agents
* update test name
* Displayed owned/managed by in the logs list if the org has managing agents
* lockdown bulk upload routes
* able to view lettings bulk upload errors
* add error count to bulk upload results
* coverage for bulk upload filename on results
* group bulk upload errors by row on results
* able to view bulk upload sales results
* scope lettings and sales bulk upload results
* fix linting
* call service correctly in test
* add bulk upload sales questions mapping
* appease linter
* bulk upload error shows correct question
- depending on log type it will show relevant question for the field
concerned
* use local disk for bulk upload for dev env
- this saves the need to connect to S3 to play with bulk upload in dev
environment
* improve namespacing of classes
* add job to process bulk uploads
* use local disk storage for dev file upload
* fix test
* use inline active job queue_adapter for dev
* use test active job queue adapter for test env
* remove rubocop violation
* delete bulk upload from disk after processing
* populate errors with cell, row + metadata
* update error message with something meaningful
* shim in sales validator
* able to parse sales bulk uploads
* change migration to add purchase_code to errors
* bulk upload error component renders purchaser code
- when a sales log
* populate purchaser_code for bulk upload errors
- when log type is sales
* remove superfluous private method
* Add fromprop field to the sales log
* Fix gender identity typo
* Add previous property type page and questions
* Add previous property type to the shared ownership section