Logo

SubIt

Class and shift substitution management system with ABC Fitness integration

Overview

SubIt is a class and shift substitution management system for fitness clubs that integrates with ABC Fitness. It streamlines the process of finding substitutes when instructors or staff cannot work their scheduled classes or shifts.

Core Workflow

The Substitution Process

  1. Request Creation (Blue Status - "open")

    • Instructor or manager creates a substitution request for classes they cannot teach
    • Can select multiple classes for bulk request creation
    • Optionally invites specific qualified candidates
    • Request is posted to the substitution board
  2. Invitation & Application Phase (Yellow Status - "pending_approval")

    • Invited instructors receive notifications
    • Instructors can accept or reject invitations
    • First accepted invitation moves request to pending_approval
    • Manager can manually assign substitutes
  3. Manager Approval (Green Status - "approved")

    • Manager reviews accepted invitations
    • Selects and approves final substitute
    • Approval is automatically pushed to ABC Fitness via API
    • Substitution is confirmed in both systems

Key Features

Sub Board (Request Management)

  • Comprehensive Dashboard:

    • Calendar view and list view modes
    • Status-based filtering with color-coded badges
    • Location-based filtering
    • Request details with class information
  • Bulk Request Creation:

    • Select multiple classes at once
    • Skill-based filtering for qualified candidates
    • 3-step wizard interface for creating requests
  • Invitation System:

    • Invite specific candidates when creating requests
    • Track invitation status (pending, accepted, rejected)
    • Comments field for acceptance/rejection notes
    • First acceptance auto-transitions to pending_approval
  • Audit Trail:

    • All actions create notes in SubItRequestNote table
    • Tracks last activity with timestamps
    • User attribution for all changes

Classes Management

  • Dual View Modes:

    • Calendar View: Monthly calendar display
    • List View: Tabular display with comprehensive details
    • Toggle between views with persistent URL parameters
  • Comprehensive Filtering:

    • Location multi-select filter
    • Staff/employee multi-select filter
    • Class type multi-select filter
    • Time filters (upcoming, today, week, past, all)
  • Attendance Tracking:

    • ABC Attendance: Automatic sync from ABC Fitness
    • Instructor Attendance: Manual input for internal tracking
    • Visual capacity indicators with color coding
    • Attendance modal for updating manual counts

Reports & Analytics

  • Attendance Report:

    • Three view modes: By Location, By Class, Program Analysis
    • Date range and filter support
    • Dual attendance tracking (ABC + Manual)
    • Cost metrics (Cost of Class, Cost per Head)
    • Configurable CPH thresholds
    • Export functionality
  • Payroll Report:

    • Instructor compensation tracking
    • Total hours and costs per instructor
    • Expandable class details
    • Grand totals and summary statistics

Employee Management

  • Employee Directory:

    • Skills/qualifications management
    • Weekly availability scheduling
    • Location assignments
    • User account linking
  • Skills System:

    • Create and manage instructor skills
    • Assign primary/secondary skills to class types
    • Filter directory by skills
    • Skill-based candidate filtering for requests

Data Synchronization

One-Way Sync from ABC Fitness

The app pulls the following data from ABC Fitness:

  • Instructors: Personal information, qualifications, department assignments
  • Classes: Class schedules, assigned instructors, class types
  • Calendar Event Types: Event type definitions with capacity and duration
  • Members: Member information and attendance tracking

Push to ABC Fitness

When a substitution request is approved:

  1. Automatically pushes substitution to ABC Fitness API
  2. Replaces the original instructor with the substitute
  3. Creates audit trail with success/failure notes
  4. Non-blocking error handling for resilience

Database Models

Core Models

model SubItEmployee {
  id              String
  employeeId      String    // ABC Fitness ID
  userId          String?   // Link to User for authentication
  firstName       String
  lastName        String
  email           String?
  wage            Int?      // Hourly wage for cost calculations
  locations       Location[]
  skills          SubItSkill[]
  calendarEvents  SubItCalendarEvent[]
}

model SubItCalendarEvent {
  id                    String
  eventId               String    // ABC Fitness Event ID
  eventName             String
  category              String    // "Class" or "Appointment"
  eventTimestamp        DateTime
  duration              Int
  status                String
  manualAttendanceCount Int?      // Blend manual attendance
  comments              String?
  attendances           SubItEventAttendance[]
}

model SubItRequest {
  id                 String
  employeeId         String    // Requesting instructor
  classId            String    // Class needing substitute
  status             String    // open, pending_approval, approved, cancelled
  reason             String
  assignedEmployeeId String?   // Assigned substitute
  invites            SubItRequestInvite[]
  notes              SubItRequestNote[]
}

Routes

User-Facing Routes

  • /app/{tenant}/apps/subit - Sub Board (main dashboard)
  • /app/{tenant}/apps/subit/new-request - Create substitute request (3-step wizard)
  • /app/{tenant}/apps/subit/requests/{id} - Request details page
  • /app/{tenant}/apps/subit/classes - Classes list with calendar/list views
  • /app/{tenant}/apps/subit/directory - Employee directory
  • /app/{tenant}/apps/subit/reports - Reports index
  • /app/{tenant}/apps/subit/reports/attendance - Attendance analytics
  • /app/{tenant}/apps/subit/reports/payroll - Payroll report
  • /app/{tenant}/apps/subit/settings - App configuration

Member-Facing Routes (Public)

  • /__subit/{tenant}/schedule/{location} - Public class schedule
    • No authentication required
    • Week, Month, and Agenda view modes
    • Class type filtering
    • Mobile-responsive design

User Roles and Permissions

Manager (isSuperUserOrAdmin)

  • View all substitution requests
  • Approve/reject substitution requests
  • Delete requests
  • Assign substitutes manually
  • Create users from employee records
  • Access reports and analytics

Instructor (Regular User with Assigned Employee)

  • Submit substitution requests
  • Accept or reject invitations
  • View their own schedule and requests
  • Select employee profile when responding

Admin

  • All Manager permissions plus:
  • Configure app settings
  • Manage sync schedules
  • Set up user-employee relationships
  • Manage skills and class types

ABC Fitness Integration

Service Principal Setup

Azure App Registration requires:

  • Application (Client) ID
  • Directory (Tenant) ID
  • Client Secret
  • API Permissions for calendars, employees, and departments

API Operations

Read Operations:

  • GET /employees/{clubNumber} - Fetch instructors
  • GET /calendars/events - Fetch class schedules
  • GET /calendars/eventtypes - Fetch event type definitions
  • GET /clubs - Fetch location details

Write Operations:

  • PUT /{clubNumber}/calendars/events/{eventId}/employees/{employeeId} - Replace event instructor

Timezone Handling

The system uses timezone-aware formatting to ensure times display correctly:

  • Timezone Configuration: Each location has a configured timezone
  • UTC Storage: All dates stored in UTC in database
  • Display Conversion: Uses formatInTimeZone for consistent display
  • Abbreviation Support: Automatically converts timezone abbreviations (CDT, EST, etc.) to IANA identifiers
  • No Browser Interference: Times are consistent for all viewers

Configuration

App Settings

  • Events Sync Start Date: Starting date for calendar event synchronization
  • Default Start/End Times: For availability scheduling (5:00 AM to 8:00 PM)
  • CPH Thresholds: Low ($1.25) and High ($2.00) thresholds for cost per head
  • CPH Attendance Source: Choose between ABC, Manual, or Comments for calculations

Connection Settings (Per Location)

  • ABC Fitness API credentials (App ID, App Key)
  • Club number mapping
  • Timezone configuration

Sync Tasks

  • Locations: Daily enrichment with ABC Fitness data
  • Employees: Daily sync of instructor records
  • Event Types: Daily sync of class type definitions
  • Calendar Events: Hourly sync for schedule changes and attendance

Best Practices

  1. Sync Frequency: Run class sync multiple times daily to catch schedule changes
  2. Qualification Validation: Always verify instructor qualifications before allowing applications
  3. Audit Trail: All actions create notes for complete history
  4. User Management: Always assign new users to "Instructors" department
  5. Location Filtering: Respect employee location assignments throughout workflow
  6. Bulk Operations: Use transactions when creating multiple requests
  7. UI Consistency: Use shared components for consistent user experience

Implementation Status

Completed Features ✅

  • Sub Board with calendar and list views
  • 3-step wizard for request creation
  • Invitation system with accept/reject workflow
  • Skill-based filtering for candidates
  • Attendance tracking (ABC + Manual)
  • Reports (Attendance, Payroll)
  • ABC Fitness integration (read + write)
  • Employee management with skills
  • Public class schedules
  • Timezone-aware display

In Development

  • Email/SMS notifications
  • Advanced reporting features
  • Mobile app support

We respect your privacy.

TLDR: We use cookies for language selection, theme, and analytics. Learn more.