Skip to content

Commit

Permalink
Financial Events to be included (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinesh-aot authored Dec 11, 2023
1 parent 17e5971 commit 0593786
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions epictrack-api/src/api/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String, and_
from sqlalchemy.orm import relationship

from api.models.event_category import EventCategory
from api.models.event_category import EventCategory, PRIMARY_CATEGORIES
from api.models.event_configuration import EventConfiguration

from .base_model import BaseModelVersioned
Expand Down Expand Up @@ -66,6 +66,7 @@ def find_by_work_id(cls, work_id: int):
@classmethod
def find_milestone_events_by_work_phase(cls, work_phase_id: int):
"""Return milestones by work id and phase id."""
category_ids = list(map(lambda x: x.value, PRIMARY_CATEGORIES))
return (
Event.query.join(
EventConfiguration,
Expand All @@ -80,7 +81,7 @@ def find_milestone_events_by_work_phase(cls, work_phase_id: int):
EventCategory,
and_(
EventConfiguration.event_category_id == EventCategory.id,
EventCategory.name.notin_(["Calendar", "Finance"]),
EventCategory.id.in_(category_ids),
),
)
.all()
Expand Down
3 changes: 2 additions & 1 deletion epictrack-api/src/api/models/event_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ class EventCategory(BaseModelVersioned):
EventCategoryEnum.DECISION,
EventCategoryEnum.EXTENSION,
EventCategoryEnum.SUSPENSION,
EventCategoryEnum.PCP]
EventCategoryEnum.PCP,
EventCategoryEnum.FINANCE]

0 comments on commit 0593786

Please sign in to comment.