* remove Organisation#relationship_type
* add indexes and fk constraints to org relations
* remove relationship_type from seeds
- as these have now been removed
* seeding is now idempotent
* Remove deactivation date from schemes and add scheme deactivation periods table
* Update affected logs when a scheme gets deactivated
* Update status method
* Display availability timeline
* Update flash notice message
* feat: wip update scheme summary page
* feat: wip deactivate scheme schemes page
* feat: wip toggle active page
* feat: wip set deactivation_date to a datetime (to be more specific times later_
* Change conditional question controller to accommodate all models
* feat: add specific datetimes for deactivation
* feat: correct date and add notice
* feat: wip error behaviour
* feat: wip errors
* feat: wip errors refactoring
* feat: wip errors more refactoring
* refactor: linting
* feat: add second error in correct position and wip date range error
* feat: remove unneccessary db field
* feat: change type values to strings
* refactor: tidy up controller logic
* refactor: use same structure as locations deactivation
* feat: add general partially missing date input error
* feat: add tests ("updates existing scheme with valid deactivation date and renders scheme page" still wip) and add new partially nil date behaviour to locations controller
* feat: fix tests, add status tag behaviour and remove unnecessary nils
* refactor: linting
* refactor: erblinting
* refactor: remove redundant line
* refactor: respond to PR comments 1
* refactor: respond to PR comments 2
* refactor: respond to PR comments 3
* refactor: respond to PR comments 3 (locations side)
* fix: remove @locations in location model
* fix: remove @locations in location model
* fix: update status names
* feat: wip validation update
* feat: add validation to model layer
* feat: further separate scheme deactivation behaviour
* test: update tests to new flow
* feat: respond to pr comments and add dynamic success text
* feat: duplicate behaviour schemes -> locations (+ tests)
* refactor: linting
* refactor: typo and remove unnecessary line for this PR
* refactor: feature toggle simplification
* Refactor locations and schemes controller actions
- Rename confirmation partials to `deactivate_confirm.html.erb` so that they match the actions in which they belong to
- Make all deactivation date comparision UTC time
* feat: update deactivation_date validation and add tests
* refactor: linting
Co-authored-by: Kat <katrina@kosiak.co.uk>
Co-authored-by: James Rose <james@jbpr.net>
* Add scopes to OrganisationRelationship
* Update seeds to have more than one org relationships
* Pass current_user to questions
* Add new questions
* Use feature flag
* Update specs
* Address comments
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.
* add deactivation_date to locations
* Change conditional question controller to accommodate all models
* UI spike
* Update toggle-active views and render them correctly
* Display 2 errors
* Update errors
* Extract text to translation file
* Add collection start date
* Add out of range validation
* Update affected logs label
* lint
* Add status method
* update the displayed status tags
* Keep deactivation_date_type selected if an error occurs
* refactor deactivation_date_type to use default and other as options instead of 1 and 2
* refactor
* refactor
* update lettings logs
* Add reactivate ocation button and path
* Fix controller and update deactivate confirm page
* Don't actually update the logs data when deactivating a location
* lint and typos
* update a path
* update current_collection_start_date
* Remove unused scope
* wip
* Rename managing_agents column
* add managing relationship
* f
* feat: add my features branched off managing agents branch
* feat: update nav behaviour
* feat: simplify housing_providers view
* feat: fix pluralise to default to plural rather than singular
* feat: remove managing agent related code so can be merged directly
* tests: update tests and add new ones for housing_providers
* refactor: rubocop conciliation
* tests: fix failing navigation tests
* tests: one more plural test
* refactor: erb linting
* refactor: erb linting
* feat: right-align "Remove" text
* feat: update nokogiri to pass bundler-audit
* feat: grey out search button
* feat: remove section-break
Co-authored-by: Jack S <jacopo.scotti@softwire.com>
* add type of building question to sales
* update check answer label
* fix tests
* [CLDC-1467] Use correct page ID
Co-authored-by: Jack S <jacopo.scotti@softwire.com>
* feat: add buyer 2-1 relationship question and page (migration and schema to come in next commit)
* feat: add buyer 2-1 migration and schema
* feat: update schema
* feat: add depends_on and tests
* feat: add hint text
* tests: add new tests
* refactor: lint appeasing
* test: update no. of pages
* feat: remove text input for Other option
* feat: update schema
* feat: core functionality
* feat: update schema.rb
* feat: add link for privacy notice, refactor to separate tenant/buyer
* feat: make privacy notices open in new tab
* test: make previous tests pass
* test: add new tests
* feat: add buyer 2-1 relationship question and page (migration and schema to come in next commit)
* feat: add buyer 2-1 migration and schema
* feat: update schema
* feat: add depends_on and tests
* feat: add hint text
* tests: add new tests
* refactor: lint appeasing
* Remove an unused ethnic_other column
* remove sale_completion_date from lettings logs
* Add collection start year
* Remove sale_or_letting column
* Rename rent_type to rent_type_detail in the export
* Format dates
* refactor
* Fix test
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 shared ownership type question and page
* Add type column to the sales logs table
* Add ownership scheme field to db
Isolating this into a separate commit so it can be cherry picked for any
other sales logs work that's necessary.
* Fix tests
* fix a test
* Fix typo
* Set default time for form handler
Co-authored-by: Dushan Despotovic <dushan@madetech.com>
* 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>