Skip to content

Commit

Permalink
[Track-225] 306090 Add report date labels (#2493)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolkamps1 authored Jan 6, 2025
1 parent 7bb5c53 commit 2ca8e15
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion epictrack-api/src/api/reports/thirty_sixty_ninety_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@ def _format_table_data_events(self, events, style):
])
return data

def _get_event_date_source(self, data):
"""Return the date source"""
date_sources = {
"decision_referral": "Decision",
"work_issue": "Issue",
"pcp": "Comment Period",
"other": "Milestone",
}
if data["event_type_id"] == EventTypeEnum.REFERRAL.value:
return "Referral"
return date_sources[data["event_type"]]

def _format_table_data(self, period_data, row_index, style):
"""Generates styled table rows for the given period data"""
# Define a bold style for labels
Expand All @@ -518,6 +530,7 @@ def _format_table_data(self, period_data, row_index, style):
events = group["items"]
events_data = self._format_table_data_events(events, style)
work = events[0]
date_source_label = self._get_event_date_source(work) + " Date"
data.append(
[
[
Expand All @@ -526,7 +539,7 @@ def _format_table_data(self, period_data, row_index, style):
style_bold,
),
Paragraph(
f"{work['event_date']: %B %d, %Y}",
f"{date_source_label}: {work['event_date']: %B %d, %Y}",
style,
),
],
Expand Down

0 comments on commit 2ca8e15

Please sign in to comment.