Integration Guide

Account Info Tool

The module de.faktorzehn.fscd-adapter:fscd-adapter-account-infotool provides a Linkki InfoTool that can be used to display FS-CD account information in a Linkki web application, e.g., an IPM web application.

The following demonstrates how to add the info tool to the PolicyToolInfos of an IPM web application. It assumes that an FscdAdapterClient Spring bean is configured.

First, add the Maven dependency to the web module.

 <dependency>
    <groupId>de.faktorzehn.fscd-adapter</groupId>
    <artifactId>fscd-adapter-account-infotool</artifactId>
    <version>${fscd-adapter.version}</version>
</dependency>

Then, configure the info tool in the web module’s LobUI.

@Component
public class MyLobUI implements LobUI {

    @Override
    public PolicyToolInfos createPolicyTools(PolicyUiState policyUiState) {
        var tools = super.createPolicyTools(policyUiState);

        // get the auto-configured FscdAdapterClient
        var fscdAdapterClient = BeanUtils.getOptionalBean(FscdAdapterClient.class);

        if (fscdAdapterClient.isPresent()) {
            var partnerNo = ((ContractBundle)policyUiState.getPolicyVersion().getContentRoot())
                    .getPolicyholderPartnerId();
            var policyNo = policyUiState.getPolicy().getPolicyNo();
            var openAccountUrl = PropertyResolver.get().getRequiredPropertyValue("fscd-adapter.open-policy-account-url")
                    .formatted(partnerNo, policyNo);

            var tool = AccountInfoToolCreator
                    .create(partnerNo,
                            policyNo,
                            fscdAdapterClient.get(),
                            openAccountUrl,
                            BeanProvider.get().getBean(PolicyBindingManager.class));

            return tools.with(tool);
        } else {
            return tools;
        }

    }

    // other methods
}

Finally, configure the application property to open the account in the FS-CD Adapter webapp.

fscd-adapter.open-policy-account-url=http://${fscd-adapter}/ui/partners/%s/insurance-objects/%s