コード例 #1
0
 private OperationLocation getOperationLocation(long operationLocationNumber)
     throws BusinessException {
   OperationLocation operationLocation = database.getOperationLocation(operationLocationNumber);
   if (operationLocation == null) {
     throw new BusinessException("exception.invalid.operation.location");
   }
   return operationLocation;
 }
コード例 #2
0
 @Override
 public EnvelopeDeposit depositEnvelope(
     long operationLocation, long branch, long accountNumber, long envelope, double amount)
     throws BusinessException {
   CurrentAccount currentAccount = readCurrentAccount(branch, accountNumber);
   EnvelopeDeposit deposit =
       currentAccount.depositEnvelope(getOperationLocation(operationLocation), envelope, amount);
   database.save(deposit);
   return deposit;
 }
コード例 #3
0
  private CurrentAccount readCurrentAccount(long branch, long accountNumber)
      throws BusinessException {
    CurrentAccountId id = new CurrentAccountId(new Branch(branch), accountNumber);
    CurrentAccount currentAccount = database.getCurrentAccount(id);

    if (currentAccount == null) {
      throw new BusinessException("exception.inexistent.account");
    }

    return currentAccount;
  }