Introduction
The module’s integration allows you to the user to
-
accumulate credits (bonus points) and
-
spend these bonus points when purchasing different items in the website
Development
Core
Entity Definitions
The CreditAccountBalanceEntityDefinition extends the AbstractEntityDefinition, the AbstractExpensableEntityDefinition and the AbstractUserableEntityDefinition:

The CreditAccountCustomerEntityDefinition extends inherited features from the CustomerEntityDefinition, the UserEntityDefinition, the PrincipalEntityDefinition and the AbstractEntityDefinition:

Apart from the inherited, the defined property here is creditAccountBalance. Via the respective getter/setter, a CreditAccountBalanceEntityDefinition
can be retrieved/stored in the database.
Spring Data JPA Repositories
The CreditAccountBalanceRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the CreditAccountBalanceEntityDefinition

Business Services
The additional service logic for the account module is to be stored in the CreditAccountService.
Facade
MapperFactoryConfigurers
The CreditAccountPaymentInfoMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the PaymentInfoEntityDefinition
to CreditAccountPaymentInfoDtoDefinition
:

The conversion is customized.
More about the mapping configurations you may read in the respective Orika guide.
Dto definitions
The CreditAccountPaymentInfoDtoDefinition extends the PaymentInfoDtoDefinition:

This is the corresponding Dto for the PaymentInfoEntityDefinition
.
Facades
The defined method in the CreditAccountFacade provides information for the credit account balance of the current session’s user.
Storefront
The CreditAccountCheckoutController defines an HTTP Endpoint at /payment/creditaccount/perform
There are no views, associated with the module.
For further details on mapping, check the corresponding mapping actuator accessible at /platform/mappings
.