Skip to content

Commit

Permalink
Merge branch 'main' into SPSH-1025
Browse files Browse the repository at this point in the history
  • Loading branch information
phaelcg committed Sep 9, 2024
2 parents 7ba755b + 571b09b commit dee9731
Show file tree
Hide file tree
Showing 27 changed files with 349 additions and 8 deletions.
10 changes: 10 additions & 0 deletions migrations/.snapshot-dbildungs-iam-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -2418,6 +2418,16 @@
"nullable": false,
"default": "'1'",
"mappedType": "string"
},
"befristung": {
"name": "befristung",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
}
},
"name": "personenkontext",
Expand Down
11 changes: 11 additions & 0 deletions migrations/Migration20240829100726.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Migration } from '@mikro-orm/migrations';

export class Migration20240829100726 extends Migration {
public up(): void {
this.addSql('alter table "personenkontext" add column "befristung" timestamptz null;');
}

public override down(): void {
this.addSql('alter table "personenkontext" drop column "befristung";');
}
}
12 changes: 12 additions & 0 deletions seeding/dev/01/03_service-provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@
"providedOnSchulstrukturknoten": 0,
"keycloakGroup": "Psychosoziales Beratungsangebot-service",
"keycloakRole": "Psychosoziales Beratungsangebot-user"
},
{
"id": 12,
"name": "LeOniE.SH",
"target": "URL",
"url": "https://www.leonie-sh.de/",
"kategorie": "HINWEISE",
"logoMimeType": "image/png",
"logoBase64": "iVBORw0KGgoAAAANSUhEUgAAAMAAAADbCAYAAAA7zZ5fAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAbFUlEQVR42u2deXgWVZbG30pICAkBEvYtRmRRkxYDCHFhFREFprHVBsRxaUVFlrFFB3exm1bEYURBuxm1GejRVkQRFUkURRTQVkhQWVxAQGQHWRJC1u+dP6qwIx2Sqlt16/u++s7vee4DDyFVt855T91bdzkXEIQYxhATCNEIyaYAOgNIAd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LWFO1IiYnc9034/g7YuI2S7RWJhZIETc9vL29xDZBI/2AN4Sgde6lPk+SPKqwDMQwHoR/C/KW4jBs3pjmUQAdwI4GOPC/wzmbjshRkm1PvYOxJjwP4e5iE2WMAs/B8JdALYGWPQhAO9CcqIKtRAPYDjM3VVVARH+IQCzAZwp7hWckAHgXkTGjiunpQzmuWtXQ/8mHSEGOBvm0T4fwzx1MhJFfxBm0oCRANLEZeElyB9X6QAuskZPegPIQXjGzg/CTBDwkRWYBVZwChIAvpIIc3vmOVbpDOB0mCnBG3hw/b3Wx/n3ADbCPPL1SwA/iMwkACKdVjCzpDWtVowauihlMLdOllpv9hNlJ2S/rSAI0cb/A8SFPh64k4M4AAAAAElFTkSuQmCC",
"providedOnSchulstrukturknoten": 0,
"keycloakGroup": "LeOniE-service",
"keycloakRole": "LeOniE-user"
}
]
}
9 changes: 6 additions & 3 deletions seeding/dev/01/04_rolle.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
8,
9,
10,
11
11,
12
]
},
{
Expand Down Expand Up @@ -61,7 +62,8 @@
8,
9,
10,
11
11,
12
]
},
{
Expand All @@ -85,7 +87,8 @@
8,
9,
10,
11
11,
12
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class DBiamPersonenzuordnungResponse {
@ApiProperty({ type: Boolean })
public readonly editable: boolean;

@ApiProperty({ type: Date })
public readonly befristung?: Date;

@ApiProperty({ enum: RollenMerkmal, enumName: RollenMerkmalTypName, nullable: true })
public readonly merkmale?: RollenMerkmal[];

Expand All @@ -50,5 +53,6 @@ export class DBiamPersonenzuordnungResponse {
this.typ = organisation.typ;
this.editable = editable;
this.merkmale = rolle.merkmale;
this.befristung = personenkontext.befristung;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { Organisation } from '../../organisation/domain/organisation.js';
import { PersonFactory } from '../../person/domain/person.factory.js';
import { PersonenkontextCreationService } from '../domain/personenkontext-creation.service.js';
import { DuplicatePersonalnummerError } from '../../../shared/error/duplicate-personalnummer.error.js';
import { PersonenkontexteUpdateError } from '../domain/error/personenkontexte-update.error.js';

function createRolle(this: void, rolleFactory: RolleFactory, params: Partial<Rolle<boolean>> = {}): Rolle<false> {
const rolle: Rolle<false> | DomainError = rolleFactory.createNew(
Expand Down Expand Up @@ -159,6 +160,7 @@ describe('DbiamPersonenkontextWorkflowController Integration Test', () => {
DoFactory.createRolle(false, {
administeredBySchulstrukturknoten: organisation.id,
rollenart: RollenArt.LEHR,
merkmale: [RollenMerkmal.KOPERS_PFLICHT],
}),
);

Expand All @@ -185,6 +187,7 @@ describe('DbiamPersonenkontextWorkflowController Integration Test', () => {
DoFactory.createRolle(false, {
administeredBySchulstrukturknoten: organisation.id,
rollenart: RollenArt.LEHR,
merkmale: [RollenMerkmal.KOPERS_PFLICHT],
}),
);

Expand Down Expand Up @@ -310,6 +313,38 @@ describe('DbiamPersonenkontextWorkflowController Integration Test', () => {
new DuplicatePersonalnummerError('Duplicate Kopers'),
);

const response: Response = await request(app.getHttpServer() as App)
.post('/personenkontext-workflow')
.send({
familienname: faker.person.lastName(),
vorname: faker.person.firstName(),
organisationId: organisation.id,
rolleId: rolle.id,
personalnummer: '1234567',
});

expect(response.status).toBe(400);
});
it('should return error with status-code 400 if PersonenkontexteUpdateError is thrown', async () => {
const organisation: Organisation<true> = await organisationRepo.save(
DoFactory.createOrganisation(false, { typ: OrganisationsTyp.SCHULE }),
);
const rolle: Rolle<true> = await rolleRepo.save(
DoFactory.createRolle(false, {
administeredBySchulstrukturknoten: organisation.id,
rollenart: RollenArt.LEHR,
}),
);

const personpermissions: DeepMocked<PersonPermissions> = createMock();
personpermissions.hasSystemrechtAtOrganisation.mockResolvedValue(true);
personpermissionsRepoMock.loadPersonPermissions.mockResolvedValue(personpermissions);

// Mock the service to throw DuplicatePersonalnummerError
jest.spyOn(personenkontextService, 'createPersonWithPersonenkontext').mockResolvedValueOnce(
new PersonenkontexteUpdateError('Error'),
);

const response: Response = await request(app.getHttpServer() as App)
.post('/personenkontext-workflow')
.send({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,15 @@ export class DbiamPersonenkontextWorkflowController {
params.organisationId,
params.rolleId,
params.personalnummer || undefined,
params.befristung || undefined,
);

if (savedPersonWithPersonenkontext instanceof PersonenkontextSpecificationError) {
throw savedPersonWithPersonenkontext;
}
if (savedPersonWithPersonenkontext instanceof PersonenkontexteUpdateError) {
throw savedPersonWithPersonenkontext;
}

if (savedPersonWithPersonenkontext instanceof DuplicatePersonalnummerError) {
throw savedPersonWithPersonenkontext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { RolleRepo } from '../../rolle/repo/rolle.repo.js';
import { PersonenkontextFactory } from '../domain/personenkontext.factory.js';
import { Personenkontext } from '../domain/personenkontext.js';
import { DBiamPersonenkontextRepo } from '../persistence/dbiam-personenkontext.repo.js';
import { RollenArt } from '../../rolle/domain/rolle.enums.js';
import { RollenArt, RollenMerkmal } from '../../rolle/domain/rolle.enums.js';
import { PersonenKontextApiModule } from '../personenkontext-api.module.js';
import { KeycloakConfigModule } from '../../keycloak-administration/keycloak-config.module.js';
import { KeycloakAdministrationModule } from '../../keycloak-administration/keycloak-administration.module.js';
Expand Down Expand Up @@ -224,6 +224,7 @@ describe('dbiam Personenkontext API', () => {
DoFactory.createRolle(false, {
administeredBySchulstrukturknoten: organisation.id,
rollenart: RollenArt.LEHR,
merkmale: [],
}),
);

Expand Down Expand Up @@ -252,6 +253,7 @@ describe('dbiam Personenkontext API', () => {
const schuelerRolleDummy: Rolle<false> = DoFactory.createRolle(false, {
rollenart: RollenArt.LERN,
administeredBySchulstrukturknoten: schule.id,
merkmale: [],
});
const schuelerRolle: Rolle<true> = await rolleRepo.save(schuelerRolleDummy);
await personenkontextRepo.save(personenkontextFactory.createNew(lehrer.id, schule.id, schuelerRolle.id));
Expand Down Expand Up @@ -415,6 +417,7 @@ describe('dbiam Personenkontext API', () => {
DoFactory.createRolle(false, {
administeredBySchulstrukturknoten: organisation.id,
rollenart: RollenArt.LEHR,
merkmale: [],
}),
);

Expand Down Expand Up @@ -446,6 +449,7 @@ describe('dbiam Personenkontext API', () => {
DoFactory.createRolle(false, {
administeredBySchulstrukturknoten: organisation.id,
rollenart: RollenArt.SYSADMIN,
merkmale: [RollenMerkmal.KOPERS_PFLICHT],
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class DBiamPersonenkontextController {
undefined,
undefined,
undefined,
params.befristung,
);

//Check specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export enum PersonenkontexteUpdateErrorI18nTypes {
PERSON_ID_MISMATCH = 'PERSON_ID_MISMATCH',
PERSON_NOT_FOUND = 'PERSON_NOT_FOUND',
INVALID_PERSONENKONTEXT_FOR_PERSON_WITH_ROLLENART_LERN = 'INVALID_PERSONENKONTEXT_FOR_PERSON_WITH_ROLLENART_LERN',
BEFRISTUNG_REQUIRED_FOR_PERSONENKONTEXT = ' BEFRISTUNG_REQUIRED_FOR_PERSONENKONTEXT',
}
export type DbiamPersonenkontexteUpdateErrorProps = DbiamErrorProps & {
i18nKey: PersonenkontexteUpdateErrorI18nTypes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator';
import { IsDate, IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator';
import { IsDIN91379A } from '../../../../shared/util/din-91379-validation.js';
import { OrganisationID, RolleID } from '../../../../shared/types/aggregate-ids.types.js';

Expand All @@ -16,6 +16,11 @@ export class DbiamCreatePersonWithContextBodyParams {
@ApiProperty({ required: true })
public readonly vorname!: string;

@IsDate()
@IsOptional()
@ApiProperty({ required: false })
public readonly befristung?: Date;

@IsString()
@IsOptional()
@ApiProperty({ required: false })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, IsUUID } from 'class-validator';
import { IsDate, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';

import { OrganisationID, PersonID, RolleID } from '../../../../shared/types/index.js';

Expand All @@ -21,4 +21,9 @@ export class DbiamPersonenkontextBodyParams {
@IsUUID()
@ApiProperty({ type: String })
public readonly rolleId!: RolleID;

@IsDate()
@IsOptional()
@ApiProperty({ required: false })
public readonly befristung?: Date;
}
Loading

0 comments on commit dee9731

Please sign in to comment.