-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Maximilian Kreuzkam <[email protected]>
- Loading branch information
1 parent
78fccf6
commit 3da994a
Showing
34 changed files
with
890 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
apps/server/src/infra/sync/tsp/loggable/tsp-students-fetched.loggable.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TspStudentsFetchedLoggable } from './tsp-students-fetched.loggable'; | ||
|
||
describe(TspStudentsFetchedLoggable.name, () => { | ||
let loggable: TspStudentsFetchedLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspStudentsFetchedLoggable(10); | ||
}); | ||
|
||
describe('when loggable is initialized', () => { | ||
it('should be defined', () => { | ||
expect(loggable).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('getLogMessage', () => { | ||
it('should return a log message', () => { | ||
expect(loggable.getLogMessage()).toEqual({ | ||
message: `Fetched 10 students for migration from TSP`, | ||
data: { | ||
tspStudentCount: 10, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/server/src/infra/sync/tsp/loggable/tsp-students-fetched.loggable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspStudentsFetchedLoggable implements Loggable { | ||
constructor(private readonly tspStudentCount: number) {} | ||
|
||
public getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `Fetched ${this.tspStudentCount} students for migration from TSP`, | ||
data: { | ||
tspStudentCount: this.tspStudentCount, | ||
}, | ||
}; | ||
|
||
return message; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
apps/server/src/infra/sync/tsp/loggable/tsp-students-migrated.loggable.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TspStudentsMigratedLoggable } from './tsp-students-migrated.loggable'; | ||
|
||
describe(TspStudentsMigratedLoggable.name, () => { | ||
let loggable: TspStudentsMigratedLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspStudentsMigratedLoggable(10); | ||
}); | ||
|
||
describe('when loggable is initialized', () => { | ||
it('should be defined', () => { | ||
expect(loggable).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('getLogMessage', () => { | ||
it('should return a log message', () => { | ||
expect(loggable.getLogMessage()).toEqual({ | ||
message: `Migrated students: 10 students migrated`, | ||
data: { | ||
migratedStudents: 10, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/server/src/infra/sync/tsp/loggable/tsp-students-migrated.loggable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspStudentsMigratedLoggable implements Loggable { | ||
constructor(private readonly migratedStudents: number) {} | ||
|
||
public getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `Migrated students: ${this.migratedStudents} students migrated`, | ||
data: { | ||
migratedStudents: this.migratedStudents, | ||
}, | ||
}; | ||
|
||
return message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
apps/server/src/infra/sync/tsp/loggable/tsp-teachers-fetched.loggable.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TspTeachersFetchedLoggable } from './tsp-teachers-fetched.loggable'; | ||
|
||
describe(TspTeachersFetchedLoggable.name, () => { | ||
let loggable: TspTeachersFetchedLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspTeachersFetchedLoggable(10); | ||
}); | ||
|
||
describe('when loggable is initialized', () => { | ||
it('should be defined', () => { | ||
expect(loggable).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('getLogMessage', () => { | ||
it('should return a log message', () => { | ||
expect(loggable.getLogMessage()).toEqual({ | ||
message: `Fetched 10 teachers for migration from TSP`, | ||
data: { | ||
tspTeacherCount: 10, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/server/src/infra/sync/tsp/loggable/tsp-teachers-fetched.loggable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspTeachersFetchedLoggable implements Loggable { | ||
constructor(private readonly tspTeacherCount: number) {} | ||
|
||
public getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `Fetched ${this.tspTeacherCount} teachers for migration from TSP`, | ||
data: { | ||
tspTeacherCount: this.tspTeacherCount, | ||
}, | ||
}; | ||
|
||
return message; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
apps/server/src/infra/sync/tsp/loggable/tsp-teachers-migrated.loggable.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TspTeachersMigratedLoggable } from './tsp-teachers-migrated.loggable'; | ||
|
||
describe(TspTeachersMigratedLoggable.name, () => { | ||
let loggable: TspTeachersMigratedLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspTeachersMigratedLoggable(10); | ||
}); | ||
|
||
describe('when loggable is initialized', () => { | ||
it('should be defined', () => { | ||
expect(loggable).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('getLogMessage', () => { | ||
it('should return a log message', () => { | ||
expect(loggable.getLogMessage()).toEqual({ | ||
message: `Migrated teachers: 10 teachers migrated`, | ||
data: { | ||
migratedTeachers: 10, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/server/src/infra/sync/tsp/loggable/tsp-teachers-migrated.loggable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspTeachersMigratedLoggable implements Loggable { | ||
constructor(private readonly migratedTeachers: number) {} | ||
|
||
public getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `Migrated teachers: ${this.migratedTeachers} teachers migrated`, | ||
data: { | ||
migratedTeachers: this.migratedTeachers, | ||
}, | ||
}; | ||
|
||
return message; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
apps/server/src/infra/sync/tsp/loggable/tsp-users-migrated.loggable.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TspUsersMigratedLoggable } from './tsp-users-migrated.loggable'; | ||
|
||
describe(TspUsersMigratedLoggable.name, () => { | ||
let loggable: TspUsersMigratedLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspUsersMigratedLoggable(10); | ||
}); | ||
|
||
describe('when loggable is initialized', () => { | ||
it('should be defined', () => { | ||
expect(loggable).toBeDefined(); | ||
}); | ||
}); | ||
|
||
describe('getLogMessage', () => { | ||
it('should return a log message', () => { | ||
expect(loggable.getLogMessage()).toEqual({ | ||
message: `Migrated users: 10 users migrated`, | ||
data: { | ||
migratedUsers: 10, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/server/src/infra/sync/tsp/loggable/tsp-users-migrated.loggable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspUsersMigratedLoggable implements Loggable { | ||
constructor(private readonly migratedUsers: number) {} | ||
|
||
public getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `Migrated users: ${this.migratedUsers} users migrated`, | ||
data: { | ||
migratedUsers: this.migratedUsers, | ||
}, | ||
}; | ||
|
||
return message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.