Skip to content

Commit

Permalink
Merge pull request #1101 from bcgov/feature/ALCS-744-3
Browse files Browse the repository at this point in the history
Update Inbox SQL to only show Submitted Apps to L/FNG
  • Loading branch information
dhaselhan authored Oct 26, 2023
2 parents d84e0f0 + 5c18b29 commit 8a5de8a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,11 @@ export class InboxApplicationService {
where += ' OR appSearch.bceid_business_guid = :bceidBusinessGuid';
}
if (governmentUuid) {
where +=
' OR (appSearch.local_government_uuid = :governmentUuid AND appSearch.date_submitted_to_alc IS NOT NULL)';
where += ` OR (appSearch.local_government_uuid = :governmentUuid AND (appSearch.date_submitted_to_alc IS NOT NULL OR appSearch.status ->> 'status_type_code' IN ('REVG', 'SUBG')))`;
}
} else {
if (searchDto.filterBy === 'submitted') {
where = 'appSearch.local_government_uuid = :governmentUuid';
where = `appSearch.local_government_uuid = :governmentUuid AND (appSearch.date_submitted_to_alc IS NOT NULL OR appSearch.status ->> 'status_type_code' IN ('REVG', 'SUBG'))`;
} else {
where =
'(appSearch.created_by_uuid = :userUuid OR appSearch.bceid_business_guid = :bceidBusinessGuid)';
Expand Down Expand Up @@ -177,9 +176,12 @@ export class InboxApplicationService {
}

if (searchDto.civicAddress) {
query = query.andWhere('LOWER(parcel.civic_address) like LOWER(:civic_address)', {
civic_address: `%${searchDto.civicAddress}%`.toLowerCase(),
});
query = query.andWhere(
'LOWER(parcel.civic_address) like LOWER(:civic_address)',
{
civic_address: `%${searchDto.civicAddress}%`.toLowerCase(),
},
);
}
return query;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export class InboxNoticeOfIntentService {
}
} else {
if (searchDto.filterBy === 'submitted') {
where = 'noiSearch.local_government_uuid = :governmentUuid';
where =
'noiSearch.local_government_uuid = :governmentUuid AND noiSearch.date_submitted_to_alc IS NOT NULL';
} else {
where =
'(noiSearch.created_by_uuid = :userUuid OR noiSearch.bceid_business_guid = :bceidBusinessGuid)';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export class InboxNotificationService {
}
} else {
if (searchDto.filterBy === 'submitted') {
where = 'notificationSearch.local_government_uuid = :governmentUuid';
where =
'notificationSearch.local_government_uuid = :governmentUuid AND notificationSearch.date_submitted_to_alc IS NOT NULL';
} else {
where =
'(notificationSearch.created_by_uuid = :userUuid OR notificationSearch.bceid_business_guid = :bceidBusinessGuid)';
Expand Down

0 comments on commit 8a5de8a

Please sign in to comment.