Skip to the content.

Waiver Exemption/Attestation System

Overview

The Waiver Exemption system allows users to attest that a waiver is not required for a specific gathering activity, providing a configurable reason for the exemption. This creates an audit trail of why waivers were not collected for specific activities.

Database Schema

waivers_waiver_types Table

waivers_gathering_waivers Table

Modified to support both uploaded waivers and exemptions (attestations):

Note: Exemptions are linked to activities through the existing waivers_gathering_waiver_activities join table, allowing a single exemption to apply to multiple activities (just like regular waivers).

Components

Backend

Entities

  1. WaiverType.php
    • Added exemption_reasons accessible field
    • Added exemption_reasons_parsed virtual field
    • _getExemptionReasonsParsed() method returns parsed JSON array
  2. GatheringWaiver.php
    • Added is_exemption accessible field
    • Added exemption_reason accessible field
    • Supports both uploaded waivers (document_id set) and exemptions (is_exemption=true)

Table Classes

  1. WaiverTypesTable.php
    • Added hasMany relationship to GatheringWaivers
    • Validation for exemption_reasons field (must be array of non-empty strings)
  2. GatheringWaiversTable.php
    • Modified to handle both uploaded waivers and exemptions
    • Validation ensures exemptions have exemption_reason set and document_id null
    • Validation ensures regular waivers have document_id set

Controllers

GatheringWaiversController.php

View Cells

GatheringWaiversCell.php

Frontend

Templates

  1. display.php (Waivers template)
    • Shows exemption badge with tooltip for exempted waivers
    • “Attest Not Needed” button appears only for:
      • Waivers with status “Pending”
      • Waiver types that have exemption_reasons configured
    • Includes waiver_attestation_modal element
  2. waiver_attestation_modal.php
    • Bootstrap modal with:
      • Dynamic reason radio button list
      • Optional notes textarea
      • Error/success alert containers
      • Submit button with Stimulus action bindings
  3. add.php and edit.php (WaiverTypes forms)
    • Dynamic exemption reasons management section
    • Add/remove reason inputs
    • JSON storage in hidden field
    • Helpful instructions for administrators

JavaScript Controllers

  1. waiver-attestation-controller.js
    • Manages attestation modal display and form submission
    • showModal(): Opens modal, populates with waiver data
    • populateReasons(): Builds radio button list from waiver type’s reasons
    • submitAttestation(): AJAX POST to /waivers/gathering-waivers/attest
    • Handles CSRF tokens, error/success feedback, page reload
  2. exemption-reasons-controller.js
    • Manages dynamic list of exemption reasons in WaiverTypes forms
    • addReason(): Adds new reason input field
    • removeReason(): Removes reason field (keeps at least one)
    • reasonChanged(): Updates hidden JSON field, auto-adds new field when last one is filled
    • Automatic focus management for better UX

User Flow

Attesting No Waiver Needed

  1. User navigates to Gathering Waivers tab on a gathering detail page
  2. For activities with pending waivers that have exemption reasons configured, an “Attest Not Needed” button appears
  3. Clicking the button opens a modal showing:
    • Activity name
    • Waiver type name
    • List of configurable reasons (radio buttons)
    • Optional notes field
  4. User selects a reason and optionally adds notes
  5. User clicks “Attest Not Needed”
  6. System validates:
    • User has permission to edit the gathering
    • Activity belongs to the gathering
    • Selected reason is valid for this waiver type
    • No duplicate exemption exists
  7. On success:
    • Exemption record is created
    • Page reloads to show updated status
    • Waiver row now shows “Exempted” badge with tooltip showing reason

Configuring Exemption Reasons

  1. Administrator navigates to Waiver Types add/edit form
  2. Scrolls to “Exemption Reasons” section
  3. Adds reasons using dynamic input fields:
    • Type reason text and press Enter or Tab
    • System automatically adds a new empty field
    • Remove reasons using the X button
  4. Save the waiver type
  5. Reasons are stored as JSON array in database
  6. When empty, attestation is not available for this waiver type in the upload wizard

Display Logic

Waiver Status Badge

Upload Wizard

The waiver upload wizard (Step 3: Add Pages) provides two modes:

  1. Upload Mode: User uploads waiver document images
  2. Attest Mode: User attests that waiver is not needed (only available when waiver type has exemption_reasons configured)

Users can toggle between modes when exemption reasons are available for the selected waiver type.

Technical Details

Validation Rules

WaiverType.exemption_reasons:

GatheringWaiver (when is_exemption=true):

Security

Data Integrity

Future Enhancements

Potential improvements for future iterations:

  1. Exemption Management
    • View list of all exemptions for a gathering (already supported - exemptions appear in waiver list)
    • Ability to revoke/delete exemptions (treat like regular waivers)
    • Exemption history with change log
  2. Reporting
    • Report of exempted waivers by gathering/activity
    • Export exemption data for compliance audits
  3. Notifications
    • Email notification when exemption is created
    • Alert gathering staff of exemptions
  4. Bulk Operations
    • Apply same exemption reason to multiple activities at once
    • Copy exemptions from previous gathering
  5. Enhanced Validation
    • Require manager approval for certain exemption reasons
    • Limit exemptions based on activity type or risk level

Files Modified

Database

Backend

Frontend Templates

JavaScript