Ejemplo n.º 1
0
        public static async Task PublishChallengeClosedIntegrationEventAsync(
            this IServiceBusPublisher publisher,
            ChallengeId challengeId,
            ChallengeParticipantPayouts payouts
            )
        {
            var integrationEvent = new ChallengeClosedIntegrationEvent
            {
                ChallengeId  = challengeId,
                PayoutPrizes =
                {
                    payouts.ToDictionary(
                        payoutPrize => payoutPrize.Key.ToString(),
                        payoutPrize => new CurrencyDto
                    {
                        Amount = payoutPrize.Value.Amount,
                        Type   = payoutPrize.Value.Type.ToEnum <EnumCurrencyType>()
                    })
                }
            };

            await publisher.PublishAsync(integrationEvent);
        }
Ejemplo n.º 2
0
 public ChallengeClosedDomainEvent(ChallengeId challengeId, ChallengeParticipantPayouts payouts)
 {
     ChallengeId = challengeId;
     Payouts     = payouts;
 }