* Create DuplicateLogReference
* Set and clear duplicate log references
* Export duplicate_log_reference_id for lettings
* Export duplicate_log_reference_id for sales
* Export duplicate_log_reference_id in xml
* Update tests
* Update existing duplicate log references
* Rename a field
* Add missing sales deduplication steps
* Set duplicate_set_id straight on logs
* Do not update updated_at to prevent export
* Increment duplicate_set_id
* Update duplicates when they change sets
* Remove duplicates when deleting logs
* correctly update duplicate set IDs when answer is changed through normal form flow
* Empty commit
* feat: base lettings behaviour
* feat: formatting improvements
* Empty commit
* Empty commit
* Empty commit
* refactor: lint
* feat: more page styling
* feat: update tests
* refactor: lint
* feat: add requests spec
* refactor: simplify
* feat: add tests
* feat: copy change to reflect that the count in the header is not necessarily as large as the errors shown (it excludes duplicate errors on fields, and not_answered errors)
* feat: copy changes to sales as well
* feat: remove LegacyBulkUpload MVC
* feat: fix typo
* feat: update tests
* feat: mark additional not_answered sales q
* feat: update routing and only display warnign text when errors will be cleared
* feat: update copy and error rows
* refactor: lint
* feat: don't show soft validations in deletion report
* feat: update routing so deletion report is not shown once logs uploaded
* feat: update tests
* feat: make unique count track repeated errors across rows
* refactor: lint
* 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
* Add availability to the merged org options
* Do not delete merged organisation relationships
* displays managing agents of merged organisation selected as owning org
* Add absorbing org dates, fix copy
* set managing org as owning org it is being absorbed by the users org
* Update check answers to use the correct logs
* Display different link when correcting duplicates
* allow deduplicating logs by changing the answers
* Route back to the initial log if it still has duplicates
* Update back to log button
* Add banner
* Update success banner
* Fix a flaky test
* Rename param and update conditionals
* Add owning organisation to deduplication fields, only return back to the original log if it still belongs to the org
* 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
* lint
* Add auth
* Rebase updates
* Update displayed questions
* Add delete duplicates page
* Update page content for when there are multiple duplicates
* Add auth to the path
* Update delete button to use delete controller
* Update page for sales logs
* Update styling
* Update success banner for deleting duplicates
* Typo
* Render not found if there are no duplicate logs
* rebase changes
* Rebase changes
* Update back and cancel links
* Update the duplicate journey after deleting logs
* Update change button routing
* Refactor tests
* Add content for no duplicates
* Update params
* Refactor tests and paths
* Update params to include original_log_id from the beginning
* Rename file
* lint
* Add full stop after deletion messages
* Add caption and update duplicate log IDs in the banner
* lint
* Styling
---------
Co-authored-by: Aaron Spencer <aaron.spencer@softwire.com>
* 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>
* 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: unrelated currency formatting
* Revert "feat: unrelated currency formatting"
This reverts commit 75bd3efbf8.
* feat: add soft val pages to property information section (not to setup)
* feat: update tests
* feat: update tests
* feat: add validation to setpu section
* refactor: lint
* test: update
* feat: set nil as default check answers card no
* feat: use : to define more explicitly
* feat: make optional as affects setup
* feat: update tests
* feat: put la in nil card with rest of uprn/address qs
* feat: route to uprn confirmation from check answers changes to uprn even though not an interruption screen
* feat: update tests
* feat: update tests
* refactor: lint
* feat: update tests
* 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
* Revert "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"
This reverts commit 136e5f6f12.
* feat: fix uprn hidden in check answers
* feat: fix tests
* feat: fix tests
* feat: assign simultaneously
* feat: assign simultaneously
* feat: revert
* feat: fix back persistence behaviour and update similar issues elsewhere, also remove redundant back text in govuk back links
* feat: add previous_page_redirect_paths to avoid infinite loops
* feat: leave here to avoid possible loops
* feat: leave here to avoid possible loops
* feat: add check answers page behaviour
* refactor: tweak
* feat: make tests pass, simplify code and incorporate tasklist/check answers back routing
* feat: update tests
* refactor: lint
* add first page for bulk upload resume journey
* bulk upload resume handles upload again
* add confirm page to bulk upload resume journey
* replace placeholder count with correct value
* apply recommendation for bulk upload resume choice
* add how to fix bulk upload mailer
* integrate new bulk upload approve journey
* add missing bulk upload error mappings
* remove test
* prevent approve being called multiple times
* bulk upload creates invisible logs ahead of time
* work invisible logs into bulk upload flow
* sort errors so deterministic
* remove unused ensure
* remove expected_log_count and processed
- these fields are no longer used or needed
* introduce pending status
* swap visible for pending logs
* only show visible lettings logs
* hard code status filters
* remove unused model methods
* only show visible sales logs
* form controller ignores hidden logs
* locations and schemes only affect visible logs
* alter copy conditionally for plurality depending on whether a purchase is a joint purchase
* correct linting oversight
* resolve rebase conflicts and alter annoying test to prevent future conflicts
* 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>
* Conditionally display a correct review log text
* do not allow the aswers from previous collection windows to be changed
* does not let the user navigate to questions for previous collection year logs
* Fix tests
* Add some docs
* Extract collection period check into a before_action and change path to rails route
* update the tasklist message
* Add abstract log class and sales log class
Created a parent log class for sales log and lettings log. Any bits common
to both sales and lettings can live in the parent class. As the sales log
functionality is built up any commonalities with lettings log can be extracted
into the parent log class. The sales log model is set up without a json form
and instead the form is defined in code - like the setup section of the lettings
log.
* update sales logs controller
* update lettings controller specs
* update filter method name
* update organisations controller
* use lettings method
* Add deleted tests back
* lint
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: Kat <kosiak.katrina@gmail.com>
This renames the case_log to lettings_log as everything we've written so
far has been geared towards lettings of social housing so it makes sense to
have the name describe this. This is also a precursor to adding in stuff for
sales logs (whatever shape that takes)
Co-authored-by: James Rose <james@jbpr.net>
* More robust date validation
* Update app/controllers/form_controller.rb
Co-authored-by: James Rose <james@jbpr.net>
Co-authored-by: James Rose <james@jbpr.net>
* Don't crash when invalid checkbox answers are selected
* Ensure all checkbox selections are preserved not just the first that doesn't match the all
* Rubocop
* Add an organisation question for the support user (WIP)
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* All the things are green
* Add user question
* Restrict shown answer options based on already answered questions
* Derive managing org
* Guard against missing DB connection
* Remove empty file
* Only select the fields we actually need
* All is redundant
* Fix spec description
* Fix comments
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Refactor depends on in the form json to specify the object for the dependency
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Remove org section
* Enable user based depends on
* Add question
* Question is derived
* Log debug message when values get auto cleared
* Enable answer options to be created from a model lookup
* Make organisation fields optional since they won't immediately have one when created by support users
* Add question to check answers page
* 22/23 fix
* Rubocop
* Spec check answers label lookup
* Only set managing organisation if not already set
* Bump deps
* Rescue lack of database connection for CI
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* update hard validation limits for pregnancy age, remove hard validation if there are no females at all
* Add soft validations for pregnancy
* make the error message consistent
* Only check the values for the members with details known in the household
* Show interruption screen when resident details are updated
* Route back to check answers after an interruption screen and back to previous page if no is selected on the interruption screen
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* update validation messages
* fix a test
* fix a typo
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>