예제 #1
0
        /// <summary>
        /// TODO need caching
        /// </summary>
        protected TransferDto CreateTransferDto(Transfer transfer, TransferType type, List <SIN> sinCache, List <ShopWallet> shopCache, string owner = "владелец кошелька", bool overdraft = false)
        {
            bool anon = transfer.Anonymous;

            return(new TransferDto
            {
                ModelId = "закрыто",
                Comment = transfer.Comment,
                TransferType = type.ToString(),
                Amount = BillingHelper.Round(transfer.Amount),
                NewBalance = overdraft ? 0 : type == TransferType.Incoming ? transfer.NewBalanceTo : transfer.NewBalanceFrom,
                OperationTime = transfer.OperationTime,
                From = GetWalletName(transfer.WalletFrom, anon, sinCache, shopCache, owner),
                To = GetWalletName(transfer.WalletTo, anon, sinCache, shopCache, owner),
                Anonimous = transfer.Anonymous,
                Id = transfer.Id,
                Overdraft = transfer.Overdraft,
                RentaId = transfer.RentaId
            });
        }