Class NotificationApplicationService
java.lang.Object
com.example.orderplatform.notifications.application.NotificationApplicationService
- All Implemented Interfaces:
NotificationLog
@Service
@Transactional
public class NotificationApplicationService
extends Object
implements NotificationLog
Application service that records notification intents after committed order and payment events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLists recently recorded notification intents.voidon(OrderCreatedEvent event) Records a customer notification intent for a committed order.voidon(PaymentAuthorizedEvent event) Records an operational notification intent for an authorized payment.
-
Constructor Details
-
NotificationApplicationService
-
-
Method Details
-
on
@TransactionalEventListener(phase=AFTER_COMMIT) @Transactional(propagation=REQUIRES_NEW) public void on(OrderCreatedEvent event) Records a customer notification intent for a committed order.- Parameters:
event- committed order event
-
on
@TransactionalEventListener(phase=AFTER_COMMIT) @Transactional(propagation=REQUIRES_NEW) public void on(PaymentAuthorizedEvent event) Records an operational notification intent for an authorized payment.- Parameters:
event- payment authorization event
-
listRecent
Lists recently recorded notification intents.- Specified by:
listRecentin interfaceNotificationLog- Returns:
- notification summaries in reverse creation order
-