Skip to content

BC-11265 - hide deleted users#6113

Open
virgilchiriac wants to merge 13 commits intomainfrom
BC-11265-hide-deleted-users
Open

BC-11265 - hide deleted users#6113
virgilchiriac wants to merge 13 commits intomainfrom
BC-11265-hide-deleted-users

Conversation

@virgilchiriac
Copy link
Contributor

@virgilchiriac virgilchiriac commented Feb 10, 2026

Description

Links to Tickets or other pull requests

BC-11265
hpi-schul-cloud/nuxt-client#4077
hpi-schul-cloud/schulcloud-client#3756

Changes

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

@virgilchiriac virgilchiriac marked this pull request as ready for review February 10, 2026 21:05
@virgilchiriac virgilchiriac requested a review from uidp February 11, 2026 17:15
deletionRequest,
});
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this functionality couldn't be implemented in one single place so that both UCs can use it. But user and account do actually live in different modules and maybe writing a sperate service for that would be overkill. Just a thought.


public static deletedFilter(query: UserSearchQuery, deletionDate?: Date): void {
query['$or'] = [{ deletedAt: { $exists: false } }, { deletedAt: null }, { deletedAt: { $gte: deletionDate } }];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor thought about naming: Maybe better use an imperative name like setDeletionFilter to be consistent with the other functions?

const user = await this.findById(userId);
user.deletedAt = deletedAt ?? new Date();
this._em.persist(user);
await this._em.flush();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could even bypass the entity manager and use a native query.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants