Skip to content

Commit 4414d7e

Browse files
committed
Financial Events to be included
1 parent 0bbc6a4 commit 4414d7e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

epictrack-api/src/api/models/event.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String, and_
1717
from sqlalchemy.orm import relationship
1818

19-
from api.models.event_category import EventCategory
19+
from api.models.event_category import EventCategory, PRIMARY_CATEGORIES
2020
from api.models.event_configuration import EventConfiguration
2121

2222
from .base_model import BaseModelVersioned
@@ -66,6 +66,7 @@ def find_by_work_id(cls, work_id: int):
6666
@classmethod
6767
def find_milestone_events_by_work_phase(cls, work_phase_id: int):
6868
"""Return milestones by work id and phase id."""
69+
category_ids = list(map(lambda x: x.value, PRIMARY_CATEGORIES))
6970
return (
7071
Event.query.join(
7172
EventConfiguration,
@@ -80,7 +81,7 @@ def find_milestone_events_by_work_phase(cls, work_phase_id: int):
8081
EventCategory,
8182
and_(
8283
EventConfiguration.event_category_id == EventCategory.id,
83-
EventCategory.name.notin_(["Calendar", "Finance"]),
84+
EventCategory.id.in_(category_ids),
8485
),
8586
)
8687
.all()

epictrack-api/src/api/models/event_category.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ class EventCategory(BaseModelVersioned):
4646
EventCategoryEnum.DECISION,
4747
EventCategoryEnum.EXTENSION,
4848
EventCategoryEnum.SUSPENSION,
49-
EventCategoryEnum.PCP]
49+
EventCategoryEnum.PCP,
50+
EventCategoryEnum.FINANCE]

0 commit comments

Comments
 (0)