Skip to content

Commit

Permalink
EW-1051 Add docu for new tsp sync
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneRadtke-Cap committed Dec 4, 2024
1 parent 187e8a7 commit 643103d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/syncronizations/TSP/Architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Architecture

## TspSyncStrategy

This strategy handles the sync of schools, students, teachers and classes from TSP and replaces both the legacy TspBaseSyncer and TspSchoolSyncer. It responds to the target "tsp".

The flow looks like this (some of the logic for syncing is done in the provisioning strategy which is shared with the login):

![Flow of the TSP sync strategy](tsp_sync_strategy.png)
52 changes: 52 additions & 0 deletions docs/syncronizations/TSP/How it works.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# How it works

## Configuration

- FEATURE_TSP_SYNC_ENABLED - Activates the sync strategy inside the sync console

- WITH_TSP_SYNC - Activates the cronjob in Kubernetes

- TSP_API_CLIENT_BASE_URL - Base URL for the TSP API

- TSP_API_TOKEN_LIFETIME_MS - Lifetime of the access token for the TSP API in milliseconds

- TSP_SYNC_SCHOOL_LIMIT - The amount of schools the sync handles at once

- TSP_SYNC_SCHOOL_DAYS_TO_FETCH - The amount of days for which the sync fetches schools from the TSP API

- TSP_SYNC_DATA_LIMIT - The amount of school data updates the sync handles at once

- TSP_SYNC_DATA_DAYS_TO_FETCH - The amount of days for which the sync fetches school data from the TSP API

- FEATURE_TSP_MIGRATION_ENABLED - Activates the migration of TSP users within the sync

- TSP_SYNC_MIGRATION_LIMIT - The amount of users the sync migrates at once

## Sync console

This is a console application that allows you to start the synchronization process for different sources.

### Usage

To start the synchronization process, run the following command:

```bash
npm run nest:start:console sync run <target>
```

Where `<target>` is the name of the system you want to start the synchronization for. The currently available systems are:

- `tsp` - Synchronize Thüringer Schulportal.

If the target is not provided, the synchronization will not start and the available targets will be displayed in an error message.

```bash
{
message: 'Either synchronization is not activated or the target entered is invalid',
data: { enteredTarget: 'tsp', availableTargets: { TSP: 'tsp' }}
}
```
### TSP synchronization
The TSP synchronization is controlled with the feature flag `FEATURE_TSP_SYNC_ENABLED`.
Binary file added docs/syncronizations/TSP/tsp_sync_strategy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 643103d

Please sign in to comment.