The gift cards domain model

Version: 10.3

This section describes the domain model that represents the gift 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:

Class diagram of the gift card domain model
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 provided by default, the implementation can be replaced. All instantiation of actual classes will be handled through dependency injection.

Class: GiftCard

The GiftCard class is responsible for representing a gift card entity in an external system.

Name

Type

Description

ExternalId

String

Unique identifier for the product in the commerce system. This can be used to get a reference to the product using the commerce system's native API.

Name

String

The name, if any, of the gift card.

CustomerId

String

The identifier of the owner of the card.

ShopName

String

The shop the card is associated to if any.

CurrencyCode

String

The currency of the card value.

Balance

Decimal

The remaining value of the card.

OriginalAmount

Decimal

The initial value of the card.

Description

String

Reference to the manufacturers.

Class: GiftCardPaymentInfo

The GiftCardPaymentInfo class is an implementation of the PaymentInfo class that allows a payment to be made with a gift card.

Name

Type

Description

Amount

Decimal

The amount being charged against the gift card.

CardNumber

String

The ID of the gift card being used for payment.

Do you have some feedback for us?

If you have suggestions for improving this article,