Giter VIP home page Giter VIP logo

maddykilmurray-ironhackmidterm's Introduction

Introduction

This is an API simulating a banking service. Users can be added, modified and removed, accounts can be created and modified and all services are secured using HTTP.BASIC protocols.

Installation

Clone or download the project from this git repository.

The database is set up as a H2 database and the password to access is:

Username: sysadmin, Password: 5y5@m1n

Open and run in your preferred IDE.

Setup

The API is set up with the following users as default:

Username: admin1, Password: admin1Pass, Role: ADMIN

Username: accholder1, Password: accHolder1Pass, Role: ACCOUNTHOLDER

Username: thirdparty1, Password: thirdparty1Pass, Role: THIRDPARTY

Pathways

User Pathways

Route Type Route Access Roles Input Required
GET /users ADMIN NONE
GET /users/{username} ADMIN, ACCOUNTHOLDER, THIRDPARTY String - Username
GET /users/byid/{id} ADMIN, ACCOUNTHOLDER, THIRDPARTY Long - User ID
POST /users/new/admin ADMIN AdminDTO
POST /users/new/accountholder ADMIN AccountHolderDTO
POST /users/new/thirdparty ADMIN ThirdPartyDTO
PATCH /users/update/logindetails/{id} ADMIN, ACCOUNTHOLDER, THIRDPARTY Long - User ID, String - Username, String - Password
PATCH /users/update/username/{id} ADMIN, ACCOUNTHOLDER, THIRDPARTY Long - User Id, String - Username
PATCH /users/update/password/{id} ADMIN, ACCOUNTHOLDER, THIRDPARTY Long - User Id, String - Password
PATCH /users/update/accountholder/{id} ADMIN, ACCOUNTHOLDER Long - User ID, AccountHolderDTO
PATCH /users/update/thirdparty/{id} ADMIN, THIRDPARTY Long - User ID, ThirdPartyDTO
PATCH /users/update/admin/{id} ADMIN Long - User ID, AdminDTO
DELETE /users/remove/{id} ADMIN Long - User ID

Account Pathways

Route Type Route Access Roles Input Required
GET /accounts ADMIN NONE
GET /accounts/byid/{id} ADMIN, ACCOUNTHOLDER, THIRDPARTY Long - Account ID
POST /accounts/new/checking ADMIN CheckingAccountDTO
POST /accounts/new/savings ADMIN SavingsAccountDTO
POST /accounts/new/creditcard ADMIN CreditCardAccountDTO
POST /accounts/new/thirdparty ADMIN ThirdPartyAccountDTO
PATCH /accounts/update/status/{id} ADMIN Long - Account ID
GET /accounts/getbalance/checking/{account_id} ADMIN, ACCOUNTHOLDER Long - Account ID, String - Account Owner Username
GET /accounts/getbalance/studentchecking/{account_id} ADMIN, ACCOUNTHOLDER Long - Account ID, String - Account Owner Username
GET /accounts/getbalance/savings/{account_id} ADMIN, ACCOUNTHOLDER Long - Account ID, String - Account Owner Username
GET /accounts/getbalance/creditcard/{account_id} ADMIN, ACCOUNTHOLDER Long - Account ID, String - Account Owner Username
GET /accounts/getbalance/thirdparty/{account_id} ADMIN, THIRDPARTY Long - Account ID, String - Account Owner Username
PATCH /accounts/admin/transferfunds/ ADMIN TransactionDTO
PATCH /accounts/accountholder/transferfunds/{username} ADMIN, ACCOUNTHOLDER String - Username, TransactionDTO
PATCH /accounts/thirdparty/transferfunds/ ADMIN, THIRDPARTY String - HashedKey, ThirdPartyTransactionDTO

DTO Templates

Please note: In all DTOs, any reference to secondary owner is optional, and can be removed if not required

Accounts:

AccountDTO:

{ "balance": {"amount":"NUMBER", "currency":"GBP"}, "primaryOwnerId":"USERID", "secondaryOwnerId":"USERID" }

CheckingAccountDTO:

{ "balance": {"amount":"NUMBER", "currency":"GBP"}, "primaryOwnerId":"USERID", "secondaryOwnerId":"USERID" "secretKey":"STRING" }

CreditCardAccountDTO

{ "balance": {"amount":"NUMBER", "currency":"GBP"}, "primaryOwnerId":"USERID", "secondaryOwnerId":"USERID" "creditLimit": {"amount":"NUMBER", "currency":"GBP"}, "interestRate": {"amount":"NUMBER", "currency":"GBP"} }

SavingsAccountDTO

{ "balance": {"amount":"NUMBER", "currency":"GBP"}, "primaryOwnerId":"USERID", "secondaryOwnerId":"USERID" "secretKey":"STRING", "interestRate": {"amount":"NUMBER", "currency":"GBP"}`` ``}

ThirdPartyAccountDTO

{ "balance": {"amount":"NUMBER", "currency":"GBP"}, "primaryOwnerId":"USERID", "secondaryOwnerId":"USERID" "hashedKey":"STRING", "name":"STRING" ``}`

Transactions

TransactionDTO

{ "transactionAmount":"NUMBER", "transferAccountId":"ACCOUNTID", "receivingAccountId":"ACCOUNTID" }

ThirdPartyTransactionDTO

{ "transactionAmount":"NUMBER", "transferAccountId":"ACCOUNTID", "receivingAccountId":"ACCOUNTID" "receivingSecretKey":"STRING" }

Users:

AccountHolderDTO

{ "name":"STRING", "username":"STRING", "password":"STRING", "dateOfBirth":"YYYY-MM-DD", "primaryAddress": {"houseNumber":"NUMBER", "streetName":"STRING", "city":"STRING", "postcode":"STRING", "country":"STRING"},

"mailingAddress": {"houseNumber":"NUMBER", "streetName":"STRING", "city":"STRING", "postcode":"STRING", "country":"STRING"}, "accounts": {"id":"NUMBER", "balance": {"amount":"NUMBER", "currency":"GBP"}, "primaryOwnerId":"USERID", "secondaryOwnerId":"USERID"} }

AdminDTO

{ "name":"STRING", "username":"STRING", "password":"STRING", }

ThirdPartyDTO

{ "name":"STRING", "username":"STRING", "password":"STRING", "secretKey":"STRING" }

maddykilmurray-ironhackmidterm's People

Contributors

maddykilmurray avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.