* CLDC-4151: Note deprecations of existing referral questions
* CLDC-4151: Add new cols to lettings log model
* CLDC-4151: Add new referrals questions
* CLDC-4151: Remove referral value check
* CLDC-4151: Add new fields to bulk upload
use new fields as presented in bulk upload
* CLDC-4151: Update tests
also add bulk upload file to test with
* CLDC-4151: Ignore tests failing for later tickets
* fixup! CLDC-4151: Add new referrals questions
start q nums from 2026
* CLDC-4151: Add model tests for new questions
* fixup! CLDC-4151: Add new fields to bulk upload
export old_visible_id
set MAX_COLUMNS correctly
check .prp? for prp cols
* fixup! CLDC-4151: Update tests
clarify tests that may update
* fixup! CLDC-4151: Add new fields to bulk upload
handle the old_visible_id not existing
use override org ID only for the output owning ID. it's only passed as eg ORG1
* CLDC-4151: Add new questions to log factory
* fixup! CLDC-4151: Add new fields to bulk upload
leave field_131 validations till later
* CLDC-4188: Add LA flow
splits the referral_register question and pages into two, as its not easy to have the answers be dependent
if the owning organisation changes type, reset the referral register question. the other questions do not need to be reset as they are no longer routed to
* CLDC-4188: Infer referral_register for renewals
needs a new dependencies array for 2026
this handles inferring as well as clearing inferred answers if the prior answer changes
* CLDC-4188: Add validation between prevten and referral_register
block two other validations from previous years
* CLDC-4188: Update tests
* CLDC-4188: Ignore tests failing for future tickets
* CLDC-4188: Update existing tests
needed as should_reset_referral_register? calls a .find()
* fixup! CLDC-4188: Add validation between prevten and referral_register
use .prp?
improve grammar
* fixup! CLDC-4188: Infer referral_register for renewals
extract dependencies to common list
* fixup! CLDC-4188: Update tests
use before and context blocks better
* fixup! CLDC-4188: Update tests
lint
* fixup! CLDC-4188: Update tests
remove unneeded referral_type set
* CLDC-4189: Add PRP flow
* CLDC-4189: Update validation between prevten and referral_register
* CLDC-4189: Add tests
* fixup! CLDC-4189: Add PRP flow
fix typo
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
* fixup! CLDC-4189: Add tests
fix typo
* fixup! CLDC-4189: Add tests
fix missing cases in page specs
use a loop and before blocks for household validation tests
* CLDC-4189: Ensure log is not classed as generan needs if prevten isnt answered
* fixup! CLDC-4189: Add tests
add cases for other internal transfer flow
* CLDC-4151: Add final question numbers
* fixup! CLDC-4189: Update validation between prevten and referral_register
include new code 40 from CLDC-4149
* fixup! CLDC-4151: Add final question numbers
reinstate fallback
* CLDC-4190: Q84 Referral BU validations (#3155)
* CLDC-4151: Note deprecations of existing referral questions
* CLDC-4151: Add new cols to lettings log model
* CLDC-4151: Add new referrals questions
* CLDC-4151: Remove referral value check
* CLDC-4151: Add new fields to bulk upload
use new fields as presented in bulk upload
* CLDC-4151: Update tests
also add bulk upload file to test with
* CLDC-4151: Ignore tests failing for later tickets
* fixup! CLDC-4151: Add new referrals questions
start q nums from 2026
* CLDC-4151: Add model tests for new questions
* fixup! CLDC-4151: Add new fields to bulk upload
export old_visible_id
set MAX_COLUMNS correctly
check .prp? for prp cols
* fixup! CLDC-4151: Update tests
clarify tests that may update
* fixup! CLDC-4151: Add new fields to bulk upload
handle the old_visible_id not existing
use override org ID only for the output owning ID. it's only passed as eg ORG1
* CLDC-4151: Add new questions to log factory
* fixup! CLDC-4151: Add new fields to bulk upload
leave field_131 validations till later
* CLDC-4188: Add LA flow
splits the referral_register question and pages into two, as its not easy to have the answers be dependent
if the owning organisation changes type, reset the referral register question. the other questions do not need to be reset as they are no longer routed to
* CLDC-4188: Infer referral_register for renewals
needs a new dependencies array for 2026
this handles inferring as well as clearing inferred answers if the prior answer changes
* CLDC-4188: Add validation between prevten and referral_register
block two other validations from previous years
* CLDC-4188: Update tests
* CLDC-4188: Ignore tests failing for future tickets
* CLDC-4188: Update existing tests
needed as should_reset_referral_register? calls a .find()
* fixup! CLDC-4188: Add validation between prevten and referral_register
use .prp?
improve grammar
* fixup! CLDC-4188: Infer referral_register for renewals
extract dependencies to common list
* fixup! CLDC-4188: Update tests
use before and context blocks better
* fixup! CLDC-4188: Update tests
lint
* fixup! CLDC-4188: Update tests
remove unneeded referral_type set
* CLDC-4189: Add PRP flow
* CLDC-4189: Update validation between prevten and referral_register
* CLDC-4189: Add tests
* fixup! CLDC-4189: Add PRP flow
fix typo
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
* fixup! CLDC-4189: Add tests
fix typo
* fixup! CLDC-4189: Add tests
fix missing cases in page specs
use a loop and before blocks for household validation tests
* CLDC-4189: Ensure log is not classed as generan needs if prevten isnt answered
* fixup! CLDC-4189: Add tests
add cases for other internal transfer flow
* CLDC-4190: Invalidate all referral fields if any are wrong
* CLDC-4190: Remove other validations on referral fields
* CLDC-4190: Ignore referral validation if BU is renewal
* CLDC-4190: Add tests
* fixup! CLDC-4190: Invalidate all referral fields if any are wrong
add punctuation to comment
name validation fields better
* fixup! CLDC-4190: Add tests
make test names clearer
* CLDC-4190: Final field fixes
---------
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
* CLDC-4191: Q84 Referral CSV and XML export (#3157)
* CLDC-4151: Note deprecations of existing referral questions
* CLDC-4151: Add new cols to lettings log model
* CLDC-4151: Add new referrals questions
* CLDC-4151: Remove referral value check
* CLDC-4151: Add new fields to bulk upload
use new fields as presented in bulk upload
* CLDC-4151: Update tests
also add bulk upload file to test with
* CLDC-4151: Ignore tests failing for later tickets
* fixup! CLDC-4151: Add new referrals questions
start q nums from 2026
* CLDC-4151: Add model tests for new questions
* fixup! CLDC-4151: Add new fields to bulk upload
export old_visible_id
set MAX_COLUMNS correctly
check .prp? for prp cols
* fixup! CLDC-4151: Update tests
clarify tests that may update
* fixup! CLDC-4151: Add new fields to bulk upload
handle the old_visible_id not existing
use override org ID only for the output owning ID. it's only passed as eg ORG1
* CLDC-4151: Add new questions to log factory
* fixup! CLDC-4151: Add new fields to bulk upload
leave field_131 validations till later
* CLDC-4188: Add LA flow
splits the referral_register question and pages into two, as its not easy to have the answers be dependent
if the owning organisation changes type, reset the referral register question. the other questions do not need to be reset as they are no longer routed to
* CLDC-4188: Infer referral_register for renewals
needs a new dependencies array for 2026
this handles inferring as well as clearing inferred answers if the prior answer changes
* CLDC-4188: Add validation between prevten and referral_register
block two other validations from previous years
* CLDC-4188: Update tests
* CLDC-4188: Ignore tests failing for future tickets
* CLDC-4188: Update existing tests
needed as should_reset_referral_register? calls a .find()
* fixup! CLDC-4188: Add validation between prevten and referral_register
use .prp?
improve grammar
* fixup! CLDC-4188: Infer referral_register for renewals
extract dependencies to common list
* fixup! CLDC-4188: Update tests
use before and context blocks better
* fixup! CLDC-4188: Update tests
lint
* fixup! CLDC-4188: Update tests
remove unneeded referral_type set
* CLDC-4189: Add PRP flow
* CLDC-4189: Update validation between prevten and referral_register
* CLDC-4189: Add tests
* fixup! CLDC-4189: Add PRP flow
fix typo
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
* fixup! CLDC-4189: Add tests
fix typo
* fixup! CLDC-4189: Add tests
fix missing cases in page specs
use a loop and before blocks for household validation tests
* CLDC-4189: Ensure log is not classed as generan needs if prevten isnt answered
* fixup! CLDC-4189: Add tests
add cases for other internal transfer flow
* CLDC-4190: Invalidate all referral fields if any are wrong
* CLDC-4190: Remove other validations on referral fields
* CLDC-4190: Ignore referral validation if BU is renewal
* CLDC-4190: Add tests
* fixup! CLDC-4190: Invalidate all referral fields if any are wrong
add punctuation to comment
name validation fields better
* fixup! CLDC-4190: Add tests
make test names clearer
* CLDC-4191: Update CSV export tests
the export happens by default, no changes needed here
* CLDC-4191: Add new referral fields to 2026 exports
remove old referral fields from 2026 exports
ensure new referral fields don't show in pre 2026 exports
* CLDC-4190: Final field fixes
---------
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
---------
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
* CLDC-4105: Add working situation illness check to log fields
* CLDC-4105: Add soft validation to main flow
* CLDC-4105: Add tests
soft validations
models
add a label file for this year so the export_codes tests have authentic labels to pull
the old BU completed log answers throw the new soft validation. needed to change illness to 3 to avoid the soft validation as it should be a complete log
* fixup! CLDC-4105: Add working situation illness check to log fields
* fixup! CLDC-4105: Add soft validation to main flow
remove unneeded coalesce
remove unneeded variable
* fixup! CLDC-4105: Add tests
fix after rebase
* fixup! CLDC-4105: Add soft validation to main flow
account for if hhmemb is not answered
* Ask address and UPRN questions for 2026 and later logs
* Fix page tests
* Fix LA and postcode overrides
* Fix resetting address fields and LA
* Add tests for resetting address fields and LA
* Fix lettings log derived fields tests
* Fix lint
* Fix tests
* Clean up lettings log property overrides
* Add comments
* Fix lint
* Add error to location field
* Add error to location field
* Add tests for error on location field
* Refactor property and location postcode matching validation into own function
* Add test for LA override
* Add test for postcode override
* Added `!record.read_attribute(:la)` guard
* Fix lint
* Fix property validation for checking LA is active/in England
* Fix test
* Minor tweaks
* Fix lint
* CLDC-4133: Use linked la if available for supported housing logs
calling record.la will automatically map old ECodes to newer ones, so no need to check the location directly
without this locations still tied to old ecodes could not be assigned logs, despite being valid
* CLDC-4133: Add verifying test
* CLDC-4095: Ensure errors are added to Q89 dependent fields
this ensures that the user is always shown an error if they complete the form in a different order to the question set
not doing this leads to the user submitting an answer and nothing happening
* CLDC-4095: Update existing tests to check these new fields
* CLDC-4090: Add validation that the LA is still active for the date of the log
* CLDC-4090: Add verifying tests
* CLDC-4090: Ensure startdate is not nil for this validation
* CLDC-4090: Document linked validations
* CLDC-4090: Remove errors on uprn_confirmation question
this question is no longer asked, so there are no errors needed for it
left the existing translations
* CLDC-4090: Update tests
* CLDC-4046: Remove forcing on Q84 based on Q76 answer
* CLDC-4046: Removing forcing on latter half of Q84 as well
* CLDC-4046: Remove orphaned translations
* CLDC-4086: Fix tests
* Add validation for referral type when permanently decanted from PRP-only housing
* Remove unnecessary error adding, PRP and different landlord is possible
* Update tests
* set renewal ppostcode on postcode change
* update test
* don't validate ppostcode format if nil
* reset ppcodenk if ppcode errors
---------
Co-authored-by: Carolyn <carolyn.barker@softwire.com>
* Adjust staircase difference validation to exclude initial purchase
* Update tests
* Keep validation as is, add error to firststair also
* Add method to generate random dates within collection year for logs
* Revert "Update tests"
This reverts commit e708187160.
* Update financial validations tests to reflect new error messages for firststair
* Update sales log test only pick a date up to 14 days away
* Lint
* Adjust merge date for future dates
* Update La test
* Fix date range logic in generate_different_date_within_collection_year method
* Refactor generate_different_date_within_collection_year to use keyword arguments for start and end date overrides in tests
* Refactor sales_log_spec to use descriptive variable names for date overrides
* Refactor merge_requests_helper_spec to use generated merge dates for consistency in tests
* Refactor generate_different_date_within_collection_year
* Refactor sales_log_spec to use generated sale date for duplicate log creation
* Refactor sales_log_spec to use fixed date values for end date and date after end date, mimics change of year without changing year
* Refactor merge_requests_helper_spec to use a fixed merge date for consistency in tests
* Refactor generate_different_date_within_collection_year to handle edge cases and return nil if no available dates
* test tests in April
* update tests where 2014 is assumed
* update test where time moving is assumed
* update rake task tests that only affect 2024 logs
* update another 2024 assumption
* handle null period in validation
* give pages different ids in SharedOwnershipInitialPurchase and SharedOwnershipStaircasingTransaction sections
* refactor to remove unnecessary method
* delete some old rake tasks and tests
* CLDC-3899 remove flaky date comparison from tests
* CLDC-3899 fix flaky test occasionally picking bad input
* fix test year setup
* add relat mapping for log_to_csv
* temp disable fail-fast for ease of testing
* specify 2024 in 2024-specific test
* Revert "temp disable fail-fast for ease of testing"
This reverts commit 6993d29866.
* Revert "test tests in April"
This reverts commit f5635dba11.
* pass test in 2024 and 2025
* fix test to 2024
* temp disable fail-fast again
* Revert "temp disable fail-fast again"
This reverts commit 55d3e1c7d8.
---------
Co-authored-by: Carolyn <carolyn.barker@softwire.com>
* validate staircasing dates
* validate staircasing percentage totals
* don't show both similar validations at once
* only validate against saledate when saledate present
* format numbers in error message
* add tests for staircasing validations
* linting
* don't block log creation on staircasing date errors
* combine similar validation methods
* update tests
* fix syntax
---------
Co-authored-by: Carolyn <carolyn.barker@softwire.com>
* rename variable for clarity
* remove unused variable
* make reactivating_soon message refer to the soonest, not most recently created
* status check all deactivation periods instead of just one
* handle no open period to reactivate
* test deactivation period related behaviour
* fix reactivation message variable syntax
* use before do instead of let for unreferenced variables
* fix reactivation message syntax for location
* fix test indentation
* remove unused variable - part 2
* lint
* handle edge case of overlapping periods
* end unclosed Timecop freeze causing flaky tests
* remove unused around blocks superseded by befores
* tidying up
* reinstate setup needed to test default date
* fix typo
* explain deactivation period validation logic
* fix setup to test default date
---------
Co-authored-by: Carolyn <carolyn.barker@softwire.com>
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
* Skip bu error on the setup question type
* Lint
* Skip bu error on setup question type for equity calculations
* Skip bu error on setup question type for mrent validations
* Skip bu error on setup question type for stairbought validations
* Rename old renewal prp page and question
* Update subsection
* Add referral_type to lettings logs
* Add two-step source of referral for letting questions
* Update test
* Update validations
* Update tests with referral_type
* Fix test
* Update test
* Update referral type
* Update factory bot
* Remove hint text
* Change check answer label
* Update incorrect value
* Rename old referral pages and questions
* Update referral type options
* Remove clearing
* Update id name
* Update row parser for referral type
* Update test
* Check correct benefits value in the validation
* Update some tests
* Update validation
* clear invalid benefits
* Update more tests
* Fix world
* Clear the benefits
* Move benefits assign
* db migration, new sales log fields
* Add new staircasing transaction section
* Update tests
* Lint
* Add tests
* Use log methods
* Lint
* Update test
* Remove compact
* Change section display condition
* CLDC-3760: Sales - firststair and numstair staircasing questions validations (#2793)
* Add validation to new questions firststair and numstair
* Remove page headers on single question page
* Remove page
* More useful page header
* Show don't know option from 2025 onwards
* Add page header to monthly rent only for the version with two questions on the page
* Remove page header staircase initial date only page
* Update displayed answer options
* Fix lint
* Updates after merge
* Update test
* Update tests
* CLDC-3753: Update soft income validations
* Update tests
* Fix linting
* Include reference to informative text translations copy
* Combine min and max checks for income based on ecstat
* Fixes
* Update tests
* Add LA in England validation for 2025
* Validate supported housing logs
* Add error message to the date
* Update error messages
* lint
* Fix error messages for date
* Update no address found soft validation
* Update validation messages
* Update 2025 version of validation check
* Update validation for 2025
* Put two if statements into one
* Different approach to comparing dates
* Alternative method to compare dates
* Update tests