@Override
  public void create(Movement movement, Account account) throws Exception {

    OrmLiteAccount ormLiteAccount = accountDao.queryForId(account.getNumber());

    if (account.canProcessMovement(movement)) {
      if (movement.getType() == MOVEMENT_TYPE.CREDIT) {
        ormLiteAccount.setValue(ormLiteAccount.getValue() + movement.getValue());
      } else {
        ormLiteAccount.setValue(ormLiteAccount.getValue() - movement.getValue());
      }
      accountDao.update(ormLiteAccount);

      OrmLiteMovement ormLiteMovement = new OrmLiteMovement();
      ormLiteMovement.setDate(new Date());
      ormLiteMovement.setValue(movement.getValue());
      ormLiteMovement.setType(movement.getType().toString());
      ormLiteMovement.setAccount(ormLiteAccount);
      movementDao.create(ormLiteMovement);
    }
  }
 @Override
 public List<Movement> getMovements(Account account) {
   List<Movement> movements = new ArrayList<Movement>();
   try {
     List<OrmLiteMovement> localQuery =
         movementDao.queryForEq(OrmLiteMovement.ACCOUNT, account.getNumber());
     for (OrmLiteMovement ormLiteMovement : localQuery) {
       movements.add(OrmLiteMovement.to(ormLiteMovement));
     }
   } catch (Exception e) {
   } finally {
     return movements;
   }
 }