Skip to content
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

EW-999 adding school change and classes provisioning to tsp sync #5237

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

psachmann
Copy link
Contributor

@psachmann psachmann commented Sep 12, 2024

Description

Adding class provisioning and school change functionality during a tsp sync.

Links to Tickets or other pull requests

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.

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.

@psachmann psachmann changed the title Ew 999 EW-999 adding school change and classes provisioning to tsp sync Sep 13, 2024
@psachmann psachmann marked this pull request as ready for review September 13, 2024 10:53
@alweber-cap alweber-cap self-requested a review September 16, 2024 14:45

private static getBaseProps(): ClassProps {
return {
id: '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Empty IDs are dangerous. Create a new one already here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@psachmann psachmann self-assigned this Sep 17, 2024
private readonly accountService: AccountService
) {}

public async findSchoolOrFail(system: ProvisioningSystemDto, school: ExternalSchoolDto): Promise<School> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This sounds like a function that should rather exists in the SchoolModule, but I won't insist on it now

if (existingUser && school.externalId === data.externalSchool?.externalId) {
// Case: User exists and school is the same -> update user
user = await this.updateUser(existingUser, data.externalUser, roleRefs, school.id);
} else if (existingUser && school.id !== data.externalSchool?.externalId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be school.externalId?

Suggested change
} else if (existingUser && school.id !== data.externalSchool?.externalId) {
} else if (existingUser && school.externalId !== data.externalSchool?.externalId) {

schoolId: string
): Promise<UserDO> {
if (!externalUser.firstName || !externalUser.lastName || !externalUser.email) {
throw new BadDataLoggableException('User firstname, lastname and email is missing', { externalUser });
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
throw new BadDataLoggableException('User firstname, lastname and email is missing', { externalUser });
throw new BadDataLoggableException('User firstname, lastname or email is missing', { externalUser });

Copy link

sonarcloud bot commented Sep 20, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Uncovered Lines on New Code (required ≤ 0)

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants