Policy

Policy Change Services

The IPM Base layer provides extensible REST and Java services to change policies, including:

Change REST Controller Service Class Request DTO

Execute an Action (a PolicyEditingDefinition of type ProcessCategory Action)

PolicyActionRestController

PolicyActionService

PolicyActionRequestDto

Execute a General Change (a PolicyEditingDefinition that has at least one process allowing manual changes)

ChangePolicyRestController

EndorsePolicyService

ChangePolicyRequestDto

Cancel a Policy: a PolicyEditingDefinition that has no process allowing manual changes and expects a CancellationReason)

CancelPolicyRestController

CancelPolicyService

CancelPolicyRequestDto

For details on the REST API, refer to the OpenAPI Specification (for example pointing Swagger-UI to /rest/openapi if dependency springdoc-openapi-starter-webmvc-api is bundled into the application).

Customizing Services

Each service is configured via a dedicated interface following the naming convention ${ServiceClass}Configurer (for example, PolicyActionServiceConfigurer). A configurer defines the methods that the corresponding service delegates to for customizing its behavior—such as creating EditingStartParameters or resolving the ID of the PolicyEditingDefinition to execute.

For every configurer, the Spring AutoConfiguration class IpmBaseExtServicesAutoConfiguration automatically registers a bean for its default implementation, named ${ServiceClass}ConfigurerImpl.

Additional Concepts

The package de.faktorzehn.ipm.base.extservices.shared provides various shared concepts including:

Class / Interface Responsibility

EditingIdResolver

Resolves the ID of the PolicyEditingDefinition to execute for a given DTO.

CompositeEditingIdResolverBuilder

Builds a composite EditingIdResolver by registering type-specific EditingIdResolvers (e.g. hm.cpp for ChangePremiumPayerRequestDto and hm.ccr for ChangeCorrespondenceRecipientRequestDto).

ProcessContextModifierFactoryBuilder

Builds a ProcessContextModifierFactory by registering type-specific ProcessContextModifier functions to modify the ProcessContext based on a DTO (for example, adding a PremiumPayer or a CorrespondenceRecipient domain object).

EditingModifiers

Provides reusable EditingModifier objects.

ChainableEditingModifier

An EditingModifier that can be chained using the methods andThen(EditingModifier) and after(EditingModifier).

ProcessContextModifiers

Provides reusable ProcessContextModifier objects.

MappingContextFactory

Creates MappingContext objects for different parameters.

ExtApiEnumMapper

Maps the Finalizer and OutOfSequenceBehavior enumerations between their external and internal representations.

Additionally, it provides the following helpers

  • EditingDefinitionHelper

  • EnumHelper

  • MappingContextHelper

  • ResponseEntityHelper

Disabling REST Controllers

If the REST API is not required or desirable as-is, the REST controllers can be disabled via configuration properties:

ipm:
  action-rest-controller:
    enabled: false
  change-rest-controller:
    enabled: false
  cancellation-rest-controller:
    enabled: false