示例#1
0
        public static WireTransfer WrapToWireTransfer(this WireTransferDto wireTransferDto)
        {
            var wireTransfer = new WireTransferBuilder()
                               .WithId(wireTransferDto.Id)
                               .WithType(wireTransferDto.WireTransferType)
                               .WithProtocol(wireTransferDto.Protocol.Code,
                                             wireTransferDto.Protocol.Status,
                                             wireTransferDto.Protocol.Number)
                               .WithSenderBankAccount(new BankAccountBuilder()
                                                      .WithBankAccountHolder(wireTransferDto.Sender.Name,
                                                                             wireTransferDto.Sender.Document.Number)
                                                      .WithBankAccountDetails(wireTransferDto.Sender.Account,
                                                                              wireTransferDto.Sender.Branch,
                                                                              wireTransferDto.Sender.Number)
                                                      .Build())
                               .WithBeneficiaryBankAccount(new BankAccountBuilder()
                                                           .WithBankAccountHolder(wireTransferDto.Beneficiary.Name,
                                                                                  wireTransferDto.Beneficiary.Document.Number)
                                                           .WithBankAccountDetails(wireTransferDto.Beneficiary.Account,
                                                                                   wireTransferDto.Beneficiary.Branch,
                                                                                   wireTransferDto.Beneficiary.Number)
                                                           .Build())
                               .WithAmount(wireTransferDto.Amount, Currency.Get("brl"))
                               .WithTradeDate(wireTransferDto.TradeDate)
                               .Build();

            return(wireTransfer);
        }
        public async Task <IActionResult> RegisterIncomingTransfer(
            [FromBody] WireTransferDto registerWireTransferRequest)

        {
            Log.LogInformation(registerWireTransferRequest);

            var registerIncomingTransferCommandResult =
                await _mediator.Send(new RegisterWireTransferCommand(registerWireTransferRequest));

            registerIncomingTransferCommandResult.AddSelfLik(RequestHost);
            return(Created(string.Empty, registerIncomingTransferCommandResult));
        }
示例#3
0
        /// <summary>
        ///     Populate <see cref="WireTransferDto" /> with transaction uuid and remove beneficiary details from result
        /// </summary>
        /// <param name="wireTransferDto"></param>
        /// <param name="wireTransfer"></param>
        /// <returns></returns>
        public static WireTransferDto SeedRelationships(this WireTransferDto wireTransferDto,
                                                        WireTransfer wireTransfer)
        {
            wireTransferDto.Transaction = new TransactionDto
            {
                Id = Guid.Parse(wireTransfer.TransactionId.Value.ToString())
            };

            wireTransferDto.Account = new AccountDto
            {
                Id = Guid.Parse(wireTransfer.BeneficiaryBankAccount.BankAccountId.Value.ToString())
            };

            wireTransferDto.Beneficiary = null;

            return(wireTransferDto);
        }
 public PublishWireTransferOnTopicNotification(WireTransferDto wireTransfer)
 {
     WireTransfer = wireTransfer;
 }