The loyalty programs and cards domain model

Version:

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:

03000018.png
03000019.png
Note

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.

NameTypeDescription
ExternalIdStringUnique identifier for the loyalty card in the external commerce system.
CustomerIdStringThe customer ID associated to the card.
UserIdStringThe user ID associated to the card.
ShopNameStringThe shop name the card is associated to.
CardNumberStringThe number of the card.
ProgramIdsListThe IDs of any programs the card is associated with.
RewardPointsListAny 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.

NameTypeDescription
AmountDecimalThe 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.

NameTypeDescription
TierStringThe tier the card is associated with.
ValidFromDateTimeWhen the tier becomes valid.
ValidToDateTimeWhen 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.

NameTypeDescription
LoyaltyCardIdStringUnique identifier for the loyalty card in the external commerce system.
CustomerIdStringThe customer ID associated to the card.
UserIdStringThe user ID associated to the card.
ShopNameStringThe shop name the card is associated to.
RewardPointTypeRewardPointTypeThe type of point transaction that occurred.
RewardPointAmountDecimalThe amount of points that were awarded.
EntryTypeLoyaltyRewardPointEntryTypeThe type of entry for this transaction.
ExpirationDateDatetimeThe date the reward expires.
EntryDateTimeDateTimeThe date the transaction occurred.

Class: LoyaltyProgram

The LoyaltyProgram object is used to represent a program that a loyalty card is involved in.

NameTypeDescription
ExternalIdStringUnique identifier for the loyalty program in the external commerce system.
NameStringThe name of the program.
DescriptionStringThe name of the description.
ShopNameStringThe name of the shop that the program is associated with.
LoyaltyTiersListThe tiers that exist within the program.

Class: LoyaltyRewardPoint

The LoyaltyRewardPoint object is used to represent point activity on a card.

NameTypeDescription
DescriptionStringA description of the reward points.
RewardPointTypeRewardPointTypeThe type of points rewarded.
CurrencyCodeStringThe currency of the points rewarded.
IssuedPointsDecimalThe amount of point issued.
UsedPointsDecimalThe amount of points used.
ExpiredPointsDecimalThe amount of expired points.
ActivePointsDecimalThe amount of active points.

Class: LoyaltyRewardPointEntryType

The LoyaltyRewardPointEntryType object is an enum of different reward point entry types.

NameTypeDescription
NoneLoyaltyRewardPointEntryTypeUnassigned reward point entry type.
EarnLoyaltyRewardPointEntryTypeAn earned reward point.
RedeemLoyaltyRewardPointEntryTypeA 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.

NameTypeDescription
PointsNeededDecimalThe number of points required to meet the tier.

Class: LoyaltyProgramSummary

The LoyaltyProgramSummary object is used to represent a summary of the loyalty program.

NameTypeDescription
NameStringThe name of the program.
DescriptionStringA description of the program.
ShopNameStringThe name of the shop that the program is associated with.
LoyaltyProgramIdStringThe ID of the loyalty program for this summary.

Class: RewardPointType

The RewardPointType object is an enum of different reward point entry types.

NameTypeDescription
NotRedeemableRewardPointTypeThe points are not redeemable.
RedeemableRewardPointTypeThe points are redeemable.
If you have suggestions for improving this article, let us know!