From cf5a20ae4d6c52920fea8e5f774477d4629314bc Mon Sep 17 00:00:00 2001 From: gregorylavery <100631366+gregorylavery@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:08:42 -0700 Subject: [PATCH 1/4] Defaults new CEEB complaints to always be Open. Ignores any status change on complaints via an edit by WebEOC. --- .../R__0.20.0_edit_complaint_using_webeoc_complaint.sql | 4 +--- .../migrations/R__update-insert-complaint-from-staging.sql | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql b/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql index e26f626a3..2845daea1 100644 --- a/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql +++ b/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql @@ -252,10 +252,8 @@ BEGIN update_edit_ind = true; end if; + -- Remove the updates to the status but preserve the logic on indicators if (_edit_complaint_status_code <> current_complaint_record.complaint_status_code) then - UPDATE complaint - SET complaint_status_code = _edit_complaint_status_code - WHERE complaint_identifier = _complaint_identifier; update_edit_ind = true; end if; diff --git a/migrations/migrations/R__update-insert-complaint-from-staging.sql b/migrations/migrations/R__update-insert-complaint-from-staging.sql index 0b4e8f389..f4a052918 100644 --- a/migrations/migrations/R__update-insert-complaint-from-staging.sql +++ b/migrations/migrations/R__update-insert-complaint-from-staging.sql @@ -342,7 +342,7 @@ OR REPLACE FUNCTION public.insert_complaint_from_staging (_complaint_identifier IF _violation_code = 'WASTE' OR _violation_code = 'PESTICDE' THEN UPDATE PUBLIC.complaint - SET owned_by_agency_code = 'EPO' + SET owned_by_agency_code = 'EPO', complaint_status_code = 'OPEN' WHERE complaint_identifier = _complaint_identifier; END IF; From f607a65269d22bd2ba78a5bb19fd7a5aefe8a714 Mon Sep 17 00:00:00 2001 From: gregorylavery <100631366+gregorylavery@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:17:51 -0700 Subject: [PATCH 2/4] Updated to remove change notification when status updated in WebEOC. --- frontend/.vscode/launch.json | 15 +++++++++++++++ ...20.0_edit_complaint_using_webeoc_complaint.sql | 5 ----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 frontend/.vscode/launch.json diff --git a/frontend/.vscode/launch.json b/frontend/.vscode/launch.json new file mode 100644 index 000000000..9c243a03a --- /dev/null +++ b/frontend/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql b/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql index 2845daea1..b4b3f5e34 100644 --- a/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql +++ b/migrations/migrations/R__0.20.0_edit_complaint_using_webeoc_complaint.sql @@ -251,11 +251,6 @@ BEGIN WHERE complaint_identifier = _complaint_identifier; update_edit_ind = true; end if; - - -- Remove the updates to the status but preserve the logic on indicators - if (_edit_complaint_status_code <> current_complaint_record.complaint_status_code) then - update_edit_ind = true; - end if; -- the update caused an edit, set the audit fields if (update_edit_ind) then From bbd1bfe40b99f78c3d05e19d553cdb64018af4ce Mon Sep 17 00:00:00 2001 From: gregorylavery <100631366+gregorylavery@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:19:54 -0700 Subject: [PATCH 3/4] Delete frontend/.vscode/launch.json Added in error. --- frontend/.vscode/launch.json | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 frontend/.vscode/launch.json diff --git a/frontend/.vscode/launch.json b/frontend/.vscode/launch.json deleted file mode 100644 index 9c243a03a..000000000 --- a/frontend/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:3000", - "webRoot": "${workspaceFolder}" - } - ] -} \ No newline at end of file From b90eaa7999fa28756ddc28b995c9d546e1963584 Mon Sep 17 00:00:00 2001 From: afwilcox Date: Fri, 11 Oct 2024 14:20:10 -0700 Subject: [PATCH 4/4] fix: ignore status change on edit identification --- .../v1/staging_complaint/staging_complaint.service.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/src/v1/staging_complaint/staging_complaint.service.ts b/backend/src/v1/staging_complaint/staging_complaint.service.ts index ac04b89bd..94512355d 100644 --- a/backend/src/v1/staging_complaint/staging_complaint.service.ts +++ b/backend/src/v1/staging_complaint/staging_complaint.service.ts @@ -102,8 +102,14 @@ export class StagingComplaintService { // Given two WebEOCComplaint objects, compare them and return true if they're the same. This function // ignores some attributes (specifically the back_number_of* attributes) _compareWebEOCComplaints = (complaint1: WebEOCComplaint, complaint2: WebEOCComplaint): boolean => { - // Attributes to ignore - const attributesToIgnore = ["back_number_of_days", "back_number_of_hours", "back_number_of_minutes", "entrydate"]; + // Attributes to ignore, if these are changed we don't consider it an edit + const attributesToIgnore = [ + "back_number_of_days", + "back_number_of_hours", + "back_number_of_minutes", + "entrydate", + "status", + ]; // Omit the attributes to ignore const complaint1Filtered = omit(complaint1, attributesToIgnore);