Skip to content

Commit

Permalink
Remove Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
casparneumann-cap committed Jul 11, 2024
1 parent f407956 commit 34c2562
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/modules/personenkontext/domain/personenkontext.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import { Personenkontext } from './personenkontext.js';
import { RolleRepo } from '../../rolle/repo/rolle.repo.js';
import { PersonRepository } from '../../person/persistence/person.repository.js';
import { OrganisationRepository } from '../../organisation/persistence/organisation.repository.js';
import { ClassLogger } from '../../../core/logging/class-logger.js';

@Injectable()
export class PersonenkontextFactory {
public constructor(
private readonly logger: ClassLogger,
private readonly personRepo: PersonRepository,
private readonly organisationRepo: OrganisationRepository,
private readonly rolleRepo: RolleRepo,
Expand All @@ -24,7 +22,6 @@ export class PersonenkontextFactory {
rolleId: RolleID,
): Personenkontext<WasPersisted> {
return Personenkontext.construct(
this.logger,
this.personRepo,
this.organisationRepo,
this.rolleRepo,
Expand All @@ -39,7 +36,6 @@ export class PersonenkontextFactory {

public createNew(personId: PersonID, organisationId: OrganisationID, rolleId: RolleID): Personenkontext<false> {
return Personenkontext.createNew(
this.logger,
this.personRepo,
this.organisationRepo,
this.rolleRepo,
Expand Down
8 changes: 0 additions & 8 deletions src/modules/personenkontext/domain/personenkontext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Rolle } from '../../rolle/domain/rolle.js';
import { RolleRepo } from '../../rolle/repo/rolle.repo.js';
import { OrganisationMatchesRollenart } from '../specification/organisation-matches-rollenart.js';
import { OrganisationMatchesRollenartError } from '../specification/error/organisation-matches-rollenart.error.js';
import { ClassLogger } from '../../../core/logging/class-logger.js';

export type PersonenkontextPartial = Pick<
Personenkontext<boolean>,
Expand Down Expand Up @@ -40,11 +39,9 @@ export class Personenkontext<WasPersisted extends boolean> {
public readonly personId: PersonID,
public readonly organisationId: OrganisationID,
public readonly rolleId: RolleID,
public readonly logger: ClassLogger,
) {}

public static construct<WasPersisted extends boolean = false>(
logger: ClassLogger,
personRepo: PersonRepository,
organisationRepo: OrganisationRepository,
rolleRepo: RolleRepo,
Expand All @@ -65,12 +62,10 @@ export class Personenkontext<WasPersisted extends boolean> {
personId,
organisationId,
rolleId,
logger
);
}

public static createNew(
logger: ClassLogger,
personRepo: PersonRepository,
organisationRepo: OrganisationRepository,
rolleRepo: RolleRepo,
Expand All @@ -88,7 +83,6 @@ export class Personenkontext<WasPersisted extends boolean> {
personId,
organisationId,
rolleId,
logger
);
}

Expand Down Expand Up @@ -129,7 +123,6 @@ export class Personenkontext<WasPersisted extends boolean> {

public async checkPermissions(permissions: PersonPermissions): Promise<Option<DomainError>> {
// Check if logged in person has permission
this.logger.info(`${permissions.personFields.id} START hasSystemrechteAtOrganisation`);
{
const hasPermissionAtOrga: boolean = await permissions.hasSystemrechteAtOrganisation(this.organisationId, [
RollenSystemRecht.PERSONEN_VERWALTEN,
Expand All @@ -140,7 +133,6 @@ export class Personenkontext<WasPersisted extends boolean> {
return new MissingPermissionsError('Unauthorized to manage persons at the organisation');
}
}
this.logger.info(`${permissions.personFields.id} END hasSystemrechteAtOrganisation`);

// Check if logged in user can modify target person
{
Expand Down

0 comments on commit 34c2562

Please sign in to comment.