Skip to content

RESTful API and CLI program that allows users to register, login, check balance, send/request money, and approve/reject requests. Used Java, Spring Boot, JDBC, PostgreSQL, and E/R diagrams in IntelliJ, DbVisualizer, and Postman.

Notifications You must be signed in to change notification settings

joshuapsteele/tenmo-money-transfer-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"TEnmo" Money Transfer Application

This is a RESTful API server and command-line application that allows users to send and request "TE bucks" between friends.

Use cases

  1. As a user of the system, I need to be able to register myself with a username and password.
    1. A new registered user starts with an initial balance of 1,000 TE Bucks.
    2. The ability to register has been provided in your starter code.
  2. As a user of the system, I need to be able to log in using my registered username and password.
    1. Logging in returns an Authentication Token. I need to include this token with all my subsequent interactions with the system outside of registering and logging in.
    2. The ability to log in has been provided in your starter code.
  3. As an authenticated user of the system, I need to be able to see my Account Balance.
  4. As an authenticated user of the system, I need to be able to send a transfer of a specific amount of TE Bucks to a registered user.
    1. I should be able to choose from a list of users to send TE Bucks to.
    2. A transfer includes the User IDs of the from and to users and the amount of TE Bucks.
    3. The receiver's account balance is increased by the amount of the transfer.
    4. The sender's account balance is decreased by the amount of the transfer.
    5. I can't send more TE Bucks than I have in my account.
    6. A Sending Transfer has an initial status of "approve."
  5. As an authenticated user of the system, I need to be able to see transfers I have sent or received.
  6. As an authenticated user of the system, I need to be able to retrieve the details of any transfer based upon the transfer ID.
  7. As an authenticated user of the system, I need to be able to request a transfer of a specific amount of TE Bucks from another registered user.
    1. I should be able to choose from a list of users to request TE Bucks from.
    2. A transfer includes the User IDs of the from and to users and the amount of TE Bucks.
    3. A Request Transfer has an initial status of "pending."
    4. No account balance changes until the request is approved.
    5. The transfer request should appear in both users' list of transfers (use case #5).
  8. As an authenticated user of the system, I need to be able to see my "pending" transfers.
  9. As an authenticated user of the system, I need to be able to either approve or reject a Request Transfer.
    1. I can't "approve" a given Request Transfer for more TE Bucks than I have in my account.
    2. The Request Transfer status is "approved" if I approve, or "rejected" if I reject the request.
    3. If the transfer is approved, the requester's account balance is increased by the amount of the request.
    4. If the transfer is approved, the requestee's account balance is decreased by the amount of the request.
    5. If the transfer is rejected, no account balance changes.

Database schema

Database schema

Users table

The users table stores the login information for users of the system.

Field Description
user_id Unique identifier of the user
username String that identifies the name of the user; used as part of the login process
password_hash Hashed version of the user's password

Accounts table

The accounts table stores the accounts of users in the system.

Field Description
account_id Unique identifier of the account
user_id Foreign key to the users table; identifies user who owns account
balance The amount of TE bucks currently in the account

Transfer types table

The transfer_types table stores the types of transfers that are possible.

Field Description
transfer_type_id Unique identifier of the transfer type
transfer_type_desc String description of the transfer type

There are two types of transfers:

transfer_type_id transfer_type_desc Purpose
1 Request Identifies transfer where a user requests money from another user
2 Send Identifies transfer where a user sends money to another user

Transfer statuses table

The transfer_statuses table stores the statuses of transfers that are possible.

Field Description
transfer_status_id Unique identifier of the transfer status
transfer_status_desc String description of the transfer status

There are three statuses of transfers:

transfer_status_id transfer_status_desc Purpose
1 Pending Identifies transfer that hasn't occurred yet and requires approval from the other user
2 Approved Identifies transfer that has been approved and occurred
3 Rejected Identifies transfer that wasn't approved

Transfers table

The transfer table stores the transfers of TE bucks.

Field Description
transfer_id Unique identifier of the transfer
transfer_type_id Foreign key to the transfer_types table; identifies type of transfer
transfer_status_id Foreign key to the transfer_statuses table; identifies status of transfer
account_from Foreign key to the accounts table; identifies the account that the funds are being taken from
account_to Foreign key to the accounts table; identifies the account that the funds are going to
amount Amount of the transfer

About

RESTful API and CLI program that allows users to register, login, check balance, send/request money, and approve/reject requests. Used Java, Spring Boot, JDBC, PostgreSQL, and E/R diagrams in IntelliJ, DbVisualizer, and Postman.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published