Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Track-309] AS transition orders #2473

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions epictrack-api/src/api/models/event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ class EventTypeEnum(enum.Enum):
"""Enum for event type"""

# pylint: disable=C0103
TIME_LIMIT_SUSPENSION = 12
TIME_LIMIT_RESUMPTION = 38
REFERRAL = 5
MINISTER_DECISION = 14
ADM = 16
CEAO_DECISION = 15
MINISTER_DECISION = 14
REFERRAL = 5
TIME_LIMIT_RESUMPTION = 38
TIME_LIMIT_SUSPENSION = 12


class EventType(BaseModelVersioned):
Expand Down
38 changes: 19 additions & 19 deletions epictrack-api/src/api/reports/anticipated_schedule_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from api.models.event import Event
from api.models.event_category import EventCategoryEnum
from api.models.event_configuration import EventConfiguration
from api.models.event_type import EventTypeEnum
from api.models.federal_involvement import FederalInvolvement, FederalInvolvementEnum
from api.models.work_issues import WorkIssues
from api.models.work_issue_updates import WorkIssueUpdates
from api.models.work_type import WorkType, WorkTypeEnum
from api.models.event_type import EventTypeEnum
from api.models.ministry import Ministry
from api.models.phase_code import PhaseCode
from api.models.project import Project
Expand Down Expand Up @@ -188,14 +188,14 @@ def _fetch_data(self, report_date):
or_(
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 1, # Milestone
EventConfiguration.event_type_id == 5 # EA Referral
EventConfiguration.event_category_id == EventCategoryEnum.MILESTONE.value,
EventConfiguration.event_type_id == EventTypeEnum.REFERRAL.value
)
),
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 4, # Decision
EventConfiguration.event_type_id == 14 # Minister
EventConfiguration.event_category_id == EventCategoryEnum.DECISION.value,
EventConfiguration.event_type_id == EventTypeEnum.MINISTER_DECISION.value
)
),
and_(
Expand All @@ -204,32 +204,32 @@ def _fetch_data(self, report_date):
Work.work_type_id == 5, # Exemption Order
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 4, # Decision
EventConfiguration.event_category_id == EventCategoryEnum.DECISION.value,
EventConfiguration.name != "IPD/EP Approval Decision (Day Zero)",
EventConfiguration.event_type_id == 15 # CEAO
EventConfiguration.event_type_id == EventTypeEnum.CEAO_DECISION.value
)
)
),
and_(
Work.work_type_id == 6, # Assessment
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 4, # Decision
EventConfiguration.event_category_id == EventCategoryEnum.DECISION.value,
EventConfiguration.name != "IPD/EP Approval Decision (Day Zero)",
EventConfiguration.name != "Revised EAC Application Acceptance Decision (Day Zero)",
EventConfiguration.event_type_id == 15 # CEAO
EventConfiguration.event_type_id == EventTypeEnum.CEAO_DECISION.value
)
)
),
and_(
Work.work_type_id == 7, # Ammendment
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 4, # Decision
EventConfiguration.event_category_id == EventCategoryEnum.DECISION.value,
EventConfiguration.name != "Delegation of Amendment Decision",
or_(
EventConfiguration.event_type_id == 15, # CEAO
EventConfiguration.event_type_id == 16 # ADM
EventConfiguration.event_type_id == EventTypeEnum.CEAO_DECISION.value,
EventConfiguration.event_type_id == EventTypeEnum.ADM.value
)
)
)
Expand All @@ -238,30 +238,30 @@ def _fetch_data(self, report_date):
Work.work_type_id == 9, # EAC Extension
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 4, # Decision
EventConfiguration.event_type_id == 15 # CEAO
EventConfiguration.event_category_id == EventCategoryEnum.DECISION.value,
EventConfiguration.event_type_id == EventTypeEnum.ADM.value
)
)
),
and_(
Work.work_type_id == 10, # Substantial Start Decision
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 4, # Decision
EventConfiguration.event_category_id == EventCategoryEnum.DECISION.value,
EventConfiguration.name != "Delegation of SubStart Decision to Minister",
EventConfiguration.event_type_id == 15 # CEAO
EventConfiguration.event_type_id == EventTypeEnum.ADM.value
)
)
),
and_(
Work.work_type_id == 11, # EAC/Order Transfer
Event.event_configuration_id.in_(
db.session.query(EventConfiguration.id).filter(
EventConfiguration.event_category_id == 4, # Decision
EventConfiguration.event_category_id == EventCategoryEnum.DECISION.value,
EventConfiguration.name != "Delegation of Transfer Decision to Minister",
or_(
EventConfiguration.event_type_id == 15, # CEAO
EventConfiguration.event_type_id == 16 # ADM
EventConfiguration.event_type_id == EventTypeEnum.CEAO_DECISION.value,
EventConfiguration.event_type_id == EventTypeEnum.ADM.value
)
)
)
Expand Down