Clone of popular application Tricount. Implemented as console app using Java and Cassandra as Database.
You as a user and group of friends make room where each of users can put their payment if they bought someone anything. App will calculate final debts and tell users who have to return money to whom.It makes easier counting money on trips. Usually you have pay only one person instead of few in the end.
CREATE TABLE Room (
roomId UUID,
name varchar,
PRIMARY KEY (roomId)
); // Dane pokoju rozliczeniowego
CREATE TABLE roomResult (
room UUID,
user UUID,
money double,
PRIMARY KEY (room)
); // Przetrzymywanie aktualnego wyniki rozliczenia danego pokoju dla
//kazdego uzytkownika osobno
CREATE TABLE Users (
userId UUID,
name varchar,
password varchar,
roomId UUID,
PRIMARY KEY (name,password, userId)
); // Aktualne dane o uzytkowniku
CREATE TABLE Payments (
paymenyId UUID,
room UUID,
amount double,
payer uuid,
receiver uuid,
// date ????
PRIMARY KEY (room, payer)
); // Zapis historii dla wszystkich tranzakcji
- User log in with name and password. It let's app to identify user.
- Query for room for given user and show them.
- User select room he would like to see.
- Query for all roomResult for given room.
- User add his transaction
- App locally split payment into receivers
- Insert individually all payments
- Update/Add new roomResult
Example :
Filip pay 10 $ for Kasia and Kuba.
App Split it into 5$ for each Kasia and Kuba.
So we have two payments.
Result:
- Filip: 10 $
- Kasia: -5$
- Kuba: -5$
Mby add date to history payments and add all payments on one date to show in history real transactions. In these example to have only one transaction in history not two of them.
- User select that option
- Query for all payments for room 2.5. Reduce all historical transactions with the same date.
- Print all transactions for that room.
Will add after finish.