Skip to content

Conversation

@CK-7vn
Copy link
Member

@CK-7vn CK-7vn commented Nov 17, 2025

Description of the change

This PR introduces a modular approach to building and providing reports in CSV, PDF, and Excel formats.

Features
3 Report Types: Attendance, Program Outcomes, and Facility Comparison
Role-Based Access Control: Facility scoping for facility admins
Date Range Filtering: Configurable reporting periods
Audit logging: Export tracking
Comprehensive Test Coverage : Database level regression tests

Approach
Chose a modular object oriented design with the understanding reporting will be an ever-evolving feature of our application growing quickly in importance and that the 3 currently implemented report types are just the beginning.

  type reportExporter interface {
      ToCSV() ([][]string, error)
      ToExcel() (*excelize.File, error)
      ToPDF() (models.PDFConfig, error)
      Len() int
  }

  // each report type implements the interface 
  type AttendanceReportData struct { Data []AttendanceReportRow }
  type ProgramOutcomesReportData struct { Data []ProgramOutcomesReportRow }
  type FacilityComparisonReportData struct { Data []FacilityComparisonReportRow }

Screenshot(s)

Drive with generated reports: https://drive.google.com/drive/folders/1cyxppr4X5ru6dtENFVttLFUSltMY23O6?usp=drive_link

image image image image image image

Additional context

Report Details

  1. Attendance Report
  • Purpose: Daily/weekly/monthly student attendance tracking
  • Shows: Individual attendance records with facility, program, class, date, student info, status, and absence reasons
  • Filters: Date range, facility, program, class, user
  1. Program Outcomes Report
  • Purpose: Quarterly/annual program performance analysis
  • Shows: Aggregated metrics per program including:
    • Enrollment counts (total, active, completed, dropped)
    • Completion rate: (Completed / Total Enrollments) × 100
    • Attendance rate: (Present records / Total attendance records) × 100
    • Total credit hours (sum across all classes in program)
    • Program types and funding source
  • Filters: Date range, facility, program, class status, program types, funding types
  1. Facility Comparison Report
  • Purpose: Cross-facility benchmarking for administrators
  • Shows: Facility-level aggregations including:
    • Total programs and active programs (with enrollment activity)
    • Enrollment metrics and completion rates
    • Top program type by frequency
    • Total credit hours across all programs
    • Last activity date
  • Filters: Date range, facility IDs (array), program types, funding types
  • Access: DepartmentAdmin and SystemAdmin only (cross-facility data)

Test coverage
Database tests

  • Verifies credit hours sum correctly across classes
  • Ensures enrollments dont multiply credit hours

This is a very large ticket, and it is doing a lot of things, it was built with the future in mind as much as it was built for this moment, It has been a very long week doing it, so don't be surprised if I missed something, and I just ask for some grace

Also updated the Go version in quite a few places as well

@CK-7vn CK-7vn requested a review from a team as a code owner November 17, 2025 07:03
@CK-7vn CK-7vn requested review from carddev81 and removed request for a team November 17, 2025 07:03
@CK-7vn CK-7vn force-pushed the CK-7vn/id-508 branch 2 times, most recently from e68e2e7 to ffb4cce Compare November 17, 2025 07:29
@carddev81 carddev81 requested a review from calisio November 26, 2025 21:28
Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments

  1. Not sure what you thoughts are on this, I think that the reports should be labeled with the word 'Report' for example "Export Facility Comparison Report" and I also think the reports should be centralized in one location. I liked your original idea of creating a report link and centralizing the reports. I just wanted to note this and get everyone else's opinion (@calisio and @corypride ).
  2. Maybe for the Status we could use human readable value 'Absent Excused' rather than the coding syntax of 'absent_excused'. Also for any code type we should come up with user friendly format such as changing Life_Skills to 'Life Skills', ect. I think as a future enhancement we should utilize code tables that contains the code, label, description, start_dt, end_dt, ect. This would be easier to maintain.
  3. I think the reports should contain our logo (backend/src/assets/ul-symbol-k.png) and a header ie 'Facility Comparison Report'. (Just a thought--I would like the addition of the filters that the user selected to be included at the top of the report)
  4. Go version has been updated which is great. I was hoping this was going to happen. Can you please also upgrade the following silos of code (for consistency across the code base): migrations and seeder.

@CK-7vn
Copy link
Member Author

CK-7vn commented Dec 2, 2025

Comments

  1. Not sure what you thoughts are on this, I think that the reports should be labeled with the word 'Report' for example "Export Facility Comparison Report" and I also think the reports should be centralized in one location. I liked your original idea of creating a report link and centralizing the reports. I just wanted to note this and get everyone else's opinion (@calisio and @corypride ).
  2. Maybe for the Status we could use human readable value 'Absent Excused' rather than the coding syntax of 'absent_excused'. Also for any code type we should come up with user friendly format such as changing Life_Skills to 'Life Skills', ect. I think as a future enhancement we should utilize code tables that contains the code, label, description, start_dt, end_dt, ect. This would be easier to maintain.
  3. I think the reports should contain our logo (backend/src/assets/ul-symbol-k.png) and a header ie 'Facility Comparison Report'. (Just a thought--I would like the addition of the filters that the user selected to be included at the top of the report)
  4. Go version has been updated which is great. I was hoping this was going to happen. Can you please also upgrade the following silos of code (for consistency across the code base): migrations and seeder.

I deferred the centralized reports page, and the code tables for enum management. What I did fix/change was

  1. Go version
  2. Button labels
  3. Options array extraction
  4. Human readable values
  5. PDF Branding & filters
  6. PDF Column alignment

@CK-7vn
Copy link
Member Author

CK-7vn commented Dec 2, 2025

image image image

@carddev81 carddev81 requested review from corypride and removed request for calisio December 6, 2025 16:01
@CK-7vn
Copy link
Member Author

CK-7vn commented Dec 9, 2025

image image

@CK-7vn
Copy link
Member Author

CK-7vn commented Dec 9, 2025

image

I added the instructor/person who took the attendance to the attendance report, it will also need it in the export single resident attendance ticket, but i'm going to wait until this gets merged that way i'm not duplicating logic and I can just use the same code pretty much.

@carddev81 carddev81 self-requested a review December 10, 2025 16:24
Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small cosmetic thing, remove the hyphen from between Facility and Comparison and from any other report. This seemed intentional and I would have assumed the title of the reports would have matched the label on the button.

Image

Copy link
Contributor

@corypride corypride left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests good!

Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this but just want us to be aware that the text doesn't wrap correctly when text characters exceed a certain threshold. @corypride s PR Jasper Report integration will take care of this once these PDF reports are converted over to Jasper.

Image

@carddev81 carddev81 merged commit 9ba0263 into main Dec 13, 2025
9 of 10 checks passed
@carddev81 carddev81 deleted the CK-7vn/id-508 branch December 13, 2025 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants