Example #1
0
        public async Task DeleteAsync(Guid settlementId)
        {
            var settlement = await _settlementRepository.GetSettlementOrFailAsync(settlementId);

            foreach (var userId in settlement.UsersExpenseList)
            {
                var user = await _userRepository.GetAsync(userId.Key);

                user.RemoveSettlement(settlementId);
            }
            await _settlementRepository.DeleteSettlementAsync(settlement);
        }