Introduction

Table of Contents

Business

Development

Core

Entity Definitions

The definitions in this module have id discriminators in the range 300-310.

AddressCountryTargetingEntityDefinition

The AddressCountryTargetingEntityDefinition extends the CustomerTargetingEntityDefinition, going further to the TargetingEntityDefinition and the AbstractEntityDefinition:

asciidoctor diagram AddressCountryTargetingEntityDefinition

The AddressCountryTargetingEntityDefinition checks if the default address of the customer is the same as the one specified. The defined here property is country. As an instance of CountryEntityDefinition, it stores the country of the targeting.

AddressPostalcodeTargetingEntityDefinition

The AddressPostalcodeTargetingEntityDefinition extends the CustomerTargetingEntityDefinition, going further to the TargetingEntityDefinition and the AbstractEntityDefinition:

asciidoctor diagram AddressPostalcodeTargetingEntityDefinition

The AddressPostalcodeTargetingEntityDefinition checks if the default address of the customer is the same as the one specified. The defined here property is postalCode. It stores the postalcode of the targeting.

CartTargetingEntityDefinition

The CartTargetingEntityDefinition extends the TargetingEntityDefinition, going further to the AbstractEntityDefinition:

asciidoctor diagram CartTargetingEntityDefinition
CustomerNumberOfOrdersInSpacetimeEntityDefinition

The CustomerNumberOfOrdersInSpacetimeEntityDefinition extends the CustomerTargetingEntityDefinition going further to the TargetingEntityDefinition and the AbstractEntityDefinition:

asciidoctor diagram CustomerNumberOfOrdersInSpacetimeEntityDefinition

The CustomerNumberOfOrdersInSpacetimeEntityDefinition defines a targeting rule for when a given customer has certain amount of orders in a given spacetime (within 2 hours, 5 days, 3 weeks, etc). Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

numberOfOrders

stores the number of orders we need to have in order to activate the targeting

numberOfDays

stores the duration (in number of days) in which orders must be placed to activate the targeting

EachLastOrderTotalValueTargetingEntityDefinition

The EachLastOrderTotalValueTargetingEntityDefinition extends the CustomerTargetingEntityDefinition and the AbstractExpensableEntityDefinition. The inheritance goes further to the TargetingEntityDefinition and the AbstractEntityDefinition:

asciidoctor diagram EachLastOrderTotalValueTargetingEntityDefinition
TargetableAddressEntityDefinition

The TargetableAddressEntityDefinition extends the AddressEntityDefinition, going further to the AbstractEntityDefinition and the AbstractUserableEntityDefinition:

asciidoctor diagram TargetableAddressEntityDefinition
TargetableCustomerEntityDefinition

The TargetableCustomerEntityDefinition extends the CustomerEntityDefinition. The inheritance goes further to the UserEntityDefinition, the PrincipalEntityDefinition and the AbstractEntityDefinition:

asciidoctor diagram TargetableCustomerEntityDefinition
TargetingEntityDefinition

the TargetingEntityDefinition extends the AbstractEntityDefinition and the AbstractActivatableEntityDefinition. This is the base definition for all targetings:

asciidoctor diagram TargetingEntityDefinition
Property Description

priority

stores the the priority of the targeting; keep in mind that targeting with lower priority is evaluated before targeting with higher priority

rule

stores the rule for the targeting

TargetingGroupEntityDefinition

The TargetingGroupEntityDefinition adds targeting-attributes to the AbstractEntityDefinition:

asciidoctor diagram TargetingGroupEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

userGroup

stores the customer group the customer will be moved to in case all of the targetings are fired

targetings

stores a set of targetings for the given targeting group

TargetingResultEntityDefinition

The TargetingResultEntityDefinition extends the AbstractEntityDefinition and the AbstractUserableEntityDefinition:

asciidoctor diagram TargetingResultEntityDefinition

The defined here property is targeting - it stores the result of which targeting this targeting result is.

asciidoctor diagram TotalSumOfCartTargetingEntityDefinition

Spring Data JPA Repositories

TargetingRepository

The TargetingRepository extends the BaseEntityRepository and the ActivatableRepository. This is the corresponding Spring Data JPA repository for the TargetingEntityDefinition

asciidoctor diagram TargetingRepository

Business Services

TargetingService

The TargetingService defines a helper method for adding active targeting rules to the session.

Integration

The integration with the Nemesis platform is pretty straight-forward - just add the module in your classpath:

<dependency>
    <groupId>io.nemesis.platform.module</groupId>
    <artifactId>nemesis-module-targeting</artifactId>
</dependency>