Skip to content

Python back end study project. The project goal is to generate vaccination cards containing personal information, first shot date and second shot date (that is calculated automatically using timedelta). Developed during Kenzie Academy Brasil's full stack development course.

Notifications You must be signed in to change notification settings

lsmescolotto/q3-sprint5-vacinacao-lsmescolotto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vaccination

Technologies

This project was developed using the following technologies:


Prerequisites

Install:

  • Python 3.9
  • Pip library

To get started

Follow the steps:

Clone into the repository and go into project's folder:

$ git clone https://github.com/Kenzie-Academy-Brasil-Developers/q3-sprint6-autenticacao-e-autorizacao-lsmescolotto
$ cd q3-sprint6-autenticacao-e-autorizacao-lsmescolotto

Create virtual enviroment:

$ python -m venv venv

Activate virtual enviroment:

 $ source venv/bin/activate

Install libraries:

$ pip install -r requirements.txt

Run flask:

$ flask run

Start sending requests:

  • Use an API request sending platform like Insomnia


base URL

https://vaccination-lsmescolotto.herokuapp.com/vaccinations


Endpoints

This API has 2(two) endpoints to: add a new vaccination card and to get all of the cards.


Authentication not required routes


Add new vaccination card


POST - REQUEST FORMAT

{
  "cpf": "01234567898",
  "name": "Pandora",
  "vaccine_name": "jansen",
  "health_unit_name": "COloninha"
}

If the request is corret, the vaccination card will be added:

POST - RESPONSE FORMAT - STATUS 201

{
  "cpf": "01234567898",
  "first_shot_date": "Tue, 12 Apr 2022 14:19:46 GMT",
  "health_unit_name": "Coloninha",
  "name": "Pandora",
  "second_shot_date": "Mon, 11 Jul 2022 14:13:24 GMT",
  "vaccine_name": "Jansen"
}

If extra keys are sent:

POST - RESPONSE FORMAT - STATUS 201

{
  "cpf": "01234567898",
  "first_shot_date": "Tue, 12 Apr 2022 14:19:46 GMT",
  "health_unit_name": "Coloninha",
  "name": "Pandora",
  "second_shot_date": "Mon, 11 Jul 2022 14:13:24 GMT",
  "vaccine_name": "Jansen"
}

If the cpf has more than 11 characters:

STATUS 400

{
  "error": "cpf value too long"
}

If at least one of the inserted values is not a string:

STATUS 400

{
  "error": "one or more of the inserted values are not strings"
}

If at least one of the keys is missing:

STATUS 400

{
  "expected_keys": ["vaccine_name", "name", "health_unit_name", "cpf"],
  "invalid_sent_keys": []
}

Get all vaccination cards


GET - REQUEST FORMAT No Body

GET - RESPONSE FORMAT - STATUS 200

[
  {
    "cpf": "01234567898",
    "first_shot_date": "Fri, 29 Apr 2022 20:12:42 GMT",
    "health_unit_name": "Coloninha",
    "name": "Pandora",
    "second_shot_date": "Thu, 28 Jul 2022 20:12:42 GMT",
    "vaccine_name": "Jansen"
  },
  {
    "cpf": "01234567893",
    "first_shot_date": "Fri, 29 Apr 2022 20:12:42 GMT",
    "health_unit_name": "Coloninha",
    "name": "Pandora",
    "second_shot_date": "Thu, 28 Jul 2022 20:12:42 GMT",
    "vaccine_name": "Jansen"
  }
]

Developed by Luiza Schmidt Mescolotto

About

Python back end study project. The project goal is to generate vaccination cards containing personal information, first shot date and second shot date (that is calculated automatically using timedelta). Developed during Kenzie Academy Brasil's full stack development course.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published