* feat: add validation that staircase % is >= threshold
* refactor: dry out validation
* refactor: correctly order shared ownership types in array
* test: add tests for stairbought threshold validation
* chore: lint
* feat: all staircasing transactions must have stairbought >= 1%
* feat: add validation to shared ownership type as well
* chore: lint
* refactor: simplify no errors tests
* refactor: simplify tests by using iteration
* feat: skip fixed term tenancy length question when tenancy is other
* CLDC-2006 Add 23/24 collection year LAs (#1392)
* 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 PaperTrail to OrganisationRelationship (#1406)
* CLDC-1838 update copy for both offered questions (#1401)
* ensure copy is changed for both questions relating to how many times a property has been offered
extract to en.yml so that both questions keep identical copy in the future
* minor typo caught in code review
* copy change for LA (#1407)
* CLDC-1997 Infer new LAs for post 2023 logs (#1398)
* Infer new LAs after year 2023
* Test
* Run CSV export before XML export to CDS (#1393)
- The XML export mutates the `LogsExport` table which determines the period in which logs are exported.
- The CSV export does not change this table, so if the CSV gets ran at the same time as the XML log it could skip records.
* CLDC-1998 Correctly infer 22/23 las if a NEW one is returned by postcodes.io (#1397)
* feat: correctly infer las for 22/23 logs
* feat: copy changes to sales log
* feat: don't reset las when clash with postcode to make tests pass
* feat: align with similar PR for 23/24
* feat: tidying and add test
* refactor: lint
* refactor: use unless
* CLDC-1919 Add 23/24 rent ranges (#1405)
* feat: add 23/24 rent ranges csv
* fix: use new 2023/24 rent ranges after duplicates removed
* test: update seeds test to use new rent ranges count
* fix: resave 2023 CSV as not UTF-8 (#1411)
* CLDC-1820 Update reason for leaving domestic abuse answer options (non-renewal only) (#1391)
* feat: change domestic abuse answer opts
* test: add test for reason question
* CLDC-1808 add previous tenure question for buyer two (#1354)
* create and run migration for new columns related to buyer two previous tenure
* a little refactoring for readability
* create new pages, questions, associated tests and a couple of boolean methods on sales log for depends_on readability
* add new pages to subsection and amend tests to reflect this change
* make new pages only visible for new collection year, rename filesamend tests
* some copy changes and alterations of readability after code review
* CLDC-1816 add hint text to tenancy type options (#1341)
* add hint text to several options on tenancy type, rename question class and a few others to make them pascal case and write test files for all changed questions
* update some depends on for readability and write test files for page classes
* change the condition to avoid conflicts with 2034 and cover that ticket in this one
* also add hints to other tenancy question
* add new answer options to nationality, rename question, write test file (#1339)
* CLDC-2014 remove text field for buyer 1 nationality other (#1388)
* remove question no longer needed and associated test file
* amend page and the other question in that page that determined whether the deleted question should be shown
update associated test files
* createa a migration to remove the column for the deleted question
* update test broken by changes
* fix test broken by changes
* CLDC-1886 Add sales paper form download (#1408)
* Add sales paper form download
* Rename download path
* Add 22/23 sales log download
* Update lettings log form download (#1409)
* Run tests in parallel (#1412)
* Run tests in parallel
* Failing test
* Add parallel tests to prod pipeline
* Remove failing test
* Add PARALLEL_TEST_PROCESSORS env var
* CLDC-1925 ask for buyer 2 nationality when joint purchase (#1390)
* create migration for new column
* create page class and add to household characteristics
* create question for buyer 2 nationality and associated test file
* fix failing test after added page
* rename method after code review
* add question number for the new question to allow CLDC-1864 to progress with fewer conflicts/complications
* fix: get real validation messages for rent range validations (#1413)
* CLDC-1826 lettings log codes only download (#1268)
* update seeds to add self in review env, change spec to reflect this, update config yml to allow csv exports in review
* update interface of relevant methods
EmailCsvJob, LettingsLog.to_csv and LettingsLogCsvService consume codes_only flag
* update tests including adding a new csv file to test against
* update LettingsLogCsvService to output codes only csv
* correct minor error and linting
* enable codes only download in UI
- add link on lettings log index page
- pass codes_only flag through params in relevant links and methods
- convert flag to boolean in controller methods
* ensure link displayed successfully for all renderings of logs_list and params passed through relevant methods in organisations controller
* fix existing tests
* correct linting thing
* correct linting error
* update tests for lettings log controller
* correct linting errors
* update organisations controller tests
* make minor changes after code review
* remove changes made for testing on review app
* make codes only download visible to support users only
* change variable names throughout after info on rauby/rails naming conventions, update tests for change in who can view codes only download link
* rework csv service for readability, remove delegating methods from lettings log to keep all code to do with mapping between our domain and desired export format in one place
* update test name
* correct a small typo and remove a duplicated method after clever git merge conflict suggestion
* point review app at staging csv bucket for csv download
* change variables named codes_only_export to codes_only to avoid inconsistency
* write tests to ensure that differetn user roles have the correct permissions around csv download
* ensure that non support users may not download codes only exports
* correct a small error in a previous commit
* correct minor linting error
* Make tests less dependant (#1415)
* Seed the test db before tests and reset forms after tests
* Update rails
* Remove redundant FormHandler reinitialise
---------
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Co-authored-by: James Rose <james@jbpr.net>
Co-authored-by: Arthur Campbell <51094020+arfacamble@users.noreply.github.com>
Co-authored-by: Phil Lee <asmega@users.noreply.github.com>
Co-authored-by: SamSeed-Softwire <63662292+SamSeed-Softwire@users.noreply.github.com>
* refactor questions from validator to row parser
* able to switch between bulk upload parsers
- depending on what year we are processing
* spec tooling to support bulk upload multi year
* row parser now has year in namespacing
* add static data for 2023 row parser
* add placeholder to log to csv for specs
* bulk upload aribtrary 23/34 column ordering works
* bulk upload supports 23/24 without headers
* bulk upload 23/24 supports BOM + invalid chars
* dupe tests
* port 23/24 attributes_for_log
* port 23/24 bulk upload validations
* force crossover period
* tweak max permitted columns
* able to return column for given field
* work out column for field for errors
* add field_4 as 23/24 setup field
* remove duplicate method
* map schemes and locations correctly
* handle arbitrary number of header rows
* add missing fields to bulk upload support
* update seeds to add self in review env, change spec to reflect this, update config yml to allow csv exports in review
* update interface of relevant methods
EmailCsvJob, LettingsLog.to_csv and LettingsLogCsvService consume codes_only flag
* update tests including adding a new csv file to test against
* update LettingsLogCsvService to output codes only csv
* correct minor error and linting
* enable codes only download in UI
- add link on lettings log index page
- pass codes_only flag through params in relevant links and methods
- convert flag to boolean in controller methods
* ensure link displayed successfully for all renderings of logs_list and params passed through relevant methods in organisations controller
* fix existing tests
* correct linting thing
* correct linting error
* update tests for lettings log controller
* correct linting errors
* update organisations controller tests
* make minor changes after code review
* remove changes made for testing on review app
* make codes only download visible to support users only
* change variable names throughout after info on rauby/rails naming conventions, update tests for change in who can view codes only download link
* rework csv service for readability, remove delegating methods from lettings log to keep all code to do with mapping between our domain and desired export format in one place
* update test name
* correct a small typo and remove a duplicated method after clever git merge conflict suggestion
* point review app at staging csv bucket for csv download
* change variables named codes_only_export to codes_only to avoid inconsistency
* write tests to ensure that differetn user roles have the correct permissions around csv download
* ensure that non support users may not download codes only exports
* correct a small error in a previous commit
* correct minor linting error
* create migration for new column
* create page class and add to household characteristics
* create question for buyer 2 nationality and associated test file
* fix failing test after added page
* rename method after code review
* add question number for the new question to allow CLDC-1864 to progress with fewer conflicts/complications
* remove question no longer needed and associated test file
* amend page and the other question in that page that determined whether the deleted question should be shown
update associated test files
* createa a migration to remove the column for the deleted question
* update test broken by changes
* fix test broken by changes
* add hint text to several options on tenancy type, rename question class and a few others to make them pascal case and write test files for all changed questions
* update some depends on for readability and write test files for page classes
* change the condition to avoid conflicts with 2034 and cover that ticket in this one
* also add hints to other tenancy question
* create and run migration for new columns related to buyer two previous tenure
* a little refactoring for readability
* create new pages, questions, associated tests and a couple of boolean methods on sales log for depends_on readability
* add new pages to subsection and amend tests to reflect this change
* make new pages only visible for new collection year, rename filesamend tests
* some copy changes and alterations of readability after code review
* feat: correctly infer las for 22/23 logs
* feat: copy changes to sales log
* feat: don't reset las when clash with postcode to make tests pass
* feat: align with similar PR for 23/24
* feat: tidying and add test
* refactor: lint
* refactor: use unless
- The XML export mutates the `LogsExport` table which determines the period in which logs are exported.
- The CSV export does not change this table, so if the CSV gets ran at the same time as the XML log it could skip records.
* ensure copy is changed for both questions relating to how many times a property has been offered
extract to en.yml so that both questions keep identical copy in the future
* minor typo caught in code review
* 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
* bulk upload setup errors only for missing data
* bulk upload setup error for scheme
* bulk upload setup error for location
* ensure missing startdate is a setup error
* Add local authorities table
* Seed initial local authorities
* set previous_location_only to false by default
* Add unique index and rake task
* Update field name and required fields
* Remove previous_location_only field
* tests
* 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
* update copy to handle pluralisation in the case of joint purchase for previous ownership, with associated testing changes
* update copy to handle pluralisation in the case of joint purchase for staircasing, with associated testing changes
* update copy to handle pluralisation in the case of joint purchase for buyer previous, with associated testing changes
* make minor linting changes and update the evil test about number of pages
* potential variation on how to achieve pluralisation
* use built in rails methods of pluralising copy
* feat: add new guidance page with corresponding template links for sales and lettings log
* feat: add specification files and links for sales/lettings
* refactor: tidying
* feat: change pseudo csv to xlsx to reflect reality
* feat: add tests for guidance page routing and content
* feat: add tests for lettings too
* limit setup errors if errors already present
* bulk upload beter handles age validations
- limit the number of errors on a field. if the field already has an
existing error it does not add further errors to the field
- shim in extra validation for ages which take precedent over existing
log level validations which are lacking
* setup errors always added
- no longer observes if the grouping already has errors
- as we have fine grain control in this class of how errors should be
* fix missing pass through for renewal
* add placeholder tests for bulk upload mailer
* bulk upload fix setup errors email
- this plumbs in the condition so if any setup sections are incomplete we
send that partcular email and prevent the remaining flow
* tag bulk upload setup errors for downsteam use
* add category to bulk upload errors
* persist bulk upload error category
* populate bulk upload mailer with errors