Beispiel #1
0
        public void Create(LoanCreate request)
        {
            var employee = _employeeRepository.GetById(request.EmployeeId);
            var loan     = MapLoan(request, employee);

            _loanRepository.Add(loan);
        }
Beispiel #2
0
 private Loan MapLoan(LoanCreate request, Employee employee)
 {
     return(new Loan
     {
         Employee = employee,
         EmployeeId = employee.Id,
         Fees = request.Fees.Select(x => MapFee(request, employee, x)).ToList()
     });
 }
Beispiel #3
0
 private static LoanFee MapFee(LoanCreate request, Employee employee, LoanCreateFee x)
 {
     return(new LoanFee
     {
         Date = x.Date,
         Description = request.Description,
         Amount = -x.Amount,
         Employee = employee,
         EmployeeId = employee.Id
     });
 }