This is a service to validate BVNs, preconfigured in memory.
- MongoDb must be running locally
- Request and response objects are stored in a MongoDb NoSql store, based on the configured properties.
- Java
- Maven
- Springboot
- JUnit
- MongoDB
You need the following to build and run the application:
- JDK 17
- Maven 3.8.1 (Optional as code already contains maven wrapper)
step 1 - clone project with from here
git clone https://github.com/NfoTECH/Seamfix_Assessment.git
cd seamfix_assessment/
mvn clean install
OR
./mvnw clean install
java -jar seamfix_assessment-0.0.1-SNAPSHOT.jar
- The application can also be run as a standalone application, by running as a springboot project with the "play" but on IntelliJ
- BVN 12345678901
http://localhost:8080/bv-service/svalidate/wrapper
curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
"bvn" : "12345678901"
}'
{
"message": "Success",
"code": 0,
"bvn": "12345678901",
"imageDetail": "https://res.cloudinary.com/olamire/image/upload/v1590000000/olamire.jpg",
"basicDetail": "Rm9ydHVuYXRlIE53YWNodWt3dSBNIDEyMzQ1Njc4OTAx"
}
curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
"bvn" : "123456789011"
}'
{
"message": " “The searched BVN does not exist",
"bvn": "123456789011",
"code": 1,
"imageDetail": null,
"basicDetail": null
}
curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
"bvn" : "123456789"
}'
{
"message": " “The searched BVN is invalid",
"bvn": "123456789",
"code": 1,
"imageDetail": null,
"basicDetail": null
}
curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
"bvn" : "A1234567891"
}'
{
"message": "The searched BVN is invalid",
"bvn": "A1234567891",
"code": 400,
"imageDetail": null,
"basicDetail": null
}
curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
}'
{
"message": "One or more of your request parameters failed validation. Please retry",
"bvn": null,
"code": 400,
"imageDetail": null,
"basicDetail": null
}