The loyalty programs and cards domain model
This section describes the domain model that represents the loyalty program and card objects where the following three assertions hold true:
-
The domain model primarily serves as DTO objects for transferring information between the external commerce system and Sitecore.
-
The domain model contains the minimum required information as contracts and will typically be extended, when integrated with a specific commerce system.
-
The domain model is used when a Sitecore developer needs to synchronize product data with the external commerce system or product data is pushed into Sitecore from the external commerce system
The following class diagram shows the domain model:
The domain model consists of abstract classes that make up the contracts with the external system. The contracts are defined as abstract classes instead of interfaces to allow the model to be easily extended later if needed. This follows the best practice guidelines defined in the Framework Design Guidelines.
A default implementation of the contracts is delivered as part of Connect. If an actual Connect provider with an external commerce system contains more functionality than that provided by default, the implementation can be replaced. All instantiation of actual classes will be handled through dependency injection.
Class: LoyaltyCard
The LoyaltyCard
class is used to represent a loyalty card owned by a customer.
Name |
Type |
Description |
---|---|---|
ExternalId |
String |
Unique identifier for the loyalty card in the external commerce system. |
CustomerId |
String |
The customer ID associated to the card. |
UserId |
String |
The user ID associated to the card. |
ShopName |
String |
The shop name the card is associated to. |
CardNumber |
String |
The number of the card. |
ProgramIds |
List<string> |
The IDs of any programs the card is associated with. |
RewardPoints |
List<LoyaltyRewardPoint> |
Any reward points on the card. |
Class: LoyaltyCardPaymentInfo
The LoyaltyCardPaymentInfo
class extends the payment info class and makes it possible for a customer to pay for an order using their loyalty card.
Name |
Type |
Description |
---|---|---|
Amount |
Decimal |
The amount of points to charge to the card. |
Class: LoyaltyCardTier
The LoyaltyCardTier
class is used to represent a tier that a loyalty card might be involved in, for example, bronze, silver, or gold.
Name |
Type |
Description |
---|---|---|
Tier |
String |
The tier the card is associated with. |
ValidFrom |
DateTime |
When the tier becomes valid. |
ValidTo |
DateTime |
When the card is no longer eligible to be part of the tier. |
Class: LoyaltyCardTransaction
The LoyaltyCardTransaction
object is used to represent a record of the addition or removal of points onto a loyalty card.
Name |
Type |
Description |
---|---|---|
LoyaltyCardId |
String |
Unique identifier for the loyalty card in the external commerce system. |
CustomerId |
String |
The customer ID associated to the card. |
UserId |
String |
The user ID associated to the card. |
ShopName |
String |
The shop name the card is associated to. |
RewardPointType |
RewardPointType |
The type of point transaction that occurred. |
RewardPointAmount |
Decimal |
The amount of points that were awarded. |
EntryType |
LoyaltyRewardPointEntryType |
The type of entry for this transaction. |
ExpirationDate |
Datetime |
The date the reward expires. |
EntryDateTime |
DateTime |
The date the transaction occurred. |
Class: LoyaltyProgram
The LoyaltyProgram
object is used to represent a program that a loyalty card is involved in.
Name |
Type |
Description |
---|---|---|
ExternalId |
String |
Unique identifier for the loyalty program in the external commerce system. |
Name |
String |
The name of the program. |
Description |
String |
The name of the description. |
ShopName |
String |
The name of the shop that the program is associated with. |
LoyaltyTiers |
List<LoyaltyTier> |
The tiers that exist within the program. |
Class: LoyaltyRewardPoint
The LoyaltyRewardPoint
object is used to represent point activity on a card.
Name |
Type |
Description |
---|---|---|
Description |
String |
A description of the reward points. |
RewardPointType |
RewardPointType |
The type of points rewarded. |
CurrencyCode |
String |
The currency of the points rewarded. |
IssuedPoints |
Decimal |
The amount of point issued. |
UsedPoints |
Decimal |
The amount of points used. |
ExpiredPoints |
Decimal |
The amount of expired points. |
ActivePoints |
Decimal |
The amount of active points. |
Class: LoyaltyRewardPointEntryType
The LoyaltyRewardPointEntryType
object is an enum of different reward point entry types.
Name |
Type |
Description |
---|---|---|
None |
LoyaltyRewardPointEntryType |
Unassigned reward point entry type. |
Earn |
LoyaltyRewardPointEntryType |
An earned reward point. |
Redeem |
LoyaltyRewardPointEntryType |
A redeemed reward point. |
Class: PointBasedLoyaltyTier
The PointBasedLoyaltyTier
object is an extension of the LoyaltyTier
class and is used to represent points based on the loyalty tier within a program.
Name |
Type |
Description |
---|---|---|
PointsNeeded |
Decimal |
The number of points required to meet the tier. |
Class: LoyaltyProgramSummary
The LoyaltyProgramSummary
object is used to represent a summary of the loyalty program.
Name |
Type |
Description |
---|---|---|
Name |
String |
The name of the program. |
Description |
String |
A description of the program. |
ShopName |
String |
The name of the shop that the program is associated with. |
LoyaltyProgramId |
String |
The ID of the loyalty program for this summary. |
Class: RewardPointType
The RewardPointType
object is an enum of different reward point entry types.
Name |
Type |
Description |
---|---|---|
NotRedeemable |
RewardPointType |
The points are not redeemable. |
Redeemable |
RewardPointType |
The points are redeemable. |