Documentation
¶
Index ¶
- func HandleCurrencyConverted(bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger) func(ctx context.Context, e events.Event) error
- func HandleRequested(bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger) func(ctx context.Context, e events.Event) error
- func HandleValidated(bus eventbus.Bus, uow repository.UnitOfWork, paymentProvider payment.Payment, ...) eventbus.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleCurrencyConverted ¶
func HandleCurrencyConverted( bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger, ) func( ctx context.Context, e events.Event, ) error
HandleCurrencyConverted performs domain validation after currency conversion for withdrawals. Emits WithdrawBusinessValidated event to trigger payment initiation.
func HandleRequested ¶
func HandleRequested( bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger, ) func( ctx context.Context, e events.Event, ) error
HandleRequested handles WithdrawRequested events by validating and persisting the withdraw. This follows the new event flow pattern: Requested -> HandleRequested (validate and persist).
func HandleValidated ¶ added in v1.4.0
func HandleValidated( bus eventbus.Bus, uow repository.UnitOfWork, paymentProvider payment.Payment, logger *slog.Logger, ) eventbus.HandlerFunc
HandleValidated handles WithdrawValidated events by initiating a payout. It's responsible for starting the external payout process to the user's connected account. The function follows these steps: 1. Validates the withdrawal request 2. Retrieves user's Stripe Connect account 3. Prepares and initiates the payout 4. Emits appropriate events for the transaction lifecycle
Types ¶
This section is empty.