Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
790dad9
added target/
Jan 22, 2020
c40830f
isEmailValidtest update
Jan 22, 2020
432eadf
isEmailValidtest update
Jan 22, 2020
23f892d
isEmailValidtest update
Jan 24, 2020
0826b99
isEmailValidtest update with equivalence clases and border cases
cmartano Jan 27, 2020
f153d22
withdraw test with equivalence classes
cmartano Jan 28, 2020
2414e94
withdraw test with equivalence classes error fix
cmartano Jan 28, 2020
a595550
isAmountValidTest added
cmartano Jan 29, 2020
aaf8369
constructor code and test updated
cmartano Jan 29, 2020
3309bd3
Deposit and Transfer methods added, all tests updated and passing
cmartano Jan 29, 2020
e03a8f7
deposit and transfer tests added
cmartano Jan 31, 2020
5edc45a
Deposit and transfer methods complete, all tests passing
cmartano Jan 31, 2020
1448d95
Add files via upload
cmartano Feb 3, 2020
8e38e34
Add files via upload
cmartano Feb 3, 2020
1eb0873
new files added in src/main
cmartano Feb 3, 2020
e4b6542
packages set
cmartano Feb 4, 2020
74eebfc
added import package in CentralBank
taikurii Feb 4, 2020
edc7433
checking and savings accounts along w bank account list in central banl
cmartano Feb 5, 2020
13d17a6
Added comments to branch
IoanDascalu Feb 5, 2020
45cdc3d
checkbalance test
cmartano Feb 5, 2020
6e2d0d5
updated classes to match our class diagram
cmartano Feb 6, 2020
232f38d
admin constructor and account collection added
cmartano Feb 9, 2020
f6c1179
update on atm,teller,user,admin classes
cmartano Feb 10, 2020
79eaf66
more updates to class structure
cmartano Feb 10, 2020
7e58f45
Fixed merge conflicts on this branch
IoanDascalu Feb 10, 2020
634cc48
added + started writing AdminTest
taikurii Feb 11, 2020
cc4063a
added transactionHistory property to BankAccount and added functionality
taikurii Feb 11, 2020
761cb84
test
taikurii Feb 11, 2020
5f88cf7
I'm midway through writing my code
IoanDascalu Feb 11, 2020
43edcd8
calcTotalAssetsTest WIP
taikurii Feb 11, 2020
df86a8b
updated CentralBank constructor
taikurii Feb 11, 2020
33612fc
freeze and unfreeze tests added
cmartano Feb 11, 2020
a3774a0
freeze and unfreeze tests added
cmartano Feb 11, 2020
2d076a7
freeze and unfreeze methods added, along with data members and constr…
cmartano Feb 11, 2020
2039ab4
Merge branch 'master' into freezeunfreezeaccount
cmartano Feb 11, 2020
190151d
merge test
cmartano Feb 11, 2020
c0189e2
Merge pull request #1 from cmartano/freezeunfreezeaccount
taikurii Feb 11, 2020
bf7935d
fixed merge conflict due to java versions (?)
taikurii Feb 11, 2020
76d5ae3
finished calcTotalAssetsTest
taikurii Feb 11, 2020
1d6b790
implemented calcTotalAssets
taikurii Feb 11, 2020
c0ea754
added tests for findAccIdsWithSuspiciousActivity
taikurii Feb 11, 2020
562b99f
added Transaction class and fixed transactionHistory, implemented fin…
taikurii Feb 11, 2020
1f141eb
confirmcredentials test added in ATMTest
cmartano Feb 11, 2020
c4a22b0
Added tests for TellerTest
IoanDascalu Feb 11, 2020
8653e68
Fixed merge conflicts
IoanDascalu Feb 11, 2020
7d93f15
confirm credentials method added and updated user with getters
cmartano Feb 11, 2020
595fb57
confirm credentials method added and updated user with getters
cmartano Feb 11, 2020
f564b23
Merge remote-tracking branch 'origin/master'
cmartano Feb 11, 2020
620a2c5
Made minor changes to have teller and tellerTests work with the new w…
IoanDascalu Feb 11, 2020
e0675f6
Merge remote-tracking branch 'origin/master'
IoanDascalu Feb 11, 2020
6a96419
I'm sorry
IoanDascalu Feb 11, 2020
65df2e2
changed SavingsAccount.java
taikurii Feb 11, 2020
719800d
getbankaccounts added to central bank
cmartano Feb 11, 2020
142d1f0
Created a branch and wrote create method
IoanDascalu Feb 11, 2020
71c8854
Merged master branch
IoanDascalu Feb 11, 2020
d13911b
Fixed the testers such that they pass.
IoanDascalu Feb 12, 2020
df7fda1
Added two more tests
IoanDascalu Feb 12, 2020
ed17065
Added sequence diagram to read me
IoanDascalu Feb 12, 2020
8f055b4
Update README.md
cmartano Feb 12, 2020
7274781
Update README.md
cmartano Feb 12, 2020
1345012
added suspiciousAccount sequence diagram to ReadMe, added SystemTest
taikurii Feb 12, 2020
cc12821
Added SequenceDiagram.pdf
IoanDascalu Feb 12, 2020
63f3b36
Sequence diagram link
IoanDascalu Feb 12, 2020
0c510b1
Editted the read me
IoanDascalu Feb 12, 2020
082df77
added notes from code review to readme
taikurii Feb 14, 2020
a1bdca2
fixed readme merge conflict
taikurii Feb 14, 2020
4904141
added tests & implementation for new Transaction features - balance b…
taikurii Feb 14, 2020
37a9c76
user class implemented, teller methods and tests updated
cmartano Feb 14, 2020
810fece
Merge branch 'master' into improvedHistory
taikurii Feb 14, 2020
61cc4af
Merge pull request #2 from cmartano/improvedHistory
taikurii Feb 14, 2020
5d606d4
Added link to state diagram
IoanDascalu Feb 16, 2020
c3d25a1
deposit and withdraw tests and functons implemented
cmartano Feb 17, 2020
3187f35
transfer tests and method implemented along with really quick impleme…
cmartano Feb 17, 2020
fc067a8
re-ordered expcetions in the withdraw function to prioritize illegal …
cmartano Feb 17, 2020
aa69d79
ATM UI layout
cmartano Feb 18, 2020
1f10699
AtmUI implementation - WIP
taikurii Feb 18, 2020
c14fdf2
finished AtmUI
taikurii Feb 18, 2020
0f74e47
ui class complete w accounts and users, confirm credentials issue
cmartano Feb 18, 2020
cef8dba
Fixed error in the code, and started a test script
IoanDascalu Feb 18, 2020
69805f3
Removed unnesecery code, fixed the rest of the comparing string code …
IoanDascalu Feb 18, 2020
3c06888
ADDED text script
IoanDascalu Feb 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

target/


# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
Expand Down
1 change: 1 addition & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/sbt.xml → .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# SoftwareEngineeringPractice
## grading

To Do | correct
---|---
at least 8 commits|
isEmailValid|
withdraw|
isamountValid|
constructor & withdraw fix|

Link to state diagram: https://drive.google.com/file/d/1BPTHJmOLGr9hiQ0BJnvLTYXEDLRx6saK/view?usp=sharing

link to Ioan's sequence diagram: https://drive.google.com/file/d/1fHwd0fRkoscI03Zu2G8p7B5D6bBiBh87/view?usp=sharing
link to Aidan's sequence diagram: https://drive.google.com/file/d/1L447NcwgO0GbktDt5HXLOZCDhwc7hFZX/view?usp=sharing

* UML Diagram - https://drive.google.com/file/d/1BKs9DEbUAkv-ynNGjp099HZ6vRylucr6/view?usp=sharing
* Use Case Diagram - https://drive.google.com/file/d/1OTOZ-MegXgHVpB8rYiUERVfmFXZhzAlF/view?usp=sharing
* freeze account sequence diagram - https://drive.google.com/file/d/19AFoU-Of_jHAxNgIwXVeigCMnlGSpC1D/view?usp=sharing
* unfreeze account sequence diagram - https://drive.google.com/file/d/1AA96lVdDmQhyHeB5tIYJtLMJNSpWDMh1/view?usp=sharing


Plan for Friday:
Update the class diagram to better include the user class.
Update the use case diagram to include confirm credentials and check balances. As well as clarify "request report"
Change our code to better implement the user. Change the code to work again with both the collection of bankaccount and user.

Aidan - Code review notes:
Class diagram - savings & checkings should inherit, transaction should be a composition to BankAccount
Code - tests for multiple suspicious transactions, timestamps - multiple rapid transactions
Binary file added SequenceDiagram.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions SoftwareEngineeringPractice.iml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.10</java.version>
<java.version>1.13</java.version>

<junit.version>4.12</junit.version>
<junit.jupiter.version>5.0.0</junit.jupiter.version>
Expand Down
151 changes: 151 additions & 0 deletions src/main/java/edu/ithaca/dragon/bank/ATM.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
package edu.ithaca.dragon.bank;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class ATM implements BasicAPI {
CentralBank bank;

public ATM(CentralBank bank) {
this.bank = bank;
}

public boolean confirmCredentials(String username, String password) {

Iterator<User> itr = this.bank.users.iterator();
while (itr.hasNext()) {
User current = itr.next();
if (current.getUsername().equals(username)) {
if (current.getPassword().equals(password)) {
return true;
}
}
}

return false;
}

public User getUser(String username, String password) {
Iterator<User> itr = this.bank.users.iterator();
while (itr.hasNext()) {
User current = itr.next();
if (current.getUsername().equals(username)) {
if (current.getPassword().equals(password)) {
return current;
}
}
}
return null;
}

public double checkBalance(String acctId) {
Iterator<BankAccount> itr = this.bank.accounts.iterator();
while (itr.hasNext()) {
BankAccount current = itr.next();
if (current.getAcctId().equals(acctId)) {
return current.getBalance();
}
}
throw new IllegalArgumentException("invalid account id");
}


public void withdraw(String acctId, double amount) throws InsufficientFundsException, IllegalArgumentException {
Iterator<BankAccount> itr = this.bank.accounts.iterator();
while (itr.hasNext()) {
BankAccount current = itr.next();
if (current.getAcctId().equals(acctId)) {
if (!current.isAmountValid(amount)) {
throw new IllegalArgumentException("Invalid Amount");
}

if (current.getBalance() < amount) {
throw new InsufficientFundsException("Not enough funds");
}
if (current.isAmountValid(amount)) {
double balance = current.getBalance();
balance -= amount;
current.setBalance(balance);
return;
}
}
}
throw new IllegalArgumentException("invalid account id");

}

public void deposit(String acctId, double amount) {
Iterator<BankAccount> itr = this.bank.accounts.iterator();
while (itr.hasNext()) {
BankAccount current = itr.next();
if (current.getAcctId() == acctId) {
if (current.isAmountValid(amount)) {
double balance = current.getBalance();
balance += amount;
current.setBalance(balance);
return;
}
if (!current.isAmountValid(amount)) {
throw new IllegalArgumentException("Invalid Amount");
}

}
}
throw new IllegalArgumentException("invalid account id");

}

public void transfer(String acctIdToWithdrawFrom, String acctIdToDepositTo, double amount) throws InsufficientFundsException {
int count = 0;
Iterator<BankAccount> itr = this.bank.accounts.iterator();
while (itr.hasNext()) {
BankAccount current = itr.next();
if (current.getAcctId().equals(acctIdToWithdrawFrom)) {
if (!current.isAmountValid(amount)) {
throw new IllegalArgumentException("Invalid Amount");
}
if (current.getBalance() < amount) {
throw new InsufficientFundsException("Not enough funds");
}
if (current.isAmountValid(amount)) {
double balance = current.getBalance();
balance -= amount;
current.setBalance(balance);
count += 1;
}
}

if (current.getAcctId().equals(acctIdToDepositTo)) {
if (!current.isAmountValid(amount)) {
throw new IllegalArgumentException("Invalid Amount");
}

if (current.isAmountValid(amount)) {
double balance = current.getBalance();
balance += amount;
current.setBalance(balance);
count += 1;
}
}
}
if (count == 2) {
return;
} else {
throw new IllegalArgumentException("invalid account id");
}

}

public ArrayList transactionHistory(String acctId) {
Iterator<BankAccount> itr = this.bank.accounts.iterator();
while (itr.hasNext()) {
BankAccount current = itr.next();
if (current.getAcctId().equals(acctId)) {
return current.getTransactionHistory();
}
}
throw new IllegalArgumentException("Invalid account id");
}
}

Loading