* 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
* able to view lettings bulk upload errors
* 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
* improve namespacing of classes
* add job to process bulk uploads
* move validation from parser to model
* add validations for field_1
* add validation for field_4
* pending tests for field_4
* convert field_mapping to array of hashes
* validate nulls based on form question
* actually load forms when toggling between forms
* validate null for startdate
* row parser has access to bulk upload
* csv upload validates first form section
* add postcode validation
* Refactor error mappings for row parser
* Add unittype question
* Fix null error setting and add builtype
* add wchair to bulk upload
* Add beds to bulk upload
* Add joint to bulk upload
* Add startertenancy to the bulk upload
* Add tenancy for bulk upload
* Add declaration to the bulk upload
* Add age1 and age1_known to bulk upload
* add ages to bulk upload
* add sex1 to bulk upload
* add ethnic_group and ethnic to bulk upload
* add national to bulk upload
* add ecstat1 to bulk upload
* add military related fields to bulk upload
* add preg_occ to bulk upload
* add housingneeds to bulk upload
* add illness to bulk upload
* add layear to bulk upload
* add waityear to bulk upload
* add reason to bulk upload
* add prevten to bulk upload
* add homeless to bulk upload
* add previous postcode to bulk upload
* add reasonable preferences to bulk upload
* add allocations system to bulk upload
* add referral to bulk upload
* add net_income_known to bulk upload
* add hb to bulk upload
* add benefits to bulk upload
* add rent fields to bulk upload
* add hhmemb to bulk upload
* use 2022 csv fixtures for bulk upload
* fix renewal mapping for bulk upload
* placeholder test for bulk upload validation
* fix bulk upload mapping for homeless field
* fix leftreg mapping for bulk upload
* fix user associations in bulk upload tests
* add gender fields for bulk upload
* add ecstatN fields to bulk upload
* add #relatN fields to bulk upload
* extract old_visible_id in factory to trait
* map net_income_known correctly for bulk upload
* fix income bugs for bulk upload
* add unitletas to bulk upload
* add #rsnvac to bulk upload
* add #sheltered to bulk upload
* add illness fields to bulk upload
* add #irproduct_other to bulk upload
* infer renewal from rsnvac for bulk upload
* add #tenancyother to bulk upload
* add #tenancylength to bulk upload
* bulk upload earnings accepts pennies but rounds
* add #reasonother to bulk upload
* fix mapping of #ppcodenk for bulk upload
* add #household_charge to bulk upload
* add #chcharge to bulk upload
* add #tcharge to bulk upload
* add #supcharg to bulk upload
* add pscharge to bulk upload
* add #scharge to bulk upload
* use case statement for bulk upload allocation
* add offered to bulk upload
* add propcode to bulk upload
* add major repair fields to bulk upload
* add #voiddate to bulk upload
* support YY year format for bulk upload
* test postcode strips whitespace for bulk upload
* add #la to bulk upload
* add previous la to bulk upload
* fix failing test
* remove duplicate line from rebase
* add first time social housing to bulk upload
* make methods private
* fix field_4 validation for bulk upload
- the null check was inverted by mistake
Co-authored-by: Kat <katrina@kosiak.co.uk>
* 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
* feat: add gender identity questions for all 4 people, combine into single page/question
* feat: update schema and add tests
* tests: update tests
* feat: update to main
* feat: update db and test