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 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 `meta` values. Instead of changing the source, this change introduces a new method that forces the namespace declaration for meta fields.
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.
* Set age and relat to nil when inconsistent
* Set homeless and reasonable preference due to homelessness to nil if inconsistent
* Age not answered case
* Refused is also valid
* Check relationship has been answered
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
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>
* wip
* add missing values to factory bot and lint
* remove irrelevand methods
* dont infer housingneeds
* typo
* update method name
* Remove housingneeds_present? method
* move set housing needs fields to case log variables file
* Only set all housing needs values to 1 if there are no housingneeds
* update json form fixture
* link
* update csv test
Co-authored-by: Dushan Despotovic <dushan@madetech.com>
* Change property major repairs date validation from 2 years to 10
* add voiddate_date_in_soft_range? and major_repairs_date_in_soft_range? methods
* update error messages for hard validations
* Add property_major_repairs_value_check to the form
* add void_date_value_check and fix some namings
* Update value_check hidden in check answers to depend on whether the questions is answered
* Remove a schema key
* extract constants for number of days
* change error messages wording
* update schema and csv files
* Prevents location from being cleared when it has been changed alongside the scheme
* Handles visible IDs not being system unique
* Hides the location correctly
* location cell ref
* extracted regex into initializer
* extracted regex into initializer - part 2
* added PostcodeService to extract behavior
* rubo
* better test name
* moved .delete.upcase to the PostcodeService class
* Clears referral answer if combined with a fixed-term or lifetime previous tenancy at import
* Handles a different value for age refused during import
* 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
* Make tshortfall optional based on hidden tshortfall_known question
* Add test for optional
* Add test for JSON derived and dependent on false options
* Test routing
* Fix optionality
* Set hhmemb to totadult and tchild sum if hhmemb is not given
Co-authored-by: Ted <tedbooton@gmail.com>
Co-authored-by: Dushan <dushan@madetech.com>
* lint
* update method
* calculate hhmemb from details provided
Co-authored-by: Ted <tedbooton@gmail.com>
Co-authored-by: Dushan <dushan@madetech.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