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-1051 Add docu for new tsp sync #44

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading