예제 #1
0
 private static decimal GetSupplementRate(DonationEventType eventType)
 => _eventTypeRateDictionary.ContainsKey(eventType) ? _eventTypeRateDictionary[eventType] : 0;
예제 #2
0
 public DonationEventLog(string eventData, DonationEventType type, string?userId = null)
 {
     EventData = eventData;
     UserId    = userId;
     Type      = type;
 }
예제 #3
0
        // would usually have this in its own class as it feels to be unrelated breaking cohesion,
        // but seems a bit overkill to do so in this case, perhaps even a simple static helper would be better
        public decimal GetGiftAidSupplementAmount(decimal giftAidAmount, DonationEventType eventType)
        {
            var supplementRate = GetSupplementRate(eventType);

            return(RoundToTwoPlaces(giftAidAmount * supplementRate * 0.01m));
        }