This project is an API built using Java, Java Spring, H2 as the database.
The API was developed by me, using some videos as a support and base, to demonstrate how to solve the PicPay Backend Challenge using Java Spring.
The unit tests were developed during another process and follow-up, with the aim to demonstrate how to write unit tests for Java Spring apps using JUnit, Mockito and AssertJ.
- Clone the repository:
git clone https://github.com/iFallenHunt/picpayproject.git- Install dependencies with Maven
- Start the application with Maven
- The API will be accessible at http://localhost:8080
The API provides the following endpoints:
GET USERS
GET /users - Retrieve a list of all users.[
{
"id": 1,
"firstName": "Pedro",
"lastName": "Silva",
"document": "123456787",
"email": "[email protected]",
"password": "senha",
"balance": 20.00,
"userType": "MERCHANT"
},
{
"id": 4,
"firstName": "Luckas",
"lastName": "Silva",
"document": "123456783",
"email": "[email protected]",
"password": "senha",
"balance": 0.00,
"userType": "COMMON"
}
]POST USERS
POST /users - Register a new user into the App{
"firstName": "Lucas",
"lastName": "Silva",
"password": "senha",
"document": "123456783",
"email": "[email protected]",
"userType": "COMMON",
"balance": 10
}POST TRANSACTIONS
POST /transactions - Register a new Transaction between users (COMMON to COMMON or COMMON to MERCHANT){
"senderId": 4,
"receiverId": 1,
"value": 10
}The project utilizes H2 Database as the database.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.
When contributing to this project, please follow the existing code style, commit conventions, and submit your changes in a separate branch.