Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update existing data requests #2427

Conversation

lucas-shaw
Copy link
Contributor

@lucas-shaw lucas-shaw commented Jul 29, 2024

Description

Update the Data Requests process flow to use Data Request Areas

Self-review checklist

  • (1) Quick stakeholder demo done OR
  • (2) ...bug with before and after screenshots
  • (3) Tests passing
  • (4) Branch ready to be merged (not work in progress)
  • (5) No superfluous changes in diff
  • (6) No TODO's without new ticket numbers
  • (7) PR Prefixed with ticket number e.g. CT-7654 ...
  • (8) Data migration script is created if any of letter templates is changed

Screenshots

Related JIRA tickets

https://dsdmoj.atlassian.net/jira/software/c/projects/CDPT/boards/1152?selectedIssue=CDPT-1849
https://dsdmoj.atlassian.net/jira/software/c/projects/CDPT/boards/1152?selectedIssue=CDPT-1857
https://dsdmoj.atlassian.net/jira/software/c/projects/CDPT/boards/1152?selectedIssue=CDPT-1851

Deployment

Manual testing instructions

@@ -8,7 +8,7 @@
let(:decorated) { data_request_area.decorate }

it "uses location string" do
expect(decorated.location).to eq data_request_area.location
expect(decorated.location).to eq decorated.contact.name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test correct? It's the same as the next one

@@ -84,13 +84,14 @@ class FakeError < ArgumentError; end
describe "#log_message" do
it "creates a human readable case history message" do
service.call
expect(CaseTransition.last.message).to eq "HMP Brixton, All prison records: pages changed from 0 to 21"

expect(CaseTransition.last.message).to eq "HMP Brixton All prison records: pages changed from 0 to 21"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the comma be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as below

@@ -1616,7 +1629,7 @@ en:
date_to_copy: Request all data held up until this date
onwards: "onwards"
update:
log_message_pages_changed: "%{location}, %{request_type}: pages changed from %{old_pages} to %{new_pages}"
log_message_pages_changed: "%{location} %{request_type}: pages changed from %{old_pages} to %{new_pages}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the comma be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this and the above, if a data request is edited but there isnt yet a location set for the data request area, the case history will show as

", All prison records: pages ..."

Could do something dynamic to write the comma if its worth keeping it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should be able to add a data request without a location so that's probably something that needs to change. On that basis I wouldn't remove the comma.

let(:decorated) { data_request_area.decorate }

it "returns the count of data_requests" do
create(:data_request, data_request_area:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use create_list to create multiple items


context "without linked organisation" do
let(:decorated) { data_request.decorate }

it "uses location string" do
expect(decorated.location).to eq data_request.location
expect(decorated.location).to eq data_request_area.contact.name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test seems wrong.

Copy link
Contributor

@vertism vertism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work!

@lucas-shaw lucas-shaw merged commit 5b4dc29 into cdpt-1850-commissioning-and-chase-redesign Sep 10, 2024
13 of 14 checks passed
@lucas-shaw lucas-shaw deleted the cdpt-1858-update-existing-data-requests branch September 10, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants