Skip to content

Conversation

@corypride
Copy link
Contributor

@corypride corypride commented Dec 6, 2025

Implement bulk cancellation of class event sessions for specific instructors within a date range. This feature enables administrators to efficiently cancel multiple class sessions when an instructor is on PTO, sick leave, or otherwise unavailable, with full audit trail visibility in Class History.

Changes

Backend

  • API Endpoint: POST /api/program-classes/bulk-cancel - Handles bulk session cancellations
  • Database Functions: BulkCancelSessions() - Processes recurring events and creates override records
  • Migration: Added instructor_id foreign key to program_classes table with proper indexing
  • Instructor Management: /api/facilities/{id}/instructors endpoint returning facility admins only

Frontend

  • Modal Component: BulkCancelSessionsModal.tsx - Full cancellation workflow with preview
  • Form Updates: ClassManagementForm.tsx - Replaced text input with instructor dropdown
  • History Integration: Cancellations appear in ActivityHistoryCard with full audit details

Key Features

  • Instructor dropdown populated with facility administrators only
  • Date range selection with past date warnings
  • Required cancellation reason (min 10 characters)
  • Real-time preview showing affected sessions, and classes
  • Creates ProgramClassEventOverride records for each cancelled session
  • Full audit trail via ChangeLogEntry records

Files Changed

  • backend/src/database/program_classes.go - Bulk cancellation logic
  • backend/src/handlers/classes_handler.go - API endpoints
  • backend/src/handlers/facilities_handler.go - Instructor queries
  • backend/src/models/program_classes.go - Data models
  • backend/migrations/00061_add_instructor_fk.sql - Database schema
  • frontend/src/Components/modals/BulkCancelSessionsModal.tsx - Modal UI
  • frontend/src/Components/forms/ClassManagementForm.tsx - Form updates
  • frontend/src/Components/ClassLayout.tsx - Integration point

Related Asana Task:

@corypride corypride self-assigned this Dec 6, 2025
@corypride corypride force-pushed the cpride/ticket523_bulk_class_session_cancellations branch 2 times, most recently from 8b2da5f to 95809a8 Compare December 13, 2025 06:55
@corypride corypride changed the title Bulk Class Session Cancellation by Teacher Bulk Class Session Cancellation by Instructor Dec 17, 2025
@corypride corypride marked this pull request as ready for review December 17, 2025 05:37
@corypride corypride requested a review from a team as a code owner December 17, 2025 05:37
@corypride corypride requested review from CK-7vn and removed request for a team December 17, 2025 05:37
@corypride corypride requested a review from CK-7vn December 29, 2025 19:50
@corypride corypride force-pushed the cpride/ticket523_bulk_class_session_cancellations branch 5 times, most recently from b108c1d to 3715153 Compare December 30, 2025 02:33
@corypride corypride closed this Jan 5, 2026
@corypride corypride force-pushed the cpride/ticket523_bulk_class_session_cancellations branch from 3715153 to 2c91c12 Compare January 5, 2026 20:41
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.

3 participants