This projects validates CPF through a client that checks ViaCEP api, also create an account through the endpoint.
The Layer Structure:
[GET] /address/{cep} <= Returns if address further information if it exists
E.g. response
{
"cep": "69080-520",
"address": "Travessa da Salvação",
"address1": "",
"city": "Manaus",
"neighborhood": "Coroado",
"state": "AM"
}
[POST] /account
input body:
{
"cpf": "0091382432",
"firstName": "John",
"lastName": "Paul",
"phone": "+559298284322",
"accountAddress": {
"address": "asdas",
"address1": "",
"cep": "69080520",
"city": "Manaus",
"state": "AM",
"neighborhood": "centro"
}
}
Example of how to use through Postman:
If in your machine you have a docker-compose version installed just run, and a docker image will be started, the endpoints can be accessed in localhost in port localhost:3000:
$ docker-compose up -d
##Requirements:
- node 16.0.0
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov