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

fix: Ce 1127 #694

Merged
merged 8 commits into from
Oct 12, 2024
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
Loading