# Handling Consumption Event
When a gift card is consumed, it will publish a distributed event with GiftCardConsumedEto
, so other modules can provide services to the consumer by handling this event.
# How to Handle?
We have a sample to show you how to handle the event. See: GiftCardConsumedEventHandler (opens new window).
# Advanced Usage
Sometimes your case is complicated.
# Consumption with ExtraProperties
For example: You want to create a new tenant by consuming a gift card, you need to input TenantName
.
- When you are consuming, input the
ExtraProperties
withTenantName
in the ConsumeGiftCardDto. - The GiftCardConsumedEto will carry the information as
GiftCardExtraProperties
.
# Allow Anonymous Consuming
- Set property
AnonymousConsumptionAllowed
of the entity GiftCardTemplate totrue
. - Do not use the default consumption page (since it requires the permission and do not support customizing the ExtraProperties).
# Customization
You can almost override everything. See the ABP document: Customizing the Existing Modules (opens new window).