Skip to content

Commit

Permalink
fix: Ce 1127 (#694)
Browse files Browse the repository at this point in the history
Co-authored-by: afwilcox <alecwilcox@gmail.com>
  • Loading branch information
gregorylavery and afwilcox authored Oct 12, 2024
1 parent 70f8b02 commit b8aae06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 8 additions & 2 deletions backend/src/v1/staging_complaint/staging_complaint.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,6 @@ BEGIN
WHERE complaint_identifier = _complaint_identifier;
update_edit_ind = true;
end if;

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;

-- the update caused an edit, set the audit fields
if (update_edit_ind) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b8aae06

Please sign in to comment.