Git Product home page Git Product logo

bvn_validator's Introduction

BVN VALIDATION

This is a service to validate BVNs, preconfigured in memory.

PREREQUISITES

  1. MongoDb must be running locally
  2. Request and response objects are stored in a MongoDb NoSql store, based on the configured properties.

Technologies

  • Java
  • Maven
  • Springboot
  • JUnit
  • MongoDB

Requirements

You need the following to build and run the application:

How to run

step 1 - clone project with from here

git clone https://github.com/NfoTECH/Seamfix_Assessment.git

step 2 - move into the project directory

cd seamfix_assessment/

step 3 - Generate the .jar file

mvn clean install
OR
./mvnw clean install

step 4 - run the project

java -jar seamfix_assessment-0.0.1-SNAPSHOT.jar

NOTE :

  • The application can also be run as a standalone application, by running as a springboot project with the "play" but on IntelliJ

Testing the API endpoint with various bvn inputs


  • BVN 12345678901

Test Cases to Consider

This is an image

Endpoint

http://localhost:8080/bv-service/svalidate/wrapper

1. Valid BVN

curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
    "bvn" : "12345678901"
}'

Response

{
    "message": "Success",
    "code": 0,
    "bvn": "12345678901",
    "imageDetail": "https://res.cloudinary.com/olamire/image/upload/v1590000000/olamire.jpg",
    "basicDetail": "Rm9ydHVuYXRlIE53YWNodWt3dSBNIDEyMzQ1Njc4OTAx"
}

This is an image

2. Invalid BVN

curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
    "bvn" : "123456789011"
}'

Response

{
    "message": " “The searched BVN does not exist",
    "bvn": "123456789011",
    "code": 1,
    "imageDetail": null,
    "basicDetail": null
}

This is an image

3. BVN with invalid length

curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
    "bvn" : "123456789"
}'

Response

{
    "message": " “The searched BVN is invalid",
    "bvn": "123456789",
    "code": 1,
    "imageDetail": null,
    "basicDetail": null
}

This is an image

4. BVN with invalid characters

curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
    "bvn" : "A1234567891"
}'

Response

{
   "message": "The searched BVN is invalid",
   "bvn": "A1234567891",
   "code": 400,
   "imageDetail": null,
   "basicDetail": null
}

This is an image

5. Empty BVN

curl --location --request POST 'http://localhost:8080/bv-service/svalidate/wrapper' \
--header 'Content-Type: application/json' \
--data-raw '{
    
}'

Response

{
   "message": "One or more of your request parameters failed validation. Please retry",
   "bvn": null,
   "code": 400,
   "imageDetail": null,
   "basicDetail": null
}

This is an image

6. MongoDB test data

This is an image

bvn_validator's People

Contributors

nfotech avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.