Skip to content

feat: add necessary wiring and formatting to make department admin dashboard page mirror figma#1089

Merged
carddev81 merged 3 commits intoCK-7vn/total-refactorfrom
carddev81/dashboard-deptadmin
Mar 3, 2026
Merged

feat: add necessary wiring and formatting to make department admin dashboard page mirror figma#1089
carddev81 merged 3 commits intoCK-7vn/total-refactorfrom
carddev81/dashboard-deptadmin

Conversation

@carddev81
Copy link
Contributor

Pre-Submission PR Checklist

  • No debug/console/fmt.Println statements
  • Unnecessary development comments removed
  • All acceptance criteria verified
  • Functions according to ticket specifications
  • Tested manually where applicable
  • Branch rebased with latest main
  • No business logic exists within the database layer

Description of the change

Made change to dashboard for ONLY department administrators (dashboard). Mirrors figma exactly. Made several backend changes to account for frontend data w/look and feel.

Please test thoroughly. You will need to create facilities, programs, classes, enrollments, and mark attendance and make to create your records across facilities. You will need to mark attendance for multiple classes with attendance status of 'unexecused'

Here is a query you can use to back date the enrollments:

update program_class_enrollments set enrolled_at = '2025-01-01 08:00:00' where enrollment_status = 'Enrolled';

  • Related issues: Link to related Asana ticket that this closes: N/A

Screenshot(s)

image

@carddev81 carddev81 requested a review from a team as a code owner February 20, 2026 22:55
@carddev81 carddev81 requested review from CK-7vn and removed request for a team February 20, 2026 22:55
@github-actions github-actions bot added documentation Improvements or additions to documentation Backend labels Feb 20, 2026
Copy link
Member

@CK-7vn CK-7vn left a comment

Choose a reason for hiding this comment

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

Few small things nothing serious serious.

return nil, err
}

missingByFacility := make(map[uint]int64, len(summaries))
Copy link
Member

Choose a reason for hiding this comment

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

We should probably refactor this section since each iteration is making multiple DB calls. I would suggest maybe calling GetMissingAttendanceForFacility once and building a map, but, i'm sure you can figure out whatever would be best.

  allItems, err := svc.GetMissingAttendanceForFacility(args, facilityID, days)
  if err != nil {
      return nil, err
  }

 
  classes, err := svc.db.GetClasses(args, facilityID)
  if err != nil {
      return nil, err
  }
  classToFacility := make(map[uint]uint, len(classes))
  for _, c := range classes {
      classToFacility[c.ID] = c.FacilityID
  }

  missingByFacility := make(map[uint]map[uint]struct{})
  for _, item := range allItems {
      fid := classToFacility[item.ClassID]
      if missingByFacility[fid] == nil {
          missingByFacility[fid] = make(map[uint]struct{})
      }
      missingByFacility[fid][item.ClassID] = struct{}{}
  }


  for i := range summaries {
      fid := summaries[i].FacilityID
      summaries[i].AttendanceConcerns = attendanceConcerns[fid]
      summaries[i].MissingAttendance = int64(len(missingByFacility[fid]))
  }

@carddev81 carddev81 merged commit 7ae0c12 into CK-7vn/total-refactor Mar 3, 2026
8 checks passed
@carddev81 carddev81 deleted the carddev81/dashboard-deptadmin branch March 3, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants