* Add location filters to the controller
* Display the status filter and clear filters
* refactor status filter into scope
* Update incomplete, make reactivated scope work in conjunction with other scopes. Lint
* specs
* styling
* Update test name
* uncomment a test
* Move filters under navigation
* Filter schemes
* Add status filter to schemes pages
* Filter schemes deactivating in more than 6 monts as active
* Always serialize session filters for schemes
* Remove ordering in search, fix tests
* Update incomplete scope
* feat: add absorbing_organisation relationship to orgs
* feat: wip absorbed orgs visibility work
* feat: add absorbed orgs to filter options, make unique
* refactor: simplify
* feat: add test
* feat: update schema
* feat: add absorbed org to user relations
* feat: be more explicit about org scopes
* feat: update log org question selections
* feat: add org question to sales for all users (to be specified again in later ticket)
* feat: revert previous and handle in separate ticket
* feat: update validation and tests
* feat: reload org to populate associations
* feat: check for holding own stock in stock owner question, add schema
* feat: add/update org filter tests
* feat: update test
* feat: update created by id pages
* Add user status filters
* Add filters to the pages
* only show unconfirmed and deactivated logs as deactivated
* Look at last signed in at to determine unconfirmed users
* feat: wip commit
* feat: rest of assigned to filter behaviour
* feat: start to update tests
* feat: update tests
* feat: update tests
* refactor: linting
* feat: add new test
* feat: add new test
* feat: update filters_count
* feat: let support users see all users
* feat: let users select users from stock owners/managing agents too
* refactor: typo
* feat: update tests
* Remove new_data_protection_confirmation? flag
* Update schema
- drop index
- add org and user data to dpc table
* Persist org and user data at import
* Do not show invalid emails
* Persist user and org data while signing agreement
* Add migration to persist org and user data on DPC
* Rebase fix
* fix typo
* CLDC-2494: WIP
* CLDC-2494: wip
* CLDC-2494: page work in progress
* cleanup
* Add a path for duplicate logs
* Display all duplicate logs
* Move a test
* Display duplicate check answers for logs
* Add buttons to delete duplicates
* Add a route for sales logs duplicates
* Update duplicated page to work for sales logs
* Update styling
* lint
* Add auth
* Rebase updates
* Remove propcode from dedulication checks
* Update fields to work with supported housing
* Trigger duplicate log check on buyer 1 age not known
* compare correct charges
* Update displayed questions
* BU test
* Put redirect to duplicate logs path behind a feature flag
* More BU tests
---------
Co-authored-by: Kat <katrina@kosiak.co.uk>
* 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
* CLDC-2439: min and max rent value check questions created
* CLDC-2439: Informative removed, check pages fixed.
* CLDC-2439: removed informative info tests and rent value check
* CLDC-2439: fixed informative missing test failure
* CLDC-2439: Text moved to en.yml
* CLDC-2439: tests added, copy moved to en.yml
* CLDC-2439: tests added, copy moved to en.yml
* CLDC-2439: content change for bulk upload errors WIP
* CLDC-2439: informative rendering change, content change, test updated
* CLDC-2439: failing test fix.
* CLDC-2439: display_informative_text test added for strings
* CLDC-2439: string as var in test
* feat: add org id to about page and update tests
* refactor: tidying
* feat: just enforce names are strings adn remove humanization to display ID in caps as required
* refactor: lint
* feat: fix tests
* CLDC-2075: details added to three question pages with tests updated
* CLDC-2075: guidance partial displaying depends on specific year
* CLDC-2075: Page and questions tests for each for all 3 questions
* CLDC-2075: Header content change on all 3 question pages
* CLDC-2075: linting fix
* CLDC-2075: fix failing subsection test
* CLDC-2075: date clarification in tests
* CLDC-2075: Linting
* CLDC-1507: rent explanation added to rent type question page.
* CLDC-1507: 'Rent Type' headed added above question
* CLDC-1507: test amended to include new header.
* CLDC-1507: guidance partial test added
* CLDC-1507: LSEP unicode character removed from definition
* Add mailer
* Instantiate logs only where needed
* Update banner to handle all possible permutations
* wip
* Send confirmation email to user
* Address PO review
* protect against stack level errors in the case where a log has the status in progress but due to changes in the form should now have the status completed
further update the lettings log factory as the :completed trait was producing logs that were not copmlete
* add tests for calculate_status that implicitly also check if the factory traits for copmleted are working
also some minor renaming and refactoring
* correct linting errors
* remove status update but protect against error resurfacing in the future
* add a button to the logs list to delete multiple logs
style and position of button
helpers for displaying the button conditionally depending on user role and what filters and search are active
* correct indentation from 4 spaces to 2 in view file
* test appearance of delete logs button on index page for lettings logs
* write a happy path feature test for the entire journey
* create basic tests for the view component for listing logs to delete
* create request tests for the GET delete-logs path
* create request tests for the GET delete-logs-confirmation path
* create request tests for the DELETE delete-logs path
* comprehensive reworking after code review
ensure that we are not passing lists of ids through params in the query string, risking overflowing the maximum URL length,
adjust tests accordingly,
do not attempt to reuse the same table for sales and lettings
* alter config to allow creating controllers from the command line with associated spec files that matches how we test
* extract controller methods and associated tests to do with the delete logs feature into their own controller,
amend routes accordingly
* implement same work for sales as for lettings
* implement the story for lettings and sales logs under the organisation tab
routing and controller methods
testing for deleting sales logs, lettings or sales logs for an organisation
move storage of relevant routes inside the form object as a comprehensive view model
* merge the delete pages for lettings logs and sales logs, add to the tests for the lettings page to test sales specific content
* minor refactor to delete logs controller: ensure session filters are only fetched from teh session when needed and extract discard logs method to private method
* extract tables for lettings and sales to own partials
* refactor delete logs controller after tech review
improve the private method that builds the form object so that it has the flexibility to do so for all controller methods
ensure that the search term is passed to the delete logs controller when navigating through the organisations tab
ensure that noly logs for that organisation are displayed when navigating to delete logs through the organisations tab
* remove unnecessary untested arguments
* test new helper methods
* implement dirty fiddle to get the checkboxes smaller and also not misaligned
* ensure delete logs button is always visible on log lists when in the organisations tab
* minor linting corrections
* revert change, causing errors and outside the scope of this ticket
* simplify tests for whether delete logs button appears on index page
* replicate request specs from lettings for sales and organisations controllers
* minor refactor of lettings log feature spec setup, replicate happy path for sales
* minor refactors after rebasing onto Nat's work
* temp
* write tests for the delete logs form object
* lint: add new line at end of file
* respond to PO feedback
the log id in the delte logs table should be a link to the log
the delete logs button should be visible when the user is in a bulk upload journey
updated associated 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
* feat: update max and add new spec
* feat: update previous years
* feat: combine identical offered questions
* feat: update tests
* feat: add test for property_number_of_times_relet
* Remove bulk_upload_lettings_logs flag
* Add spacing above actions in data sharing agreement
* Add banner
* Add model validation
* fix log component
* Fix factory
* Put validation behind feature flag
* start adapting to data protection confirmation
* Make tests more generic
* Add tests for display_organisation_attributes
* Use data_protection_confirmed? method
* Address code review
* rubocop
* Prevent access to bulk upload pages when DPC not signed
* Address PO review
* Remove soft validations from sales setup and make them mandatory
* Remove soft validations from lettings setup and make them mandatory
* Fix remaining tests
* Add card numbers to pregnancy checks
# Context
- We're currently using a custom fork of devise
# Changes
- Switch back to original devise gem
- This gives us the benefit of being able to more easily upgrade when the time comes
- Minor fixes to validation copy during password reset process which were not correct
* call form to reset invalid values when saving a sales log
* fix tests failing after updating sales log functionality to reset invalid answers
* add a test to cover the new functionality added
* a further test
* feat: add max value check for buyer 1
* feat: add tests and refactor
* feat: add buyer 2 value check
* feat: combined income value check
* feat: add combined validation everywhere and add tests
* feat: add max value check for buyer 1
* feat: add tests and refactor
* feat: add buyer 2 value check
* feat: combined income value check
* feat: add combined validation everywhere and add tests
* db:update
* refactor: lint
* db: update
* feat: update copy for single validations
* feat: add correct answer card numbers
* feat: add tests
* feat: fix tests
* feat: correct uprn address routing not to show when uprn_confirmed is nil
* refactor: lint
* feat: update tests
* feat: make combined_income nil safe
* feat: merge with main
* test: update
* feat: update to new soft val designs
* feat: replace la with uprn, postoce_full, la in all interruption_screen_question_ids
* feat: update tests
* feat: wip blank fields and dependent fields on upload tos ee if valid and can upload with missing info - this is not the exact ac on the ticket yet
* feat: update seed
* feat: wip commit
* feat: add postcodenk error so can clear on validation
* feat: add postcode validation back
* feat: move la vals to shared and move and add tests
* feat: add correct pluralisation to warning message
* feat: add blank compound invalid fields methods
* feat: update validations
* feat: update pluralisation
* refactor: lint
* feat: clear errors associated with blanked values so log status is set correctly on creation
* feat: validate instead
* feat: avoid duplicated errors
* feat: dont auto-refuse income, different to imports
* feat: validate after every blank method
* feat: delete la validator spec
* tests: update
* refactor: erblinting
* refactor: cleanup
* refactor: move pluralizer to helper
* feat: copy update
* feat: rename
* feat: refactor to avoid redundant re-validations and test
* refactor: rubocop
* test: update
* test: update
* test: update
* update sidekiq
* feat: clear errors
* feat: run clearing twice in case first clear creates different errors
* feat: remove moved file
* feat: undo validation file tweaks as shared/specific overlap could do with a more general refactor
* feat: update tests
* create a method on the FormHandler that returns the sales form questions for all years in the order that they appear in the form
* update csv email job to accomodate sales log export as well as lettings
add to tests to reflec the changes made
* write tests to cover the desired functionality of the SalesLogCsvService
* create the SalesLogCsvService
create a necessary method on the log to enable submission method to be included on the csv
derive values for the two halves of previous postcode for export
* add relevant links in the UI and pipe everything together in controllers
amend organisations controller to have flexibility to download logs of either type
add necessary methods to sales log controller, raising shared method to logs controller
update routing for amendments and additions
extract helper method to build urls for downloading logs within an organisation
* correct various linter complaints and tech review suggestions
* minor amendment to add old_id and reorder early columns
* undo my 'clever' refactor that broke things
* refactoring of csv service after some tech review and some UI testing in review app
* update tests to include a test of a full export and all values in teh csv
* correct minor routing error to ensure correct url is shown and tab selected after requesting csv email
* update organisations controller requests spec file to cover new functionality and make a minor amendment to authentication scope in the controller after error found in testing
* write request tests for the new functionality in the sales log controller, define authorisation in the controller
* minor correction after rubocop's kind suggestion'
* various corrections from first pass at PO, tech review, linter, etc
* refactor :ordered_sales_questions_for_all_years
* first pass at implementing flexible code-based form fixtures for testing
* second pass
* refactor all tests of :ordered_sales_questions_for_all_years to use new factories
* some refactoring in the testing of the csv service
* use that fact that params is always available in controllers and don't pass it around, inline some methods calls
* correct minor bug to ensure that "Return to logs" link returns to the correct index page
* remove reminder comments
* write further tests on the manipulation of questions into the csv headers, update factories of form constituents to allow the creation of forms with richer questions
* fix linter complaints
* minor alterations after rebase to account for changes made on other branches
* refactor after code review
* tweak fixtures after rebase containing alterations to the factory defaults
* add a validation to prevent an inconsistent combination of values and tests for this validation
* show related method in diff
* remove comment
* extract reusable logic from SalesLogVariables to independent module
* update lettings log tests around derivations related to renewal
* refactor derivation logic to share functionality with sales logs where possible
* remove some tests which are now duplicated above, refactor tests using Jack's wonderful :change suggestion, add in tests about logic deriving vacdays that was not previously covered
* minor changes after tech review