Skip to content

Commit

Permalink
Reformat the project
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMarkinPPC committed Apr 21, 2024
1 parent f0decad commit e277836
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions terka/domain/entities/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from terka.domain.entities.task import Task



class ProjectStatus(Enum):
DELETED = 0
ACTIVE = 1
Expand Down Expand Up @@ -104,13 +103,32 @@ def review(self) -> int:
def done(self) -> int:
return self._count_task_status('DONE')

@property
def deleted(self) -> int:
return self._count_task_status('BACKLOG')

@property
def todo(self) -> int:
return self._count_task_status('TODO')

@property
def in_progress(self) -> int:
return self._count_task_status('IN_PROGRESS')

@property
def review(self) -> int:
return self._count_task_status('REVIEW')

@property
def done(self) -> int:
return self._count_task_status('DONE')

@property
def deleted(self) -> int:
return self._count_task_status('DELETED')

@property
def backlog_tasks(self) -> list[Task]:
<<<<<<< HEAD
return self._get_tasks_by_statuses(('BACKLOG'))

@property
Expand All @@ -120,26 +138,11 @@ def open_tasks(self) -> list[Task]:
@property
def completed_tasks(self) -> list[Task]:
return self._get_tasks_by_statuses(('DONE', 'DELETED'))
=======
return self._get_tasks_by_statuses(("BACKLOG"))

@property
def open_tasks(self) -> list[Task]:
return self._get_tasks_by_statuses(("TODO", "IN_PROGRESS", "REVIEW"))

@property
def completed_tasks(self) -> list[Task]:
return self._get_tasks_by_statuses(("DONE", "DELETED"))
>>>>>>> 3f01c2b (Add incomplete_tasks and improve printing of projects)

@property
def incompleted_tasks(self) -> list[Task]:
return self._get_tasks_by_statuses(
<<<<<<< HEAD
('BACKLOG', 'TODO', 'IN_PROGRESS', 'REVIEW'))
=======
("BACKLOG", "TODO", "IN_PROGRESS", "REVIEW"))
>>>>>>> 3f01c2b (Add incomplete_tasks and improve printing of projects)

def _get_tasks_by_statuses(self, statuses: tuple[str]) -> list[Task]:
return [task for task in self.tasks if task.status.name in statuses]
Expand Down

0 comments on commit e277836

Please sign in to comment.