Examples of MonetaryAmount


Examples of common.money.MonetaryAmount

  }

  public RewardConfirmation rewardAccountFor(Dining dining) {
    Account account = accountRepository.findByCreditCard(dining.getCreditCardNumber());
    Restaurant restaurant = restaurantRepository.findByMerchantNumber(dining.getMerchantNumber());
    MonetaryAmount amount = restaurant.calculateBenefitFor(account, dining);
    AccountContribution contribution = account.makeContribution(amount);
    accountRepository.updateBeneficiaries(account);
    return rewardRepository.confirmReward(contribution, dining);
  }
View Full Code Here

Examples of common.money.MonetaryAmount

   * @return an allocated beneficiary
   * @throws SQLException an exception occurred extracting data from the result set
   */
  private Beneficiary mapBeneficiary(ResultSet rs) throws SQLException {
    String name = rs.getString("BENEFICIARY_NAME");
    MonetaryAmount savings = MonetaryAmount.valueOf(rs.getString("BENEFICIARY_SAVINGS"));
    Percentage allocationPercentage = Percentage.valueOf(rs.getString("BENEFICIARY_ALLOCATION_PERCENTAGE"));
    return new Beneficiary(name, allocationPercentage, savings);
  }
View Full Code Here

Examples of common.money.MonetaryAmount

   * @return an allocated beneficiary
   * @throws SQLException an exception occurred extracting data from the result set
   */
  private Beneficiary mapBeneficiary(ResultSet rs) throws SQLException {
    String name = rs.getString("BENEFICIARY_NAME");
    MonetaryAmount savings = MonetaryAmount.valueOf(rs.getString("BENEFICIARY_SAVINGS"));
    Percentage allocationPercentage = Percentage.valueOf(rs.getString("BENEFICIARY_ALLOCATION_PERCENTAGE"));
    return new Beneficiary(name, allocationPercentage, savings);
  }
View Full Code Here

Examples of common.money.MonetaryAmount

   * @return the individual beneficiary distributions
   */
  private Set<Distribution> distribute(MonetaryAmount amount) {
    Set<Distribution> distributions = new HashSet<Distribution>(beneficiaries.size());
    for (Beneficiary beneficiary : beneficiaries) {
      MonetaryAmount distributionAmount = amount.multiplyBy(beneficiary.getAllocationPercentage());
      beneficiary.credit(distributionAmount);
      Distribution distribution = new Distribution(beneficiary.getName(), distributionAmount, beneficiary
          .getAllocationPercentage(), beneficiary.getSavings());
      distributions.add(distribution);
    }
View Full Code Here

Examples of common.money.MonetaryAmount

      FieldSet fields = reader.read();
      if (fields == null) {
        return null;
      }

      MonetaryAmount amount;
      String creditCardNumber;
      String merchantNumber;
      SimpleDate date;
      try {
        amount = MonetaryAmount.valueOf(fields.readString(0));
View Full Code Here

Examples of common.money.MonetaryAmount

    verifyInsertedValues(confirmation, dining, values);
  }

  private void verifyInsertedValues(RewardConfirmation confirmation, Dining dining, Map<String, Object> values) {
   
    assertEquals(confirmation.getAccountContribution().getAmount(), new MonetaryAmount((Double) values
        .get("REWARD_AMOUNT")));
    assertEquals(SimpleDate.today().asDate(), values.get("REWARD_DATE"));
    assertEquals(confirmation.getAccountContribution().getAccountNumber(), values.get("ACCOUNT_NUMBER"));
    assertEquals(dining.getAmount(), new MonetaryAmount((Double) values.get("DINING_AMOUNT")));
    assertEquals(dining.getMerchantNumber(), values.get("DINING_MERCHANT_NUMBER"));
    assertEquals(SimpleDate.today().asDate(), values.get("DINING_DATE"));
  }
View Full Code Here

Examples of common.money.MonetaryAmount

  }

  public RewardConfirmation rewardAccountFor(Dining dining) {
    Account account = accountRepository.findByCreditCard(dining.getCreditCardNumber());
    Restaurant restaurant = restaurantRepository.findByMerchantNumber(dining.getMerchantNumber());
    MonetaryAmount amount = restaurant.calculateBenefitFor(account, dining);
    AccountContribution contribution = account.makeContribution(amount);
    accountRepository.updateBeneficiaries(account);
    return rewardRepository.confirmReward(contribution, dining);
  }
View Full Code Here

Examples of common.money.MonetaryAmount

  public RewardConfirmation rewardAccountFor(Dining dining) {

    Account account = accountMapper.findByCreditCard(dining.getCreditCardNumber());
    Restaurant restaurant = restaurantMapper.findByMerchantNumber(dining.getMerchantNumber());
    MonetaryAmount amount = restaurant.calculateBenefitFor(account, dining);
    AccountContribution contribution = account.makeContribution(amount);
    updateBeneficiaries(account);
    return rewardRepository.confirmReward(contribution, dining);
  }
View Full Code Here

Examples of de.zalando.sprocwrapper.example.MonetaryAmount

    }

    @Override
    public MonetaryAmount marshalToDb(final OrderMonetaryAmount bound) {
        LOG.info(bound.getCurrency() + " " + bound.getAmount());
        return new MonetaryAmount(bound.getAmount(), bound.getCurrency());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.