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.
We have a sample to show you how to handle the event. See: GiftCardConsumedEventHandler.
Sometimes your case is complicated.
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
.
- 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).
You can almost override everything. See the ABP document: Customizing the Existing Modules.