* feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint
* feat: build out alternative routes through the address lookup flow
* refactor: lint
* refactor: remove commented lines
* feat: make nil safe
* feat: test address client
* feat: store address input separately
* feat: add migration
* feat: display inputs in answer label
* feat: update data presenter and test
* feat: revert precicions schema update
* feat: revert precision schema update
* feat: migrate new fields to sales logs
* feat: update shared log examples tests
* feat: use -1 for not listed address for extensibility
* feat: add service error to address_selection
* feat: handle case when no addresses are found
* feat: allow re-entering different uprns
* feat: improve error handling and don't accept "no match" precisions
* feat: add page tests
* feat: confirm uprn on address update
* feat: add question tests
* feat: don't set minimum match for initial search
* feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint
* feat: build out alternative routes through the address lookup flow
* refactor: lint
* refactor: remove commented lines
* feat: make nil safe
* feat: test address client
* feat: store address input separately
* feat: add migration
* feat: display inputs in answer label
* feat: update data presenter and test
* feat: revert precision schema update
* feat: migrate new fields to sales logs
* feat: update shared log examples tests
* feat: use -1 for not listed address for extensibility
* feat: add service error to address_selection
* feat: handle case when no addresses are found
* feat: allow re-entering different uprns
* feat: improve error handling and don't accept "no match" precisions
* feat: add page tests
* feat: confirm uprn on address update
* feat: add question tests
* feat: don't set minimum match for initial search
* feat: add no address found page
* feat: allow uprn known to be skipped, and set 0.4 min precision
* feat: accept best "good" match in bulk upload
* feat: update validations and test
* refactor: avoid stubbing using any_instance_of
* refactor: use change_table in migrations
* feat: add lettings behaviour to sales logs
* feat: update sales tests
* feat: xit test that is xited in lettings
* feat: stub os api in sales row parser
* feat: stub os api in sales row parser
* feat: add address line 1 to required attributes
* feat: update matching details and fix row parser validation
* refactor: improve readability
* feat: set uprns as option IDs to avoid multiple lookups
* feat: add sales uprn_selection
* feat: update schema
* feat: update tests
* feat: remove redundant methods
* feat: update error message and fix tests
* feat: update tests
* feat: update tests and error behaviour
* feat: update tests
* Empty commit
* CLDC-3224: Parse noint correctly in bulk upload row parsers
* CLDC-3224: Add task to fix previous noint data
* CLDC-3224: Remove nonsensical value for noint field in bu test
* CLDC-3224: Move where bulk upload noint fix status is set to ensure it matches processing version
* Put BU noint_fix_status setting before creating any logs
* feat: update header and test
* feat: update answers and hint for 24/25 and test
* feat: update tests
* refactor: lint
* feat: update buyer 2 as well
* refactor: lint
* refactor: lint
* Add new ethnic option to BU
---------
Co-authored-by: Kat <katrina@kosiak.co.uk>
* Add new nationality columns
* Add nationality questions to lettings
* Add nationality questions to sales
* Infer nationality where appropriate
* Add synonyms
* Update csv exports
* Export nationality_all for 24/25
* Update prefers not to say value
* Set 24/25 nationality fields from BU
* Undo the export (there's a separate ticket)
* Correctly display answers
* Rebase fixes, tests and lint
* Set nationality from lettings BU 24/25
* Rename files, add synonyms and accents
* Fix sales csvs
* Extract constant
* Copy 23 BU files to 24
* Renumber bulk upload fields for 2024
* Add prepare your file
* Update max columns
* Update fields in first_record_start_date
* Update managing org
* Rebase changes
* Blank commit for replication
* CLDC-3210: Check for R properly for sales BU savings field
* Sort refused check for income fields
* Add tests
* Allow any number of digits
* Correctly route to sales owning organisation page
* Display correct owning organisation options
* Set managing organisation as user organisation
* Add managing organisation question for sales
* Display managing organisation users in created_by
* set managing org to be same as owning org in BU
* Add managed by filter to sales
* Display reported by, correctly update owning org
* Update factory and 2022 BU
* refactor
* Merge managed sales logs
* test
* Update managing organisation for sales bulk upload
* Rebase tests
* skip a test as it is not relevant as the rake task would have already been ran
* PO fixes
* Remove old collection managed sales validation
* Update question header and filters conditions
* remove feature toggle
* feat: only show editable duplicate sets for user and org
* feat: simplify and refactor
* feat: update tests
* feat: add and update tests
* feat: reset not routed questions twice to catch newly not routed questions after the first set are cleared
* Revert "feat: reset not routed questions twice to catch newly not routed questions after the first set are cleared"
This reverts commit 3007284670.
* TEST FOR PO TO BE REVERTED
* TEST FOR PO TO BE REVERTED (set back to dec 31)
* TEST UPDATE TESTS
* REVERT THIS TEST UPDATE
* REVERT THIS TEST UPDATE
* feat: timecop tests
* refactor: lint
* feat: add update methods
* feat: update tests (and TO BE REVERTED: change collection year)
* feat: update tests
* feat: update tests
* feat: update form end_date tests REVERT LATER
* feat: update tests
* refactor: lint
* feat: revert to previous end dates now passed PO review
* feat: use scoping to simplify editable set logic
* feat: match email regardless of casing in bulk upload
* feat: allow null emails
* feat: set encoding by bom for file IO before parsing
* Revert "feat: set encoding by bom for file IO before parsing"
This reverts commit 03d2d17e7b.
* feat: wip update sales org select
* feat: update routing and hidden in check answers methods
* feat: set sales org id as derived
* feat: update tests
* refactor: linting
* feat: update tests and radio options
* feat: update test
* feat: add value helper test for non-constant value question
* refactor: lint
* feat: freeze time in unrelated test
* refactor: linting
* Save total logs count for bulk upload
* Update content of fix choice and confirm pages
* update bulk upload banner
* Rebase changes
* Extract fix choice summary into method
* Add comma
* some minor refactoring
remove methods from child class that replicate methods on the parent class
tidy up check for nil
remove gubbins and inline method body given only used once
* update import services for lettings and sales to import creation method
write tests to cover this
* create sales log field import service and associated spec file, with methods and tests for importing the creation method of logs that have already been imported
* update lettings log field import service and related spec to allow importing creation method of logs
* use the methods dynamically created by active record in all relevant places, removing obsolete methods in teh process.
various tests tweaked to suppor this change.
rake task from another ticket folded into this ticket to prevent merge conflicts
* rename method for ruby conventions
* update PR for altered spec
upload id now decided to be a better indicator of bulk upload status, import service amended accordingly
tests updated in line with this
* update field import services in line with import services to use upload id rather than upload method as the source of truth for how a log was created
* slight refactor to reduce nesting and dodge linter complaints
* minor amendment to log creator spec in bulk upload to use enum dynamic methods
* form handler to return all questions from lettings forms for all years with ordering interleaved
functionality and tests
* refactor lettings log csv service and all associated tests
remove methods on log models when we can call them directly on associated models
update job to call the service directly with the collection of logs rather
minor modifications to the sales log csv service
update many test files to test the appropriate logic in the appropriate place
* tidying
final amendments to tests
remove commented code
rename variable
* change the position of the rent value check field in the headers
* CLDC-2492 add creation method field to logs (#1738)
* create migrations to add creation method fields to both log types
* add enum definition to logs for creation method
* upadte csv export services to retrieve creation method values direct from the log, remove methods previously used from the log model
* run migrations to update schema
* ensure that logs created via bulk upload have this set correctly when created
* Renme end_date to new_logs_end_date
* Display change buttons in CYA if the collection is still open for editing
* Allow navigating to question if the collection is still open for editing
* Allow logs to be edited if the date is before edit end date
* Update sales validation to allow editing existing logs
* update tests
* Update edit_end_date
* Update some test wording
* Update new logs end date
* tests
* feat: setup to replicate failures to fix
* feat: wip test fixes
* feat: remainder of current state test fixes
* feat: set form date to past to trigger errors to fix
* feat: revert, don't want this in final diff
* feat: fix row_parser tests
* feat: sales log importer and validator fixes
* feat: remainder of test fixes
* refactor: lint
* Validate that correct template for the year is used for sales (with headers)
* Check the correct template is being used without headers
* Check correct template for lettings
* Update csv parser on sales
* Remove redundant methods
* Extract form years
* Reverse year check mathod
# Context
- https://digital.dclg.gov.uk/jira/browse/CLDC-2305
- This is rework to add missing validations for sales setup fields for bulk upload
# Changes
- There is code that clears log fields if they are not a valid option. in order to generate errors for these we check certain fields for content prior to `log.valid?` being called. Unfortunately there does not appear to be an easy way to access to valid options therefore these values have been hard coded
- Privacy notice must be accepted other considered a setup error
- The `type` question can actually be one of three questions with the same identifier. these are excluded as part of `validate_valid_radio_option` and instead validated with a different mechanism. The rationale being that `log.valid?` will clear data before we get there
- Remove tests associated to upload threshold which are no longer required