Skip to content

elcolie/crud-taskado

Repository files navigation

Task Management

Why design this way?

  1. I can make multiple revision of the task by using identifier
  2. I have to make trade off table CurrentTaskContent to show updated_by the latest user with updated_at timestamp.

Step to run the project

  1. docker compose up. To up and running the postgres.
  2. alembic upgrade head. To apply migration files.
  3. uvicorn main:app --reload. To run the project.

Postman collection

File here

Diagram.io

Diagram

ListView

filter and pagination get /?due_dates__lte=2021-09-01&status=completed&created_by_username=foo&updated_by_username=foo

Undo Mechanism

  • post = make new instance with new identifier
  • put = make new instance with new identifier, but reuse the old id.
  • delete = mark as deleted.
  • post /undo/<task_id> = undelete the instance

Test

Rather than using POSTMAN click. I prefer run the script. It mutates the database. Then be careful.

You need to add User first start with id=1.

python -m unittest core/tests/*.py. To run all test cases. python -m unittest core.tests.test_delete.TestDelete. To run specific test file. python -m unittest core.tests.test_delete.TestDelete.test_delete_task. To run specific test case.

Coverage

  • pip install coverage
  • coverage run -m unittest core/tests/*.py
  • coverage report -m
  • coverage html

About

CRUD of task and UNDO mechanism

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages