- ๐ป Currently working on our capstone project
- ๐ Need something?
pitzzahh / automated-teller-machine-api Goto Github PK
View Code? Open in Web Editor NEWAPI used for making atm applications (none-web-app)
License: MIT License
API used for making atm applications (none-web-app)
License: MIT License
When the client is not found, it throws
Exception in thread "main" org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
at org.springframework.dao.support.DataAccessUtils.nullableSingleResult(DataAccessUtils.java:97)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:887)
at io.github.pitzzahh.atm.dao.AtmDAOImplementation.lambda$getClientByAccountNumber$3(AtmDAOImplementation.java:81)
at App.main(App.java:47)
which is valid but not much info about it.
bug is in the getMessage() method of AtmDAOImplementation class
/**
* Function that gets the message of the loan requst of a client to the database.
* The Function takes a {@code String}.
* The {@code String} contains the account number of the client.
* @return a {@code Message} object containg the message of the loan.
* @see Function
* @see Map
* @see List
* @see Message
*/
@Override
public Function<String, Map<String, List<Message>>> getMessage() {
return accountNumber -> {
var clients = getAllClients().get()
.entrySet()
.stream()
.map(Map.Entry::getValue)
.toList();
var check = getAllLoans()
.get()
.entrySet()
.stream()
.map(Map.Entry::getValue)
.flatMap(Collection::stream)
.allMatch(a -> a.accountNumber().equals(accountNumber) && ( a.pending() && !a.isDeclined() ));
if (check) throw new IllegalStateException("THERE ARE NO MESSAGES AT THE MOMENT");
return getAllLoans().get()
.entrySet()
.stream()
.map(Map.Entry::getValue)
.flatMap(Collection::stream)
.filter(l -> !l.pending() || l.isDeclined())
.map(loan -> {
return new Message(
loan,
clients.stream()
.filter(a -> a.accountNumber().equals(loan.accountNumber()))
.findFirst()
.get(),
loan.pending() && loan.isDeclined()
);
})
.collect(Collectors.groupingBy(message -> message.loan().accountNumber()));
};
}
During when a client is doing something and suddenly locked the account, the client can still do something.
Add an option to save data to a collection data source
The comments forgetClientByAccountNumber() found in AtmDAO, AtmDAOImplementation, and AtmService does not contain the latest info about the method changes
some dependencies are in the jar file like dependencies for unit testing which should not be included
If username or password or any info in setting the database is not correct. It does not throw an error
the very last loan is not added to the client when approved.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.