We import XML files that define logs from the previous CORE service. For an unknown reason, some of these files don't include the required namespace declarations to parse `user` values. Instead of changing the source, this change introduces a new method that forces the namespace declaration for user fields.
These fields are set using IDs from the previous CORE service. There was an incorrect assumption that these fields were integers so we were casting them as such. We have discovered that these fields are strings (e.g., `027`) so this change adjusts our types.
We were previously blocking the import of locations that belonged to schemes where the end date was before the current date. This meant that we were unable to import logs that are associated with schemes that _were_ valid, but have since expired.
Only import fields from the old CORE service that are logically valid. If a log is `saved` or `submitted-invalid` then it might have fields that are logically invalid at import. We can safely blank these out for the user to re-input.
While migrating users from the previous service to the new one we discovered that email addresses are not unique in the previous service. This means that one user in the new service might relate to multiple users in the previous service.
This change:
- Adds a new LegacyUser model that can belong to a User. Each LegacyUser model has one old_user_id that corresponds to the user ID in the legacy service.
- Updates the user import service so that we create this association for new users
- Creates a Rake script to backfill the association for existing users
* Add previous, current and next forms to form handler
* Add current, previous and next sales forms to form handler
* Implement current_lettings_form, current_sales_form and store year and form type in form
* refactor lettings_forms
* Use current, previous and next forms in lettings log model
* Use current, previous and next forms in sales log model
* use current, previous and next forms in csv service
* Remove "startyear_endyear" forms from form handler
* Remove name from form initializer and add an optional start year
* refactor get_form
* update csv test, fix form initialize
* rebase fix
* Refactor form_name_from_start_year method out
* remove unused variable
* fix typo, add date tests
* rebase, fix tests
* add comment to before test block
* Change the FormHandler back to only contain the form objects
* extract name
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>
* Move storage classes into a dedicated module
* Move configuration classes into a dedicated module
* Refactor configuration service
* Implement configuration via env variables
* failing test to display local authority
* passing tests - sadly with not allowed net connections
* added relevant tests and tweaked the webmock
* shorter output from api
* location_admin_district for location
* location_admin_district for location
* fixed tests
* Fix data mapping for mantype
This was mapped to a column called support services provider which was an
integer, this now maps to the arrangement type column. This should be in
line with expectations for the import/export
* remove unused stuff
* lint fixes
* changes to comparison
* fix lambda checks in view
* fix export test
* Add mobility type question
* Remove wheelchair_adaptation, use mobility_type to infer wchair
* Add validatio to mobility type
* tests
* Rebase main
* CYA test
* extract selection methods into a helper
* Prevents location from being cleared when it has been changed alongside the scheme
* Handles visible IDs not being system unique
* Hides the location correctly
* validation error messages for scheme
* WIP for validations
* fixed redirects for a correct page
* expecting link to a new question
* added support_services_provider
* WIP for support_services_provider
* WIP for support_services_provider - works concenptually
* WIP passing feature tests
* WIP passing feature tests
* WIP validations
* passing tests and working functionality
* location validations
* fixed after rebasing
* fixed edit name
* fixed after rebasing
* tests for missing params
* tests for validations
* tests for validations locaion
* tests for validation of all params for scheme
* tests for location validations
* What is this type of scheme? - Order options alphabetically:
* Care Standards Act 2000? - Order options as follows, add missing hint text for third option
* further styling
* last UI changes
* lmoved back button logic to the view
* select options in the view
* missing validation for manaing org
* fixed check answers page
* wip
* small change
* fixed
* fixed check answers page ui
* fixed updating
* fixed tests
* fixed layout
* final touches
* rebase
* rubocop
* correct condition
* old test
* Clears referral answer if combined with a fixed-term or lifetime previous tenancy at import
* Handles a different value for age refused during import
* Major repairs question should be valid if void date question is
* Add task to reimport major repairs answers
* Correct error message string
* Add logging
* Spec logging
* Fix spec description
* add test and code for logging old id of status discrepancies
* add test and code for logging all case logs with status discrepancies
* lint fixes
* fix spec descriptions
* Now we raise an exception if a non-existing organisation is referenced by a case log
* The void date is not imported if it is after the tenancy start date
* Confirmable
* Remove obsolete rake task
* Skip confirmation for inactive users
* Send beta onboarding template if migrated from Softwire
* Default controller
* Use correct link
* Redirect confirmation to set password
* Confirm account within 3 days
* Only redirect to set password if not previously set
* Rubocop
* Confirm factory bot users
* Set password condition
* Changing email requires reconfirming
* No need to explicitly trigger email, devise does that for us now
* Remove flash banner
* Mock notify
* Mock in the right spec
* Test redirect and text
* User is confirmable
* Rubocop
* Redirect to url so we don't bypass authenticity token
* Update content
* Add test for resend invite flow
* Update link to resend confirmation email
* Rename password reset resend confirmation partial
* Expired link error page
* Remove resend confirmation link
* Update seed
* Expory contact
* Time zone
Co-authored-by: Paul Robert Lloyd <me+git@paulrobertlloyd.com>
This commit fixes the tests that failed as a result of the introduction
of the created_by column in the case log table. The tests were failing as
it is now necessary to have a created_by for a case log