-
Notifications
You must be signed in to change notification settings - Fork 17
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-1006: Add school part to TSP sync. #5279
Conversation
imports: [ | ||
LoggerModule, | ||
ConsoleWriterModule, | ||
...((Configuration.get('FEATURE_TSP_SYNC_ENABLED') as boolean) |
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.
This is not very intuitive or expandable easily. But we have no other use for this currently, so it is ok
|
||
const createdSchool = await this.tspSyncService.createSchool( | ||
system, | ||
tspSchool.schuleNummer ?? '', |
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.
I would argue that without schuleNummer the data is wrong and should be skipped and logged
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.
Done
tokenEndpoint: system.oauthConfig?.tokenEndpoint ?? '', | ||
}); | ||
|
||
const lastChangeDate = this.formatChangeDate(new Date(0)); |
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.
Set this to a Date 25 hours in the past. Alternatively use an ENV_VAR on how far to go back in time
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.
Done
apps/server/src/infra/sync/tsp/loggable/tsp-system-not-found.loggable-exception.ts
Show resolved
Hide resolved
} | ||
|
||
public async updateSchool(school: School, name: string): Promise<School> { | ||
school.name = name; |
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.
this will replace the name of the existing school with an empty name if there is no tspSchool.schuleName provided, should it do this?
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.
I think that is okay if that's the date sent from the TSP. Schulnummer like Alex pointed out would be more problematic
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.
I clarify this with PO
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.
If it is empty, please keep the old name
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.
Done
export class TspSchulnummerMissingLoggable implements Loggable { | ||
getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `A TSP school is missing a Schulnummer. Skipping school.`, |
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.
message: `A TSP school is missing a Schulnummer. Skipping school.`, | |
message: `A TSP school is missing a Schulnummer. This school is skipped`, |
systemService.find.mockResolvedValueOnce([]); | ||
}; | ||
|
||
it('should throw', async () => { |
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.
it('should throw', async () => { | |
it('should throw a TspSystemNotFound exception', async () => { |
export class TspSchulnummerMissingLoggable implements Loggable { | ||
getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `A TSP school is missing a Schulnummer. This school is skipped.`, |
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.
After talking to PO, we can log the Schoolname here to help with support
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.
Done
Quality Gate passedIssues Measures |
Description
Adds the sync of schools in the new NestJS TSP Sync.
Links to Tickets or other pull requests
Approval for review
generate-client:server
was executed in vue frontend and changes were tested and put in a PR with the same branch name.