@@ -31,7 +31,7 @@ public interface IUsersService
3131 IList < UserRole > UpdateRolesForUser ( int userId , List < UserRole > userRolesToUpdate ) ;
3232 Task < int > DeleteAllUsers ( ) ;
3333 Task DeleteRegistrationsOlderThan ( bool notify , int daysToKeepPendingRegistration ) ;
34- Task DeleteInActiveAccountsOlderThan ( bool notify , int yearsToKeepPendingRegistration ) ;
34+ Task DeleteInactiveAccountsOlderThan ( bool notify , int yearsToKeepPendingRegistration ) ;
3535 IList < User > GetUsersByOrganisationId ( int organisationId ) ;
3636 UsersAndJobIdsForOrganisation GetUsersAndJobIdsByOrganisationId ( int organisationId ) ;
3737 }
@@ -503,38 +503,38 @@ public async Task DeleteRegistrationsOlderThan(bool notify, int daysToKeepPendin
503503 _logger . LogWarning ( $ "DeleteRegistrationsOlderThan - Total records deleted : { recordsDeleted } ") ;
504504 }
505505
506- public async Task DeleteInActiveAccountsOlderThan ( bool notify , int yearsToKeepInActiveAcounts )
506+ public async Task DeleteInactiveAccountsOlderThan ( bool notify , int yearsToKeepInactiveAcounts )
507507 {
508- _logger . LogWarning ( $ "DeleteInActiveAccountsOlderThan - Deleting Inactive Accounts Older Than { yearsToKeepInActiveAcounts } years.") ; //extra logging here in order to verify that the scheduled task is running via kibana.
508+ _logger . LogWarning ( $ "DeleteInActiveAccountsOlderThan - Deleting Inactive Accounts Older Than { yearsToKeepInactiveAcounts } years.") ; //extra logging here in order to verify that the scheduled task is running via kibana.
509509
510- var allUsersWithInActiveAccountsOverAge = _context . GetInActiveUsersOverAge ( yearsToKeepInActiveAcounts ) . ToList ( ) ;
510+ var allUsersWithInactiveAccountsOverAge = _context . GetInActiveUsersOverAge ( yearsToKeepInactiveAcounts ) . ToList ( ) ;
511511
512- if ( ! allUsersWithInActiveAccountsOverAge . Any ( ) )
512+ if ( ! allUsersWithInactiveAccountsOverAge . Any ( ) )
513513 {
514514 _logger . LogWarning ( "DeleteInActiveAccountsOlderThan - No records found to delete. exiting" ) ;
515515 return ;
516516 }
517517
518- var uniqueEmailAddresses = allUsersWithInActiveAccountsOverAge . Select ( u => u . EmailAddress ) . Distinct ( ) . ToList ( ) ;
519- if ( uniqueEmailAddresses . Count ( ) != allUsersWithInActiveAccountsOverAge . Count ( ) )
518+ var uniqueEmailAddresses = allUsersWithInactiveAccountsOverAge . Select ( u => u . EmailAddress ) . Distinct ( ) . ToList ( ) ;
519+ if ( uniqueEmailAddresses . Count ( ) != allUsersWithInactiveAccountsOverAge . Count ( ) )
520520 {
521521 _logger . LogWarning ( "Inactive accounts exist for the same email address." ) ;
522522 }
523523
524524 //1. delete user accounts: allUsersWithInActiveAccountsOverAge
525- var recordsDeleted = await _context . DeleteUsers ( allUsersWithInActiveAccountsOverAge ) ;
525+ var recordsDeleted = await _context . DeleteUsers ( allUsersWithInactiveAccountsOverAge ) ;
526526
527527 //2. delete user account in auth0
528- foreach ( var user in allUsersWithInActiveAccountsOverAge )
528+ foreach ( var user in allUsersWithInactiveAccountsOverAge )
529529 {
530530 await _providerManagementService . DeleteUser ( user . NameIdentifier ) ;
531531 }
532532
533533 //3. send notification to the email addresses, one email per email address.
534534 if ( notify )
535- _emailService . SendInActiveAccountRemovalNotifications ( uniqueEmailAddresses ) ;
535+ _emailService . SendInactiveAccountRemovalNotifications ( uniqueEmailAddresses ) ;
536536
537- _logger . LogWarning ( $ "DeleteInActiveAccountsOlderThan - Total records deleted: { recordsDeleted } ") ;
537+ _logger . LogWarning ( $ "DeleteInactiveAccountsOlderThan - Total records deleted: { recordsDeleted } ") ;
538538
539539 }
540540
0 commit comments