-
Notifications
You must be signed in to change notification settings - Fork 14
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
#2741 - Ministry Filter Search Programs and Offerings [Fix Expired Programs Sort Issue] #3921
#2741 - Ministry Filter Search Programs and Offerings [Fix Expired Programs Sort Issue] #3921
Conversation
sources/packages/backend/apps/api/src/services/education-program/education-program.service.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks and we should go ahead with it. The logic with the active and expiration is just something to be improved. Forcing it as a regular status just brings complexities that don`t feel worth it.
On the SQL command, there are SQL reserved worked in upper case and others in lower case.
We should try to stick with one or another IMO.=, not a blocker, hence approving.
WHEN programs.programStatus = '${ProgramStatus.Approved}' and programs.isActive = true THEN ${SortPriority.Priority2} | ||
WHEN programs.programStatus = '${ProgramStatus.Declined}' and programs.isActive = true THEN ${SortPriority.Priority3} | ||
WHEN programs.isActive = false THEN ${SortPriority.Priority4} | ||
WHEN programs.programStatus = '${ProgramStatus.Pending}' and programs.isActive = true and (programs.effectiveEndDate is null OR programs.effectiveEndDate > CURRENT_DATE) THEN ${SortPriority.Priority1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the TODO comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a minor comment to remove the TODO comment.
Quality Gate passedIssues Measures |
As a part of this PR, the query to retrieve the list of programs was updated to ensure that the sort order of the retrieved list of programs has the correct order where the inactive programs comprise the programs that have
isActive = false
or the ones that have theeffectiveEndDate <= CURRENT_DATE