Exemplo n.º 1
0
        public async Task <IActionResult> CreatedLastCheck(BaseCustomerRequestViewModel request)
        {
            CheckInfoResponse response = new CheckInfoResponse();
            var fromAddress            = await _walletService.GetWalletAdress(request.CustomerId);

            if (!string.IsNullOrEmpty(fromAddress))
            {
                var checkIdResponse = await _checkService.CreatedLastCheck(fromAddress);

                var datas = await _checkService.CheckInfo(fromAddress, checkIdResponse.CheckId);

                response = new CheckInfoResponse()
                {
                    Check = new Check()
                    {
                        Amount    = datas.Amount,
                        Creator   = datas.Creator,
                        CheckDate = TimeHelper.UnixTimestampToDateTime(datas.CheckDate),
                        Owner     = datas.Owner
                    }
                };
            }

            return(await Task.FromResult(Ok(response)));
        }