public interface IssuePolicyService {
Result<PolicyReference> issuePolicy(IbOffer offer);
}
Quotation
Default Policy Management Facade
The DefaultPolicyManagementFacade
provides a simplified interface for interacting with the a policy management system from within IOS.
It encapsulates several specialized business services, each responsible for a specific aspect of the Facade API.
While developers typically interact with these functionalities through the DefaultPolicyManagementFacade
, it is possible to provide custom implementations for each service if specific business logic is required.
Overview of Business Services
The following business services are available as dedicated interfaces, each focusing on a distinct responsibility:
IssuePolicyService
This service handles the creation of new insurance policies based on a provided offer.
-
Accepts an offer (
IbOffer
) and attempts to issue a new policy in the policy management system. -
Returns a `PolicyReference`representing the newly created policy wrapped in a `Result, or error messages in case the policy couldn’t be endorsed.
EndorsePolicyService
Responsible for endorsing (changing) existing policies.
public interface EndorsePolicyService {
Result<PolicyReference> endorsePolicy(IbOffer offer);
}
-
Creates a new policy version in the policy management system based on the provided change offer (
IbOffer
). -
Returns a
PolicyReference
wrapped in aResullt
representing the endorsed policy version, or error messages in case the policy couldn’t be endorsed.
LoadPolicyService
Fetches existing policies from the policy management system based on a PolicyReference
.
public interface LoadPolicyService {
LookupResult<Policy> loadPolicy(PolicyReference policyReference);
}
-
Loads the requested policy details from the policy management system.
-
Provides the results wrapped in a
LookupResult
, or error messages in case the policy couldn’t be retrieved.
OfferValidationService
Validates the provided offer (IbOffer
) against defined business rules before further processing.
public interface OfferValidationService {
MessageList validate(IbOffer offer);
}
-
Performs detailed validation checks on the offer.
-
Returns a
MessageList
containing validation errors if present, or an empty list if validation succeeds.
Extensibility and Custom Implementations
By default, these services are used internally by the DefaultPolicyManagementFacade
to provide a clean abstraction layer for those operations.
However, each of these interfaces can be implemented individually if specialized business logic or integration requirements arise.
To provide custom implementations:
-
Create your implementation of the desired service interface.
-
Register your implementation as a Spring Bean.
-
The
DefaultPolicyManagementFacade
will automatically use your provided implementation instead of the default one.
This approach allows flexibility while maintaining a consistent and structured way of handling insurance policy operations within IOS.