Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 2.3 KB

README.md

File metadata and controls

48 lines (39 loc) · 2.3 KB

Loan API Demo

This is a simple loan API demo that allows you to create, read, update and delete loans. It is built with H2 in-memory database, Spring Boot, Spring Data JPA, and Spring Web. You can access the database console at http://localhost:8080/h2-console with the following credentials: username: sa and password: password_loan

Getting Started

Prerequisites

Ensure you have the following installed:

  • Java 17 or higher
  • Maven (for building and running the project)

Clone the Repository

git clone https://github.com/username/user-management-api.git
cd user-management-api

Build the Project

mvn clean install

Run the Application

mvn spring-boot:run

The application will be available at http://localhost:8080.

API Endpoints

HTTP Method Endpoint Description RequiredRole
GET /customers Get all customers Admin
GET /customers/{id} Get a customer by ID Admin, User
POST /customers Create a new customer Admin
PUT /customers/{id} Update customer information Admin, User
DELETE /customers/{id} Delete a customer by ID Admin
POST /customers/{id}/loans Create a new loan Admin, User
GET /customers/{id}/loans Get all loans by customer ID Admin, User
GET /customers/{id}/loans/{loanId}/installments Get all loans by loan ID Admin, User
POST /customers/{id}/loans/{loanId}/installments/pay Pay Loan Admin, User

Admin username and admin password are both 'admin'. You can access the endpoints with these as admin by using Basic Auth You can also add a new customer as admin. And use the endpoints for that user as the user's oneself.