Package com.wesabe.api.accounts.entities

Examples of com.wesabe.api.accounts.entities.AccountBalance


    @Before
    public void setup() throws Exception {
      checking.setCurrency(USD);
      savings.setCurrency(USD);
     
      inject(Account.class, checking, "accountBalances", Sets.newHashSet(new AccountBalance(checking, decimal("100.00"), new DateTime())));
      inject(Account.class, savings, "accountBalances", Sets.newHashSet(new AccountBalance(savings, decimal("100.00"), new DateTime())));
     
      this.starbucksMerchant = new Merchant("Starbucks");
      this.wholeFoodsMerchant = new Merchant("Whole Foods");
      this.transferMerchant = new Merchant("Transfer");
     
View Full Code Here


    @Before
    public void setup() throws Exception {
      checking.setCurrency(USD);
      savings.setCurrency(USD);
     
      inject(Account.class, checking, "accountBalances", Sets.newHashSet(new AccountBalance(checking, decimal("100.00"), new DateTime())));
      inject(Account.class, savings, "accountBalances", Sets.newHashSet(new AccountBalance(savings, decimal("100.00"), new DateTime())));
     
      starbucks.setStatus(TxactionStatus.ACTIVE);
      wholeFoods.setStatus(TxactionStatus.ACTIVE);
      interestEarned.setStatus(TxactionStatus.ACTIVE);
     
View Full Code Here

    @Before
    public void setup() throws Exception {
      checking.setCurrency(USD);
      savings.setCurrency(USD);
     
      inject(Account.class, checking, "accountBalances", Sets.newHashSet(new AccountBalance(checking, decimal("100.00"), new DateTime())));
      inject(Account.class, savings, "accountBalances", Sets.newHashSet(new AccountBalance(savings, decimal("100.00"), new DateTime())));
     
      starbucks.setStatus(TxactionStatus.ACTIVE);
      wholeFoods.setStatus(TxactionStatus.ACTIVE);
      interestEarned.setStatus(TxactionStatus.ACTIVE);
     
View Full Code Here

    public void itIgnoresAllButTheFirstAccountBalance() throws Exception {
      for (int i = 0; i < 10; i++) {
        txactions.add(new Txaction(account, decimal("-5.00"), now().minusDays(20+i)));
      }
      // create a balance in the middle of those txactions
      accountBalances.add(new AccountBalance(account, decimal("5000"), now().minusDays(25)));
     
      TxactionBalanceCalculator calculator = calculator();
      assertEquals(money("100.00", USD), calculator.getBalance(txactions.get(0)));
      assertEquals(money("110.00", USD), calculator.getBalance(txactions.get(1)));
      assertEquals(money("115.00", USD), calculator.getBalance(txactions.get(2)));
View Full Code Here

    @Before
    public void setup() throws Exception {
      checking.setCurrency(USD);
      savings.setCurrency(USD);
     
      inject(Account.class, checking, "accountBalances", Sets.newHashSet(new AccountBalance(checking, decimal("100.00"), new DateTime())));
      inject(Account.class, savings, "accountBalances", Sets.newHashSet(new AccountBalance(savings, decimal("100.00"), new DateTime())));
     
      starbucks.setStatus(TxactionStatus.ACTIVE);
      wholeFoods.setStatus(TxactionStatus.ACTIVE);
      interestEarned.setStatus(TxactionStatus.ACTIVE);
     
View Full Code Here

    @Before
    public void setup() throws Exception {
      checking.setCurrency(USD);
      savings.setCurrency(USD);
     
      inject(Account.class, checking, "accountBalances", Sets.newHashSet(new AccountBalance(checking, decimal("100.00"), new DateTime())));
      inject(Account.class, savings, "accountBalances", Sets.newHashSet(new AccountBalance(savings, decimal("100.00"), new DateTime())));
     
      starbucks.setStatus(TxactionStatus.ACTIVE);
      wholeFoods.setStatus(TxactionStatus.ACTIVE);
      interestEarned.setStatus(TxactionStatus.ACTIVE);
     
View Full Code Here

  public static class An_Account_With_Uploads {
    private final Account account = new Account("Checking", USD);
   
    @Before
    public void setup() throws Exception {
      AccountBalance balance = new AccountBalance(account, decimal("100.00"), jun14th);
      inject(Account.class, account, "accountBalances", Sets.newHashSet(balance));
      inject(Account.class, account, "accountTypeId", AccountType.CHECKING.getValue());
      inject(AccountBalance.class, balance, "createdAt", jun15th);
    }
View Full Code Here

    @Before
    public void setup() throws Exception {
      Set<AccountBalance> accountBalances = Sets.newHashSet();
     
      accountBalances.add(new AccountBalance(account, decimal("10.00"), new DateTime()));
     
      inject(Account.class, account, "balance", null);
      inject(Account.class, account, "accountBalances", accountBalances);
    }
View Full Code Here

    private final static Account account = Account.ofType(AccountType.MANUAL);
   
    @Before
    public void setup() throws Exception {
      Set<AccountBalance> accountBalances = Sets.newHashSet(
          new AccountBalance(account, decimal("10.00"), apr1st));
     
      inject(Account.class, account, "accountBalances", accountBalances);
     
      Set<Txaction> txactions = Sets.newHashSet(
          new Txaction(account, decimal("-1.50"), jun14th));
View Full Code Here

      @Context Locale locale,
      @PathParam("accountId") IntegerParam accountId,
      @PathParam("balanceId") IntegerParam balanceId) {
   
    final Account account = accountDAO.findAccount(user.getAccountKey(), accountId.getValue());
    final AccountBalance accountBalance = accountBalanceDAO.findAccountBalance(user.getAccountKey(), balanceId.getValue());
   
    if (accountBalance == null || account == null || !account.equals(accountBalance.getAccount())) {
      throw new WebApplicationException(Status.NOT_FOUND);
    }
   
    return accountBalancePresenter.present(accountBalance, locale);
  }
View Full Code Here

TOP

Related Classes of com.wesabe.api.accounts.entities.AccountBalance

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.