* initial spec file refactor
remove create for build, extract form to own variable, remove non-valuable tests
run time from 0.29s to0.11s
* refactor to ensure that the questions ownershipsch instance variable and the value of ownershipsch on the log is the same in tests
* delete page test file which is not testing anything meaningful
* add error messages to the I18n yml
* update tests for the validations
* update validation logic
* update tests for the mortgage used question
* update the mortgage used question displayed answer options
* update bulk upload specs to reflect error message updates
* make use of brackets consistent within validation method
* write helper method to support having the correct rent period checkboxes checked
* update new and create in organisations controller and view to enable creation of relevant organisation rent periods
write tests for this
* small changes to models
* enable editing rent period in the UI
display change button on org details page
display rent periods question on edit page
* enable updating org rent periods
update logic in #update
related tests
* alter redirect after support user creates an organisation
* adjust various UI elements: ordering of rows, copy changes, label size and associated tests
* rework the #rent_period_labels method to return All under the correct conditions, rework tests related to that. + fix assorted tests that were either flakey or breaking due to addition of rent periods logic to create and update
* amend failing tests and resolve linting complaints
* changes following review
* disable checkboxes for rent periods if they are in use so that users are not able to make existing logs invalid
hint text added to the question to explain this
I have also added all rent periods to a hidden field to remove the need to fetch them again form the db in the update method
* update validation to reflect the fact that an org having no associated rent periods no longer means they accept all rent periods
update tests adding both cases and removing unnecessary additional db additions
* rake task to create rent period associations for orgs that have none
* revert mistaken copy changes in designs
* create rent periods in factories as default, with an option to skip. skip automatic creation in tests specifically related to rent periods
* stub api call for factory value, update csv tests and fixtures accordingly
* extract a good chunk of tests out of lettings_log_spec and into a dedicated derived fields spec file. in many cases refactor tests
* remove before(:context) and associated patterns.
use assign_attributes in various places for cleaner code
* escape . in regex for API call stubs to satisfy codeQL
remove destroy_all call at the start of a test that was dealing with leftover modesl in the test db
* further refactoring of various tests to reduce database interactions and improve speed
* remove outdated distinction between unitletas mappings from before 23/24
* remove tests that seem to be testing active record and/or ruby Date class
* write helper method to support having the correct rent period checkboxes checked
* update new and create in organisations controller and view to enable creation of relevant organisation rent periods
write tests for this
* small changes to models
* enable editing rent period in the UI
display change button on org details page
display rent periods question on edit page
* enable updating org rent periods
update logic in #update
related tests
* alter redirect after support user creates an organisation
* adjust various UI elements: ordering of rows, copy changes, label size and associated tests
* rework the #rent_period_labels method to return All under the correct conditions, rework tests related to that. + fix assorted tests that were either flakey or breaking due to addition of rent periods logic to create and update
* amend failing tests and resolve linting complaints
* changes following review
* disable checkboxes for rent periods if they are in use so that users are not able to make existing logs invalid
hint text added to the question to explain this
I have also added all rent periods to a hidden field to remove the need to fetch them again form the db in the update method
* update validation to reflect the fact that an org having no associated rent periods no longer means they accept all rent periods
update tests adding both cases and removing unnecessary additional db additions
* rake task to create rent period associations for orgs that have none
* revert mistaken copy changes in designs
* create rent periods in factories as default, with an option to skip. skip automatic creation in tests specifically related to rent periods
* stub api call for factory value, update csv tests and fixtures accordingly
* extract a good chunk of tests out of lettings_log_spec and into a dedicated derived fields spec file. in many cases refactor tests
* remove before(:context) and associated patterns.
use assign_attributes in various places for cleaner code
* escape . in regex for API call stubs to satisfy codeQL
remove destroy_all call at the start of a test that was dealing with leftover modesl in the test db
* further refactoring of various tests to reduce database interactions and improve speed
* remove outdated distinction between unitletas mappings from before 23/24
* remove tests that seem to be testing active record and/or ruby Date class
* create presenter class to hold all the db calls and data for showing the home page
plus tests, some changes to factoreis and helpers necessary
this should avoid an overly bloated controller method or calling the DB from a view helper
* view partial changes
to accommodate design changes, decouple box with counter and blue link boxes
since various boxes show or not or in a different order depending on whether the org logs sales and whether we are in the crossover period I have also made grid and row partials to improve readability on the index page.
* redesign the home page using the new presenter and partials, deliver the presenter object to the view from the controller
* adjust tests and factories and address api call stub
* remove view helpers that are no longer being used and remove outdated tests for home page
* amend presenter and associated calls from view, tests, to ensure support user always sees sales data
* write request specs for the homepage
* undo unnecessary change to factory
* make corrections following rebase conflicts
* various minor changes following tech review
* logs assigned to a provider should be vivisble to them in the homepage count rather than logs created by them
* resolve rebase confusion in csv fixture files
* Empty
* CLDC-3345 Rename created_by to assigned_to (#2372)
* Rename created_by to assigned_to
* Replace created_by with assigned_to
* Update created_by to assigned_to in exports, remove blank assigned to
* CLDC-3345 Add and set created_by fields (#2373)
* Add created_by
* Update existing created_by values
* Set created_by on single log
* Set created_by on BU
* Add created_by to exports
* feat: update since last merge
---------
Co-authored-by: natdeanlewissoftwire <nat.dean-lewis@softwire.com>
* Fix papertrail create version
---------
Co-authored-by: natdeanlewissoftwire <nat.dean-lewis@softwire.com>
* Update feature tests
* Remove old rake tasks
* Update some unit tests
* Update more tests
* More tests
* Fix failing sales household validation test
---------
Co-authored-by: Robert Sullivan <robert.sullivan@softwire.com>
* feat: validate nulls last in bu
* feat: add tests
* feat: update org errors and tests
* feat: update test copy
* feat: update tests
* CLDC-3328 Make bulk upload errors consistent between lettings and sales (#2341)
* feat: add validate_address_fields to lettings for 2024
* CLDC-3338: Add tolerance to discounted sale calculations (#2333)
* Rename method
* Update staircase/non staircase validations
* Add errors to type
* Remove validate_shared_ownership_deposit
* Don't add setup BU errors, deduplicate different sale type errors
* Add tolerance
* Reuse method
* Rename methods
* Skip type error completely in BU
* Update validation messages
* Update over tolerance method
* C:DC-3338: Add tolerance to grant calculations
---------
Co-authored-by: Kat <katrina@kosiak.co.uk>
* feat: add validate_address_fields to lettings for 2024
* feat: update tests
* Revert "CLDC-3338: Add tolerance to discounted sale calculations (#2333)"
This reverts commit cdecdfebfe.
---------
Co-authored-by: Robert Sullivan <Robert.Sullivan@Softwire.com>
Co-authored-by: Kat <katrina@kosiak.co.uk>
---------
Co-authored-by: Robert Sullivan <Robert.Sullivan@Softwire.com>
Co-authored-by: Kat <katrina@kosiak.co.uk>
* feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint
* feat: build out alternative routes through the address lookup flow
* refactor: lint
* refactor: remove commented lines
* feat: make nil safe
* feat: test address client
* feat: store address input separately
* feat: add migration
* feat: display inputs in answer label
* feat: update data presenter and test
* feat: revert precicions schema update
* feat: revert precision schema update
* feat: migrate new fields to sales logs
* feat: update shared log examples tests
* feat: use -1 for not listed address for extensibility
* feat: add service error to address_selection
* feat: handle case when no addresses are found
* feat: allow re-entering different uprns
* feat: improve error handling and don't accept "no match" precisions
* feat: add page tests
* feat: confirm uprn on address update
* feat: add question tests
* feat: don't set minimum match for initial search
* feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint
* feat: build out alternative routes through the address lookup flow
* refactor: lint
* refactor: remove commented lines
* feat: make nil safe
* feat: test address client
* feat: store address input separately
* feat: add migration
* feat: display inputs in answer label
* feat: update data presenter and test
* feat: revert precision schema update
* feat: migrate new fields to sales logs
* feat: update shared log examples tests
* feat: use -1 for not listed address for extensibility
* feat: add service error to address_selection
* feat: handle case when no addresses are found
* feat: allow re-entering different uprns
* feat: improve error handling and don't accept "no match" precisions
* feat: add page tests
* feat: confirm uprn on address update
* feat: add question tests
* feat: don't set minimum match for initial search
* feat: add no address found page
* feat: allow uprn known to be skipped, and set 0.4 min precision
* feat: accept best "good" match in bulk upload
* feat: update validations and test
* refactor: avoid stubbing using any_instance_of
* refactor: use change_table in migrations
* feat: add lettings behaviour to sales logs
* feat: update sales tests
* feat: xit test that is xited in lettings
* feat: stub os api in sales row parser
* feat: stub os api in sales row parser
* feat: add address line 1 to required attributes
* feat: update matching details and fix row parser validation
* refactor: improve readability
* feat: set uprns as option IDs to avoid multiple lookups
* feat: add sales uprn_selection
* feat: update schema
* feat: update tests
* feat: remove redundant methods
* feat: update error message and fix tests
* feat: update tests
* feat: update tests and error behaviour
* feat: update tests
* feat: update 24/25 lettings paper form
* feat: update renewal answer options accordingly
* refactor: remove extra spaces from other
* refactor: reorder field_118 and 119 in 2024 row parser
* Empty commit
* CLDC-3224: Parse noint correctly in bulk upload row parsers
* CLDC-3224: Add task to fix previous noint data
* CLDC-3224: Remove nonsensical value for noint field in bu test
* CLDC-3224: Move where bulk upload noint fix status is set to ensure it matches processing version
* Put BU noint_fix_status setting before creating any logs
* feat: update header and test
* feat: update answers and hint for 24/25 and test
* feat: update tests
* refactor: lint
* feat: update buyer 2 as well
* refactor: lint
* refactor: lint
* Add new ethnic option to BU
---------
Co-authored-by: Kat <katrina@kosiak.co.uk>
* Add new nationality columns
* Add nationality questions to lettings
* Add nationality questions to sales
* Infer nationality where appropriate
* Add synonyms
* Update csv exports
* Export nationality_all for 24/25
* Update prefers not to say value
* Set 24/25 nationality fields from BU
* Undo the export (there's a separate ticket)
* Correctly display answers
* Rebase fixes, tests and lint
* Set nationality from lettings BU 24/25
* Rename files, add synonyms and accents
* Fix sales csvs
* Extract constant
* Copy 23 BU files to 24
* Update field mapping
* Add duplicate log error to charges
* Check the sum of charges for duplicates
* update stub
* Only add charges to duplciate hash if they exist
* Rebase change
* Update columns
* Add tcharge back to error mapping
* Add prepare your file
* Add csv parser 24/25 cases
* Fix date check
* Rebase fix
* Copy 23 BU files to 24
* Renumber bulk upload fields for 2024
* Add prepare your file
* Update max columns
* Update fields in first_record_start_date
* Update managing org
* Rebase changes
* Blank commit for replication
* CLDC-3210: Check for R properly for sales BU savings field
* Sort refused check for income fields
* Add tests
* Allow any number of digits