Ejemplo n.º 1
0
 public function handle(Command $command)
 {
     $transaction = Transaction::createNew($command->date, $command->name, $command->from, $command->to, $command->code, $command->amount, $command->description);
     return new TransactionWasCreated($transaction->getId(), $transaction->getDate(), $transaction->getFrom()->name(), $transaction->getFrom()->getNumber(), $transaction->getTo()->getNumber(), $transaction->getCode(), $transaction->getAmount(), $transaction->getDescription()->full());
 }
Ejemplo n.º 2
0
 function it_should_filter_on_to_account()
 {
     $this->addTransaction(Transaction::createNew('20150730', 'This is a shorter description that is really long', '0987654321', '1234567890', "GT", "30,00", "This is a description"));
     $this->transactionsTo(Account::fromNumber("0987654321"))->count()->shouldBe(1);
     $this->transactionsFrom(Account::fromNumber("0987654321"))->count()->shouldBe(0);
 }