Documentation ¶
Index ¶
- type AddToCartEvent
- type ChangedQtyInCartEvent
- type DefaultEventPublisher
- func (d *DefaultEventPublisher) Inject(logger flamingo.Logger, productService productDomain.ProductService, ...)
- func (d *DefaultEventPublisher) PublishAddToCartEvent(ctx context.Context, cart *cartDomain.Cart, marketPlaceCode string, ...)
- func (d *DefaultEventPublisher) PublishChangedQtyInCartEvent(ctx context.Context, cart *cartDomain.Cart, item *cartDomain.Item, ...)
- func (d *DefaultEventPublisher) PublishOrderPlacedEvent(ctx context.Context, cart *cartDomain.Cart, ...)
- type EventPublisher
- type OrderPlacedEvent
- type PaymentSelectionHasBeenResetEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddToCartEvent ¶
type AddToCartEvent struct { Cart *cartDomain.Cart MarketplaceCode string VariantMarketplaceCode string ProductName string Qty int }
AddToCartEvent defines event properties
type ChangedQtyInCartEvent ¶
type ChangedQtyInCartEvent struct { Cart *cartDomain.Cart // Deprecated: CartID exists for compatibility, use Cart instead CartID string MarketplaceCode string VariantMarketplaceCode string ProductName string QtyBefore int QtyAfter int }
ChangedQtyInCartEvent defines event properties
type DefaultEventPublisher ¶
type DefaultEventPublisher struct {
// contains filtered or unexported fields
}
DefaultEventPublisher implements the event publisher of the domain and uses the framework event router
func (*DefaultEventPublisher) Inject ¶
func (d *DefaultEventPublisher) Inject( logger flamingo.Logger, productService productDomain.ProductService, eventRouter flamingo.EventRouter, )
Inject dependencies
func (*DefaultEventPublisher) PublishAddToCartEvent ¶
func (d *DefaultEventPublisher) PublishAddToCartEvent(ctx context.Context, cart *cartDomain.Cart, marketPlaceCode string, variantMarketPlaceCode string, qty int)
PublishAddToCartEvent publishes an event for add to cart actions
func (*DefaultEventPublisher) PublishChangedQtyInCartEvent ¶
func (d *DefaultEventPublisher) PublishChangedQtyInCartEvent(ctx context.Context, cart *cartDomain.Cart, item *cartDomain.Item, qtyBefore int, qtyAfter int)
PublishChangedQtyInCartEvent publishes an event for cart item quantity change actions
func (*DefaultEventPublisher) PublishOrderPlacedEvent ¶
func (d *DefaultEventPublisher) PublishOrderPlacedEvent(ctx context.Context, cart *cartDomain.Cart, placedOrderInfos placeorder.PlacedOrderInfos)
PublishOrderPlacedEvent publishes an event for placed orders
type EventPublisher ¶
type EventPublisher interface { PublishAddToCartEvent(ctx context.Context, cart *cartDomain.Cart, marketPlaceCode string, variantMarketPlaceCode string, qty int) PublishChangedQtyInCartEvent(ctx context.Context, cart *cartDomain.Cart, item *cartDomain.Item, qtyBefore int, qtyAfter int) PublishOrderPlacedEvent(ctx context.Context, cart *cartDomain.Cart, placedOrderInfos placeorder.PlacedOrderInfos) }
EventPublisher technology free interface to publish events that might be interesting for outside (Publish)
type OrderPlacedEvent ¶
type OrderPlacedEvent struct { Cart *cartDomain.Cart PlacedOrderInfos placeorder.PlacedOrderInfos }
OrderPlacedEvent defines event properties
type PaymentSelectionHasBeenResetEvent ¶
type PaymentSelectionHasBeenResetEvent struct { Cart *cartDomain.Cart ResettedPaymentSelection *cartDomain.PaymentSelection }
PaymentSelectionHasBeenResetEvent defines event properties