Exemple #1
0
 public Media(Guid mediaId, string posterUri, string mediaName, DateTime dateOfRelease, AwardStatus accolades, DateTime createdOn)
 {
     MediaId       = mediaId;
     PosterUri     = posterUri;
     MediaName     = mediaName;
     DateOfRelease = dateOfRelease;
     Accolades     = accolades;
     CreatedOn     = createdOn;
 }
Exemple #2
0
        public void RevokeAward(AwardStatus status, decimal amountRevoked)
        {
            if (amountRevoked > CurrentValue)
            {
                throw new Exception("Cannot revoke more than the award is worth");
            }

            CurrentValue = CurrentValue - (amountRevoked == 0.00m ? CurrentValue : amountRevoked);
            Status       = status;
        }
Exemple #3
0
        public void RedeemAward(decimal amountRedeemed)
        {
            if (amountRedeemed > CurrentValue)
            {
                throw new Exception("Cannot redeem more than the current value of the award");
            }

            CurrentValue = CurrentValue - amountRedeemed;
            Status       = CurrentValue == 0.00m ? AwardStatus.FullyRedeemed : AwardStatus.PartiallyRedeemed;
        }
Exemple #4
0
        public AwardStatus AddAward(Award award)
        {
            AwardStatus res = CheckAward(award);

            if (res == AwardStatus.Verified)
            {
                _awardsRepo.SaveAward(award);
            }

            return(res);
        }
        public void RevokeAward(Guid awardId, AwardStatus status, decimal amountRevoked = 0.00m)
        {
            if (!Awards.Any(a => a.Id == awardId))
            {
                return;
            }

            var award = Awards.Single(a => a.Id == awardId);

            award.RevokeAward(status, amountRevoked);
        }