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

N21-1678 use schulconnex rest client #5018

Merged
merged 8 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
28 changes: 14 additions & 14 deletions apps/server/src/infra/schulconnex-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ export { SchulconnexRestClientOptions } from './schulconnex-rest-client-options'
export { SchulconnexClientModule } from './schulconnex-client.module';
export { SchulconnexRestClient } from './schulconnex-rest-client';
export {
SanisResponse,
SanisRole,
SanisGroupRole,
SanisGroupType,
SanisGruppenResponse,
SanisResponseValidationGroups,
SanisPersonResponse,
SanisAnschriftResponse,
SanisGruppenzugehoerigkeitResponse,
SanisGruppeResponse,
SanisNameResponse,
SanisOrganisationResponse,
SanisPersonenkontextResponse,
SanisSonstigeGruppenzugehoerigeResponse,
SchulconnexResponse,
SchulconnexRole,
SchulconnexGroupRole,
SchulconnexGroupType,
SchulconnexGruppenResponse,
SchulconnexResponseValidationGroups,
SchulconnexPersonResponse,
SchulconnexAnschriftResponse,
SchulconnexGruppenzugehoerigkeitResponse,
SchulconnexGruppeResponse,
SchulconnexNameResponse,
SchulconnexOrganisationResponse,
SchulconnexPersonenkontextResponse,
SchulconnexSonstigeGruppenzugehoerigeResponse,
} from './response';
export { schulconnexResponseFactory } from './testing/schulconnex-response-factory';
export { SchulconnexClientConfig } from './schulconnex-client-config';
30 changes: 15 additions & 15 deletions apps/server/src/infra/schulconnex-client/response/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
export * from './sanis.response';
export * from './sanis-role';
export * from './sanis-group-role';
export * from './sanis-group-type';
export * from './sanis-name-response';
export * from './sanis-gruppe-response';
export * from './sanis-gruppen-response';
export * from './sanis-organisation-response';
export * from './sanis-personenkontext-response';
export * from './sanis-gruppenzugehoerigkeit-response';
export * from './sanis-person-response';
export * from './sanis-sonstige-gruppenzugehoerige-response';
export * from './sanis-anschrift-response';
export * from './sanis-response-validation-groups';
export { SanisErreichbarkeitenResponse } from './sanis-erreichbarkeiten-response';
export { SchulconnexResponse } from './schulconnex.response';
export { SchulconnexRole } from './schulconnex-role';
export { SchulconnexGroupRole } from './schulconnex-group-role';
export { SchulconnexGroupType } from './schulconnex-group-type';
export { SchulconnexNameResponse } from './schulconnex-name-response';
export { SchulconnexGruppeResponse } from './schulconnex-gruppe-response';
export { SchulconnexGruppenResponse } from './schulconnex-gruppen-response';
export { SchulconnexOrganisationResponse } from './schulconnex-organisation-response';
export { SchulconnexPersonenkontextResponse } from './schulconnex-personenkontext-response';
export { SchulconnexGruppenzugehoerigkeitResponse } from './schulconnex-gruppenzugehoerigkeit-response';
export { SchulconnexPersonResponse } from './schulconnex-person-response';
export { SchulconnexSonstigeGruppenzugehoerigeResponse } from './schulconnex-sonstige-gruppenzugehoerige-response';
export { SchulconnexAnschriftResponse } from './schulconnex-anschrift-response';
export { SchulconnexResponseValidationGroups } from './schulconnex-response-validation-groups';
export { SchulconnexErreichbarkeitenResponse } from './schulconnex-erreichbarkeiten-response';
export { SchulconnexCommunicationType } from './schulconnex-communication-type';
export * from './lizenz-info';

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsOptional, IsString } from 'class-validator';

export class SanisAnschriftResponse {
export class SchulconnexAnschriftResponse {
@IsString()
@IsOptional()
ort?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsString } from 'class-validator';

export class SanisErreichbarkeitenResponse {
export class SchulconnexErreichbarkeitenResponse {
@IsString()
typ!: string;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsOptional, IsString } from 'class-validator';

export class SanisGeburtResponse {
export class SchulconnexGeburtResponse {
@IsOptional()
@IsString()
datum?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum SanisGroupRole {
export enum SchulconnexGroupRole {
TEACHER = 'Lehr',
STUDENT = 'Lern',
CLASS_LEADER = 'KlLeit',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum SanisGroupType {
export enum SchulconnexGroupType {
CLASS = 'Klasse',
COURSE = 'Kurs',
OTHER = 'Sonstig',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { IsEnum, IsString } from 'class-validator';
import { SchulconnexGroupType } from './schulconnex-group-type';

export class SchulconnexGruppeResponse {
@IsString()
id!: string;

@IsString()
bezeichnung!: string;

@IsEnum(SchulconnexGroupType)
typ!: SchulconnexGroupType;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Type } from 'class-transformer';
import { IsArray, IsObject, IsOptional, ValidateNested } from 'class-validator';
import { SchulconnexGruppeResponse } from './schulconnex-gruppe-response';
import { SchulconnexGruppenzugehoerigkeitResponse } from './schulconnex-gruppenzugehoerigkeit-response';
import { SchulconnexSonstigeGruppenzugehoerigeResponse } from './schulconnex-sonstige-gruppenzugehoerige-response';

export class SchulconnexGruppenResponse {
@IsObject()
@ValidateNested()
@Type(() => SchulconnexGruppeResponse)
gruppe!: SchulconnexGruppeResponse;

@IsObject()
@ValidateNested()
@Type(() => SchulconnexGruppenzugehoerigkeitResponse)
gruppenzugehoerigkeit!: SchulconnexGruppenzugehoerigkeitResponse;

@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => SchulconnexSonstigeGruppenzugehoerigeResponse)
sonstige_gruppenzugehoerige?: SchulconnexSonstigeGruppenzugehoerigeResponse[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { IsArray, IsEnum, IsOptional } from 'class-validator';
import { SchulconnexGroupRole } from './schulconnex-group-role';

export class SchulconnexGruppenzugehoerigkeitResponse {
@IsOptional()
@IsArray()
@IsEnum(SchulconnexGroupRole, { each: true })
rollen?: SchulconnexGroupRole[];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsString } from 'class-validator';

export class SanisNameResponse {
export class SchulconnexNameResponse {
@IsString()
familienname!: string;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Type } from 'class-transformer';
import { IsObject, IsOptional, IsString, ValidateNested } from 'class-validator';
import { SanisAnschriftResponse } from './sanis-anschrift-response';
import { SchulconnexAnschriftResponse } from './schulconnex-anschrift-response';

export class SanisOrganisationResponse {
export class SchulconnexOrganisationResponse {
@IsString()
id!: string;

Expand All @@ -15,6 +15,6 @@ export class SanisOrganisationResponse {
@IsOptional()
@IsObject()
@ValidateNested()
@Type(() => SanisAnschriftResponse)
anschrift?: SanisAnschriftResponse;
@Type(() => SchulconnexAnschriftResponse)
anschrift?: SchulconnexAnschriftResponse;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Type } from 'class-transformer';
import { IsObject, IsOptional, ValidateNested } from 'class-validator';
import { SchulconnexGeburtResponse } from './schulconnex-geburt-response';
import { SchulconnexNameResponse } from './schulconnex-name-response';

export class SchulconnexPersonResponse {
@IsObject()
@ValidateNested()
@Type(() => SchulconnexNameResponse)
name!: SchulconnexNameResponse;

@IsOptional()
@IsObject()
@ValidateNested()
@Type(() => SchulconnexGeburtResponse)
geburt?: SchulconnexGeburtResponse;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Type } from 'class-transformer';
import { IsArray, IsEnum, IsObject, IsOptional, IsString, ValidateNested } from 'class-validator';
import { SchulconnexErreichbarkeitenResponse } from './schulconnex-erreichbarkeiten-response';
import { SchulconnexGruppenResponse } from './schulconnex-gruppen-response';
import { SchulconnexOrganisationResponse } from './schulconnex-organisation-response';
import { SchulconnexResponseValidationGroups } from './schulconnex-response-validation-groups';
import { SchulconnexRole } from './schulconnex-role';

export class SchulconnexPersonenkontextResponse {
@IsString({ groups: [SchulconnexResponseValidationGroups.USER, SchulconnexResponseValidationGroups.GROUPS] })
id!: string;

@IsEnum(SchulconnexRole, { groups: [SchulconnexResponseValidationGroups.USER] })
rolle!: SchulconnexRole;

@IsObject({ groups: [SchulconnexResponseValidationGroups.SCHOOL] })
@ValidateNested({ groups: [SchulconnexResponseValidationGroups.SCHOOL] })
@Type(() => SchulconnexOrganisationResponse)
organisation!: SchulconnexOrganisationResponse;

@IsOptional({ groups: [SchulconnexResponseValidationGroups.GROUPS] })
@IsArray({ groups: [SchulconnexResponseValidationGroups.GROUPS] })
@ValidateNested({ each: true, groups: [SchulconnexResponseValidationGroups.GROUPS] })
@Type(() => SchulconnexGruppenResponse)
gruppen?: SchulconnexGruppenResponse[];

@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => SchulconnexErreichbarkeitenResponse)
erreichbarkeiten?: SchulconnexErreichbarkeitenResponse[];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum SanisResponseValidationGroups {
export enum SchulconnexResponseValidationGroups {
USER = 'user',
SCHOOL = 'school',
GROUPS = 'groups',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum SanisRole {
export enum SchulconnexRole {
LEHR = 'Lehr',
LERN = 'Lern',
LEIT = 'Leit',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { IsArray, IsEnum, IsOptional, IsString } from 'class-validator';
import { SchulconnexGroupRole } from './schulconnex-group-role';

export class SchulconnexSonstigeGruppenzugehoerigeResponse {
@IsString()
ktid!: string;

@IsOptional()
@IsArray()
@IsEnum(SchulconnexGroupRole, { each: true })
rollen?: SchulconnexGroupRole[];
}
Loading
Loading