Skip to content

Commit

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



class ProjectStatus(Enum):
DELETED = 0
ACTIVE = 1
Expand Down Expand Up @@ -109,6 +110,7 @@ def deleted(self) -> int:

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

@property
Expand All @@ -118,11 +120,26 @@ 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 f0decad

Please sign in to comment.