public void Tag(PlayerId playerId, RiskLevelId riskLevel, string description) { //TODO: validate if (_repository.PlayerRiskLevels.Any(x => x.RiskLevelId == riskLevel && x.PlayerId == playerId)) { throw new RegoValidationException("Already tagged with this Fraud Risk Level."); } Guid id = Guid.NewGuid(); var domain = new Entities.RiskLevel(); domain.TagPlayer(id, playerId, riskLevel, description); domain.Events.ForEach(ev => _eventBus.Publish(ev)); }
public void Untag(PlayerId id, string description) { //TODO: validate var domain = new Entities.RiskLevel(); var playerRiskLevel = _repository.PlayerRiskLevels.FirstOrDefault(x => x.Id == id); if (playerRiskLevel == null) { throw new ArgumentException("app:fraud.manager.message.invalidPlayerRiskLevelId"); } domain.UntagPlayer(id, playerRiskLevel.PlayerId, playerRiskLevel.RiskLevelId, description); domain.Events.ForEach(ev => _eventBus.Publish(ev)); }