-
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.
Merge branch 'main' into BC-8348-copy-share-board
- Loading branch information
Showing
40 changed files
with
1,447 additions
and
620 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20 | ||
22 |
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
23 changes: 23 additions & 0 deletions
23
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-migration-start.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,23 @@ | ||
import { TspLegacyMigrationStartLoggable } from './tsp-legacy-migration-start.loggable'; | ||
|
||
describe(TspLegacyMigrationStartLoggable.name, () => { | ||
let loggable: TspLegacyMigrationStartLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspLegacyMigrationStartLoggable(); | ||
}); | ||
|
||
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: 'Running migration of legacy tsp data.', | ||
}); | ||
}); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-migration-start.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,11 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspLegacyMigrationStartLoggable implements Loggable { | ||
getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: 'Running migration of legacy tsp data.', | ||
}; | ||
|
||
return message; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-migration-system-missing.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,23 @@ | ||
import { TspLegacyMigrationSystemMissingLoggable } from './tsp-legacy-migration-system-missing.loggable'; | ||
|
||
describe(TspLegacyMigrationSystemMissingLoggable.name, () => { | ||
let loggable: TspLegacyMigrationSystemMissingLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspLegacyMigrationSystemMissingLoggable(); | ||
}); | ||
|
||
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: 'No legacy system found', | ||
}); | ||
}); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-migration-system-missing.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,11 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspLegacyMigrationSystemMissingLoggable implements Loggable { | ||
getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: 'No legacy system found', | ||
}; | ||
|
||
return message; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-school-migration-count.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 { TspLegacySchoolMigrationCountLoggable } from './tsp-legacy-school-migration-count.loggable'; | ||
|
||
describe(TspLegacySchoolMigrationCountLoggable.name, () => { | ||
let loggable: TspLegacySchoolMigrationCountLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspLegacySchoolMigrationCountLoggable(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: `Found 10 legacy tsp schools to migrate`, | ||
data: { | ||
total: 10, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-school-migration-count.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 TspLegacySchoolMigrationCountLoggable implements Loggable { | ||
constructor(private readonly total: number) {} | ||
|
||
getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `Found ${this.total} legacy tsp schools to migrate`, | ||
data: { | ||
total: this.total, | ||
}, | ||
}; | ||
|
||
return message; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-school-migration-success.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,27 @@ | ||
import { TspLegacySchoolMigrationSuccessLoggable } from './tsp-legacy-school-migration-success.loggable'; | ||
|
||
describe(TspLegacySchoolMigrationSuccessLoggable.name, () => { | ||
let loggable: TspLegacySchoolMigrationSuccessLoggable; | ||
|
||
beforeAll(() => { | ||
loggable = new TspLegacySchoolMigrationSuccessLoggable(10, 5); | ||
}); | ||
|
||
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: `Legacy tsp data migration finished. Total schools: 10, migrated schools: 5`, | ||
data: { | ||
total: 10, | ||
migrated: 5, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
apps/server/src/infra/sync/tsp/loggable/tsp-legacy-school-migration-success.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,17 @@ | ||
import { Loggable, LogMessage } from '@src/core/logger'; | ||
|
||
export class TspLegacySchoolMigrationSuccessLoggable implements Loggable { | ||
constructor(private readonly total: number, private readonly migrated: number) {} | ||
|
||
getLogMessage(): LogMessage { | ||
const message: LogMessage = { | ||
message: `Legacy tsp data migration finished. Total schools: ${this.total}, migrated schools: ${this.migrated}`, | ||
data: { | ||
total: this.total, | ||
migrated: this.migrated, | ||
}, | ||
}; | ||
|
||
return message; | ||
} | ||
} |
Oops, something went wrong.