Exemple #1
0
        public async Task <ResponseResult> Handle(PaymentsQuery paymentsQuery)
        {
            var paymemts = await _unitOfWork.PaymentRepository.Table.ToListAsync();

            _response.AddValue(new
            {
                payment = _mapper.Map <IEnumerable <Payment>, IEnumerable <PaymentDto> >(paymemts)
            });

            return(_response);
        }
        public async Task <IEnumerable <PaymentResponse> > GetPayments(CancellationToken token)
        {
            var query  = new PaymentsQuery(User.GetCountryClaim());
            var result = await _queryBus.QueryAsync(query, token);

            return(result.Select(s => new PaymentResponse()
            {
                StudyRoomSessionId = s.StudyRoomSessionId,
                Price = s.Price,
                IsSellerKeyExists = s.IsSellerKeyExists,
                IsPaymentKeyExists = s.IsPaymentKeyExists,
                TutorId = s.TutorId,
                TutorName = s.TutorName,
                UserId = s.UserId,
                UserName = s.UserName,
                Created = s.Created,
                Duration = s.Duration.TotalMinutes,
                IsRealDurationExitsts = s.IsRealDurationExitsts,
                RealDuration = s.RealDuration.TotalMinutes
            }));
        }
Exemple #3
0
 public async Task <IList <PaymentsViewModel> > Handle(PaymentsQuery request, CancellationToken cancellationToken)
 {
     return(await _paymentRepository.Payments(cancellationToken));
 }
Exemple #4
0
 public async Task AdminPaymentsQuery_Ok(string country)
 {
     var q1 = new PaymentsQuery(country);
     var _  = await _fixture.QueryBus.QueryAsync(q1, default);
 }
Exemple #5
0
        public async Task <ActionResult <IList <PaymentsViewModel> > > Payments()
        {
            PaymentsQuery command = new PaymentsQuery();

            return(await Send(command));
        }