Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

SaraFarron/alpha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alpha

First project on fast api

Description

An API, that stores information about employees in a company and their performance. Employees can access a limited amount of endpoint to tell about their performance and receive new tasks. Managers can make tasks for employees to do and look at their performance (with plots!), they have access to some endpoints, that employees have no access to. At last there are directors, who have access to all endpoints and can fire and hire people.

Endpoints

Access levels:

0 - Not authorized, 1 - Employee, 2 - Manager, 3 - Director

Tasks:

  • get_task 1
  • get_tasks 1
  • update_task 1 (only is_completed field) 2 (all fields)
  • create_task 2
  • delete_task 2

Employees:

  • get_employee 1
  • get_employees 1
  • create_employee 3
  • delete_employee 3

Lookup:

crudrouter

crudrouter tutorial

alembic tutorial

testing

Alembic commands:

Init

docker exec -it alpha_web_1 alembic init alembic

Make migrations

docker exec -it alpha_web_1 alembic revision --autogenerate -m 'commit message'

Migrate to latest

docker exec -it alpha_web_1 alembic upgrade head

Migrate to previous

docker exec -it alpha_web_1 alembic downgrade -1

Testing

docker exec -it alpha_web_1 pytest

TODO

  • add 404 handlers
  • if task is_completed = True, then datetime_completed must not be null

About

First attempt at fast api

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published