Payment Store is a Java-based application designed to manage client's payments and contracts. It provides a RESTful API for creating, retrieving, and managing payments and clients. The application uses Spring Boot for its backend framework and integrates with H2 for data persistence.
Application support the following features:
- JWT-based authentication for secure access.
- RESTful endpoints for managing payments.
- Possibility to upload payments via CSV file in batch.
- Exception handling and validation for uploaded files.
- Database initialization with sample data for testing.
Before running the application, ensure you have the following installed:
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/lin-nova/payment_service.git cd payment_service -
Build and run the application using Docker Compose:
docker-compose up --build
-
The application will be accessible at
http://localhost:8080.
The application includes an OpenAPI (Swagger) specification for exploring and testing the API endpoints. Once the application is running, navigate to:
http://localhost:8080/swagger-ui/index.html
The project includes unit and integration tests. To run the tests, use the following command:
./mvnw testFor Local live testing with JWT tokens, you can use the following example tokens:
- client1:
eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJleGFtcGxlLmNvbSIsInN1YiI6ImNsaWVudDEiLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE3NTY2NjczMDUsImV4cCI6MTc4ODIwMzMwNX0.aTYUxww1CfLYNMNO8wbsQ97HxLVkYc4_QXIHFcV7IWg - client2:
eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJleGFtcGxlLmNvbSIsInN1YiI6ImNsaWVudDIiLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE3NTY2NjczMDUsImV4cCI6MTc4ODIwMzMwNX0.QIlBmsGTLNc8_TAxQeUjdlTpNZH6pvfO1bm53rVQ0ccToken was generated by using JwtGenerator.class.
- Integration tests from PaymentController to PaymentRepository
- Add proper Client registration and authentication with JWT tokens. (If required by the business logic)
- Improve test coverage.
- Should the payment be updated via a POST call to the DTO or a CSV file upload?
- What 'relevant details' should the payment contain?