public async Task <IActionResult> CreatePayment([FromBody] PaymentSaveResource paymentResource)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var payment = mapper.Map <PaymentSaveResource, Payment>(paymentResource);

            repository.Add(payment);
            await unitOfWork.CompleteAsync();

            var installment = await installmentRepository.GetInstallment(payment.InstallmentId);

            var result = mapper.Map <Installment, InstallmentResourece>(installment);

            return(Created(nameof(CreatePayment), result));
        }
        public async Task <IActionResult> GetInstallment(int id)
        {
            var installment = await repository.GetInstallment(id);

            if (installment == null)
            {
                return(NotFound());
            }
            return(Ok(mapper.Map <Installment, InstallmentResoureceWithPayments>(installment)));
        }