예제 #1
0
        public async Task CreateAsync(Guid settlementId, Guid userId, string name, decimal cost)
        {
            var settlement = await _settlementRepository.GetSettlementOrFailAsync(settlementId);

            var expense = new Expense(Guid.NewGuid(), userId, name, cost);
            await _settlementRepository.AddExpenseAsync(expense, settlementId);

            var user = await _userRepository.GetAsync(userId);

            user.AddSettlement(settlementId);
            manager.Settle(settlement);
        }