Пример #1
0
        public void Handle(PayDepositCommand payDepositCommand)
        {
            var paymentId = PaymentId.From(payDepositCommand.AgreementId);
            var payment   = _paymentRepository.Get(paymentId);
            var accountId = AccountOwnerId.From(payDepositCommand.TenantId);
            var title     = Title.From("Deposit payment");

            _paymentService.PayDeposit(accountId, title, payment, paymentId);
        }
        public void Handle(DraftAccepted draftAccepted)
        {
            var sourceAccountOwnerId      = AccountOwnerId.From(draftAccepted.TenantId);
            var destinationAccountOwnerId = AccountOwnerId.From(draftAccepted.OwnerId);
            var sourceAccount             = _accountRepository.Get(sourceAccountOwnerId);
            var destinationAccount        = _accountRepository.Get(destinationAccountOwnerId);
            var money = Money.From(draftAccepted.Price);
            var title = Title.ToTransferTitle(draftAccepted.AgreementNumber);

            _transferMoneyService.Transfer(sourceAccount, destinationAccount, money, title);
        }