Task #11564
[SCP ID :##5774##] : Deleted user still received email for Approval
Status: | Work Completed-End life cycle | Start date: | May 03, 2021 | |
---|---|---|---|---|
Priority: | Normal | Due date: | May 05, 2021 | |
Assignee: | Zahir Abd Latif | % Done: | 100% | |
Category: | - | Spent time: | - | |
Target version: | - |
Description
Hi,
Kindly attend below request:-
IBAM Checker has been deleted from IBAM User Manager but still received email for Approval Application.
Scenario:
1. Delete IBAM User (UKB Checker) from IBAM User Manager
2. UKB Maker create new application
3. Deleted user (UKB Checker) still received email for approval
History
#1 Updated by Ngoh Chee Ping over 3 years ago
- Assignee changed from Nurul Athira Abdul Rahim to Lai Wen Hong
Please help to fix this issue.
#2 Updated by Lai Wen Hong over 3 years ago
- Status changed from New - Begin Life Cycle to Code Review
- Assignee changed from Lai Wen Hong to Najmi Pasarudin
- % Done changed from 0 to 100
Please help doing code review.
The condition that ensures the email is sent to valid checkers for Approval Application had been added.
#3 Updated by Najmi Pasarudin over 3 years ago
- File pic1.png added
- Assignee changed from Najmi Pasarudin to Lai Wen Hong
- % Done changed from 100 to 50
Hi Wen Hong,
Your code fix is working but you only updated at 2 codes. There are 5 similar codes.
I recommend you to filter user status at getAdminUserProfileDAO().getUsersByStateCodeRole. By doing this, the fix is applied to all codes.
Please refer to attached screenshot.
#4 Updated by Lai Wen Hong over 3 years ago
- Assignee changed from Lai Wen Hong to Najmi Pasarudin
Hi Najmi,
I completed the code that filters user status at getAdminUserProfileDAO().getUsersByStateCodeRole.
Please help doing code review.
Thanks.
#5 Updated by Najmi Pasarudin over 3 years ago
- File pic2.png added
- Assignee changed from Najmi Pasarudin to Lai Wen Hong
Hi Wen Hong,
Your code fix works. But I recommend updating the Criteria. Please refer method 'public List<AdminUserProfile> getUsersGroup(long groupId)'
Referring to pic2.png, your code has 2 list cycles. If the result list has, for example 1,000,000 users, the second cycle will take time to complete because the code will compare each user status one by one.
#6 Updated by Lai Wen Hong over 3 years ago
- Assignee changed from Lai Wen Hong to Najmi Pasarudin
Hi Najmi,
I completed updating it to Criteria method for filtering DELETED users.
Please help checking it.
Thanks.
#7 Updated by Najmi Pasarudin over 3 years ago
- Assignee changed from Najmi Pasarudin to Lai Wen Hong
Please ignore
Hi Wen Hong,
Please understand how to manipulate class Criteria. Do not copy paste without understanding the reference.
Fix as below:
getSession().beginTransaction();
Criteria crit = getSession().createCriteria(AdminUserProfile.class);
crit.add(Restrictions.eq("userState", stateCode));
crit.add(Restrictions.eq("userAdminRole", role));
Criteria userCrit = crit.createCriteria("mainProfile"); no reason to create new Criteria. mainProfile is for JOIN function
userCrit.add(Restrictions.ne("userState", USER_STATUS.DELETED.getValue()));
userList =userCrit.list();
TO
getSession().beginTransaction();
Criteria crit = getSession().createCriteria(AdminUserProfile.class);
crit.add(Restrictions.eq("userState", stateCode));
crit.add(Restrictions.eq("userAdminRole", role));
crit.add(Restrictions.ne("userState", USER_STATUS.DELETED.getValue()));
userList = crit.list();
#8 Updated by Najmi Pasarudin over 3 years ago
Hi Wen Hong,
Code is good. Please comment the Issue, Finding, Solution and Test steps.
#9 Updated by Lai Wen Hong over 3 years ago
- Tracker changed from Support to Task
- Status changed from Code Review to Pending SIT Deployment
- Assignee changed from Lai Wen Hong to Najmi Pasarudin
- % Done changed from 50 to 0
Hi Najmi,
The Issue, Finding, Solution and Test steps are added.
Thanks.
Issue:
IBAM Checker has been deleted from IBAM User Manager but still received email for Approval Application.
Finding:
A condition needs to be added to filter DELETED users (including IBAM Maker and Checker) before processing email.
Solution:
In getAdminUserProfileDAO().getUsersByStateCodeRole method, restriction is added to filter DELETED users out of valid users.
-----
Criteria userCrit = crit.createCriteria("mainProfile");
userCrit.add(Restrictions.ne("userState", USER_STATUS.DELETED.getValue()));
-----
- Maker: IBAM > CORPORATE BACK END > CDB Application
- Create new application / Edit existing application
- Press submit button at confirmation page
- System will send email to valid Checkers for Approval and display page with "submitted and pending for approval" message.
Updated Test steps:
- Select an IBAM checker with testing email. For example, user AHMAD with State Kuala Lumpur
- Access IBAM>BBE>Admin User Management>Delete user
- Access IBAM > CORPORATE BACK END > CDB Application
- Create new application / Edit existing application with State Kuala Lumpur
- Press submit button at confirmation page
- Expected result, IBAM will send email to valid Checkers for Approval and display page with "submitted and pending for approval" message. Deleted user will not receive an email.
#10 Updated by Najmi Pasarudin over 3 years ago
- Status changed from Pending SIT Deployment to Internal Testing
- Assignee changed from Najmi Pasarudin to Erni Suhaireen Zulkifli
- % Done changed from 0 to 90
SIT deployed on 18/03/2021
#11 Updated by Erni Suhaireen Zulkifli over 3 years ago
- Status changed from Internal Testing to Development / Work In Progress
- Assignee changed from Erni Suhaireen Zulkifli to Lai Wen Hong
- % Done changed from 90 to 80
Hi Weng Hong,
After test, found that the deleted checker still receive one of the email "IBAM Pending Approval: Create Application Form".
Kindly recheck on this.
#12 Updated by Lai Wen Hong over 3 years ago
- File pic3.jpeg added
- Status changed from Development / Work In Progress to Internal Testing
- Assignee changed from Lai Wen Hong to Erni Suhaireen Zulkifli
- % Done changed from 80 to 90
Hi Erni,
I found that line 215 (sendEmailtoChecker) might be the cause but I could not fix it as this is not from my branch, it might be issue from branch 'email to checker'.
#13 Updated by Erni Suhaireen Zulkifli over 3 years ago
- File Support 11564 SCPID 5774.docx added
- Status changed from Internal Testing to System Integration Test
- Assignee changed from Erni Suhaireen Zulkifli to Nurul Athira Abdul Rahim
- % Done changed from 90 to 100
Tested and passed at SIT
#14 Updated by Nurul Athira Abdul Rahim over 3 years ago
- Status changed from System Integration Test to Pending UAT Deployment
- Assignee changed from Nurul Athira Abdul Rahim to Najmi Pasarudin
Tested and Passed on SIT (15/4/2021)
Kindly deploy the fixes to UAT environment.
Thank you
#15 Updated by Najmi Pasarudin over 3 years ago
- Status changed from Pending UAT Deployment to User Acceptance Test
- Assignee changed from Najmi Pasarudin to Nurul Athira Abdul Rahim
UAT deployed on 16/04/2021
#16 Updated by Nurul Athira Abdul Rahim over 3 years ago
- Due date set to May 05, 2021
- Status changed from User Acceptance Test to Pending Prod Deployment
- Assignee changed from Nurul Athira Abdul Rahim to Najmi Pasarudin
- Start date changed from March 03, 2021 to May 03, 2021
Tested and passed by Mazni on 27/4/21
Please prepare for preprod deployment.
#17 Updated by Najmi Pasarudin over 3 years ago
- Status changed from Pending Prod Deployment to Pending Review
- Assignee changed from Najmi Pasarudin to Nurul Athira Abdul Rahim
Production deployed on 07/05/2021
#18 Updated by Nurul Athira Abdul Rahim about 3 years ago
- Status changed from Pending Review to Work Completed-End life cycle
- Assignee changed from Nurul Athira Abdul Rahim to Zahir Abd Latif
Migration ID0033