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

Pc report controllers #59

Merged
merged 14 commits into from
Aug 7, 2023
Merged

Pc report controllers #59

merged 14 commits into from
Aug 7, 2023

Conversation

pconrad
Copy link
Contributor

@pconrad pconrad commented Aug 6, 2023

In this PR, we add swagger endpoints for:

  • Launching the InstructorReportJob and the InstructorReportJobSingleCommons
  • Retreiving Report and ReportLine records.

Details

  • The InstructorReportJob invokes the ReportService for each Commons in the database. The ReportService takes a snapshot of each game in progress by creating a Report row that is a snapshot of the Commons row in the database, and a ReportLine row for each UserCommons row in the database. Together a Report and its associated ReportLine rows represent a single "Report" from the user standpoint.
  • The InstructorReportJobSingleCommons job does the same thing as the InstructorReportJob but only for a single commons.

In practice, the InstructorReportJobSingleCommons would typically be used for an "on-demand" report, while the InstructorReportJob is more typically one that would be scheduled to run automatically every day. (A future enhancement would be to add an "Ending Date" for each game, and run the report only while the game is in progress; the same applies for the jobs to Milk the cows, and update cow health.)

To the ReportsController, we add two endpoints: one to retrieve Report rows by commons id, and another to retrieve ReportLine rows by their associated report id. These can be used in a future PR to implement the frontend by which an admin can see a report.

@pconrad pconrad mentioned this pull request Aug 7, 2023
6 tasks
pconrad and others added 2 commits August 7, 2023 12:55
@vChase42
Copy link
Collaborator

vChase42 commented Aug 7, 2023

LGTM

@pconrad pconrad merged commit 59e0755 into main Aug 7, 2023
14 checks passed
pconrad added a commit that referenced this pull request Jun 7, 2024
Feature: Suspended field for users entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants