Skip to content

hi-heavens/theVaultPB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vault Payment Bank Account Management API

Welcome to the The Vault Payment Bank Account Management API! This project was created as part of an assessment task. The API provides a simple way to create and manage bank accounts. It's built using Node.js and Express.

Table of Contents

Getting Started

To run this application on your local machine, follow the steps below.

Prerequisites

  • Node.js installed on your system.
  • Git installed on your system (required for cloning the repository and version control). Note that Git often comes pre-installed for macOS and Linux users.

Installation

Clone the repository to your local machine (or download and unzip the ZIP file):

git clone https://github.com/hi-heavens/theVaultPB.git
cd theVaultPB

Install the required dependencies using npm:

npm install

Running the Application

npm start

The API will be available at http://localhost:3000.

(back to top)

API Endpoints

Create a Bank Account

Endpoint: POST api/v1/create-account

This endpoint allows users to create a new bank account. Users should send a JSON payload containing the following account details:

  • Account holder name
  • Account holder DOB (Date of Birth) in the format: YYYY-MM-DD
  • Account type (Savings, Checking, etc.)
  • Initial balance

Request Body:

{
  "holderName": "John Doe",
  "dob": "1990-01-15",
  "accountType": "Savings",
  "initialBalance": 1000
}

Response: A JSON object with the generated account number and account details.

The endpoint will return a unique 10-digit account number along with the holder's name, account type, and initial balance.

{
  "status": "Account created successfully",
  "data": {
    "accountNumber": 4387510694,
    "holderName": "John Doe",
    "accountType": "Savings",
    "balance": 0
  }
}

Resolve a Bank Account

Endpoint: GET api/v1/account/:accountNumber

This endpoint allows users to fetch the details of a bank account using its account number. Users should provide the account number as a parameter in the URL. The endpoint will respond with the account details if found.

Response: A JSON object with the account details associated with the provided account number.

{
  "status": "Successful",
  "data": {
    "accountNumber": 4387510694,
    "holderName": "John Doe",
    "accountType": "Savings",
    "balance": 0
  }
}

Fetch All Bank Accounts

Endpoint: GET /accounts

This endpoint returns a list of all bank accounts created so far. The response will include an array containing all account details.

Response: An array of JSON objects, each containing account details.

Swagger Documentation

You can explore and interact with the API using Swagger documentation. To access the documentation, start the application and visit the following URL in a web browser:

http://localhost:3000/swagger

Or via the deployed baseURL. Swagger doc

(back to top)

Contribution

  • Kehinde Adedokun
  • Contributions are welcome! If you find any issues or want to add improvements, feel free to fork the repository and create a pull request.

Deployment

The application has been deployed and is accessible at baseURL. When testing the deployed version, don't forget to add api/v1 to the baseURL for accessing the API endpoints.

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published