* 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 a new option to sheltered accommodation question
rename page for readability
create test files for relevant page and question'
* correct lint error
* add new options to prevten question, rename question, create test files for both previous tenure questions
* reorder as per feedback from UX team
* correct minor linting issue
* create tests for pages
* add option to renewal question as well after discussion with Rachel
* amend copy of hint text
* update test to reflect copy change
* display hint text on age question if that person is a child
* updates from code review
* update tests to reflect changes in class interfaces for page and question
* amend wheelchair question class name, tweak depends on for readability, add test file
* add test file for page
* remove unnecessary variable declaration in test file
* Spike for generating form
* Add remaining field mappings
* Add question attributes conditionally
* Display page attributes conditionally
* update subsection formatting
* Update section formatting
* fix generator
* Fix generator
* Update the form handler and form to create post 2021 forms programatically
* Initially generated and linted form
* Cover lettings sections and subsections wiht tests
* Cover age pages and questions with tests
* Add reusable age questions and adjust the tests
* Add a generic person age page using generic questions and adjust specs
* Multiline arrays in subsections
* Use generic person age page in household characteristics and remove unused pages/questions
* Combine and reduce tests
* Backfill duplicate rsnvac question
* Backfill repeating question
* Backfill repeating voiddate
* Backfill repeating tenancy question
* Backfill ethnic questions
* Backfill reason question
* Backfill prevten question
* Backfill referral questions
* Backfill chcharges questions
* Backfill brent questions
* Backfill scharge
* Backfill pscharge
* Backfill supcharg
* Backfill tcharge
* Backfill retirement value check question
* Make person known questions generic
* Make person gender identity questions generic
* Make relationship questions generic
* Make working situation questions generic
* make retirement check generic
* make pregnant household check generic
* Make pregnancy value checks generic, again
* Undo for and form handler changes
* Remove generate form task and service
* Remove empty headers, descriptions and initializers from pages
* Fix tests
* 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>
* Validate that the user belongs to either the managing or owning organisation
* do not reset created_by and remove user_organisation_chosen?
* Do not default managing organisation to owning organisation
* validate user belongs to organisation
* update tests to specify created_by
* clear create_by for support users
* refactor
* typo
* rebase lint
* Add `updated_by` to logs to track who was the last person to update a log
- Reset `created_by` automatically when a form is updated and the owner does not belong to the managing or owning organisation
* move reset_invalidated_dependent_fields!, update schema file and fix tests
Co-authored-by: James Rose <james@jbpr.net>
* remove Organisation#relationship_type
* add indexes and fk constraints to org relations
* remove relationship_type from seeds
- as these have now been removed
* seeding is now idempotent
* Bugfix provider_type on nil
* Do not infer managing org
* Always show 'your org' to non support users
* Never show created_by_id in CYA
* Show HousingProvider in CYA when not inferred
* Always show ManagingOrganisation
* Spec fix
* Show ManagingOrganisation if managing agents >=1
* typo
* Show also users from owning_organisation
* Correctly handle housing provider question
* Managing Organisation page should behave the same if user is support
* Fix feature test
* Add scopes to OrganisationRelationship
* Update seeds to have more than one org relationships
* Pass current_user to questions
* Add new questions
* Use feature flag
* Update specs
* Address comments