Package com.excilys.ebi.bank.model.entity

Examples of com.excilys.ebi.bank.model.entity.Operation


            return input.getCard().getId();
          }
        });

    for (Entry<Card, BigDecimal[]> entry : sums.entrySet()) {
      Operation creditSum = creditSumsIndexedByCardId.get(entry.getKey().getId());
      if (creditSum != null) {
        entry.getValue()[0] = creditSum.getAmount();
      }
      Operation debitSum = debitSumsIndexedByCardId.get(entry.getKey().getId());
      if (debitSum != null) {
        entry.getValue()[1] = debitSum.getAmount();
      }
    }

    return sums;
  }
View Full Code Here


    DateTime now = now();
    OperationStatusRef status = operationStatusDao.findOne(OperationStatus.RESOLVED);
    OperationTypeRef type = operationTypeDao.findOne(OperationType.TRANSFER);

    Operation debitOperation = newOperation().withName("transfert -" + amount).withAccount(debitedAccount).withAmount(amount.negate()).withDate(now).withStatus(status)
        .withType(type).build();
    Operation creditOperation = newOperation().withName("transfert +" + amount).withAccount(creditedAccount).withAmount(amount).withDate(now).withStatus(status).withType(type)
        .build();

    operationDao.save(debitOperation);
    operationDao.save(creditOperation);
  }
View Full Code Here

TOP

Related Classes of com.excilys.ebi.bank.model.entity.Operation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.