Skip to the content.

Pole Inventory Management System

Overview

The Pole Inventory Management System is a comprehensive feature for tracking pole vault poles and managing athlete rentals at BPVA (Buckeye Pole Vault Academy). This system allows administrators and BPVA coaches to maintain an inventory of poles, rent them out to athletes, and track returns.

Features

1. Pole Inventory Management

2. Barcode Scanning & Labels

3. Rental Management

4. Role-Based Access

Pole Information

Each pole in the inventory includes the following details:

Basic Information:

Status Tracking:

QR Code Label: Each pole has a printable QR code label that includes:

Pole Checkout Records

When a pole is checked out, the system tracks:

Checkout Information:

Check-in Information:

Status Indicators:

Security Rules:

Indexed Fields:

/pole_checkouts/{checkoutId}

Stores all rental/checkout records.

Security Rules:

Privacy Protection:

Indexed Fields:

Service Layer

PoleInventoryService

Methods:

// Pole CRUD
Future<String> addPole({...})
Future<void> updatePole(Pole pole)
Future<void> deletePole(String poleId)
Stream<List<Pole>> getPoles()
Future<Pole?> getPoleByBarcode(String barcode)
Future<Pole?> getPoleById(String poleId)

// Checkout Operations
Future<String> checkoutPole({...})
Future<void> returnPole({...})
Stream<List<PoleCheckout>> getActiveCheckouts()
Stream<List<PoleCheckout>> getCheckoutHistory({String? athleteId})
Future<List<PoleCheckout>> getAthleteCheckouts(String athleteId)

User Interface

Pole Inventory Screen

Three-tab interface accessible from admin dashboard, athlete menu, or parent menu:

  1. Inventory Tab
    • Grouped display by pole status
    • Pole cards showing brand, weight, length (feet’inches”), and optional flex rating
    • “Show QR Code” menu option displays printable label for all users
    • Action buttons (admins & BPVA coaches only): Rent Out, Edit, Delete
    • Floating action buttons (admins & BPVA coaches only):
      • Quick Scan (top): Scan pole barcode for instant checkout/checkin
      • Add Pole (bottom): Add new poles to inventory
  2. Active Rentals Tab
    • List of currently rented poles
    • Overdue highlighting (red background)
    • Athlete information (visible to admins, BPVA coaches, and external coaches)
    • Return button for each rental (admins & BPVA coaches only)
  3. History Tab
    • Complete rental history
    • Status indicators
    • Searchable/filterable (future enhancement)

Dialogs

Barcode & Label System

Barcode Format

Barcodes are auto-generated with format: POLE-{timestamp}

Example: POLE-1732204567890

This ensures uniqueness through the timestamp while maintaining a clear “POLE” prefix for easy identification.

Printable Labels

The “Show QR Code” feature displays a printable label containing:

Printing Instructions:

  1. Open the pole’s QR code dialog
  2. Take a screenshot or use browser print function
  3. Print on label maker or regular printer
  4. Cut to size and attach to physical pole

Label Maker Compatibility:

BarcodeScannerWidget

QR Code Display

Setup Instructions

1. Install Dependencies

Already added to pubspec.yaml:

dependencies:
  mobile_scanner: ^5.2.3
  qr_flutter: ^4.1.0

Run: flutter pub get

2. Deploy Firestore Rules

The security rules have been updated in firestore.rules. Deploy with:

firebase deploy --only firestore:rules

3. Deploy Firestore Indexes

The indexes have been added to firestore.indexes.json. Deploy with:

firebase deploy --only firestore:indexes

4. Camera Permissions

iOS (ios/Runner/Info.plist): Add camera permission:

<key>NSCameraUsageDescription</key>
<string>This app needs camera access to scan pole barcodes</string>

Android (android/app/src/main/AndroidManifest.xml): Add camera permission:

<uses-permission android:name="android.permission.CAMERA"/>

Usage Workflow

Quick Scan Checkout/Checkin (Admins & BPVA Coaches)

  1. Navigate to Pole Inventory → Inventory tab
  2. Tap the Quick Scan floating action button (scanner icon, top position)
  3. Scan the pole’s barcode/QR code with your camera
  4. If pole is available:
    • Quick checkout dialog appears showing pole details
    • Select athlete from dropdown (filtered to athletes only)
    • Optionally set expected return date
    • Tap “Checkout” to complete
  5. If pole is checked out:
    • Quick checkin confirmation appears showing pole and checkout details
    • Review athlete name, checkout date, and due date
    • Tap “Check In” to return the pole
  6. Process completes with automatic note: “Quick checkout via barcode scan” or “Quick check-in via barcode scan”

Adding a Pole (Admins & BPVA Coaches)

  1. Navigate to Admin Dashboard → Pole Inventory
  2. Tap the Add Pole floating action button (plus icon, bottom position)
  3. Fill in pole details:
    • Brand (e.g., “Pacer”)
    • Weight in pounds (e.g., 12.5)
    • Length in feet (e.g., 13) and inches (0-11)
    • Optional flex rating (e.g., 14.5)
  4. For barcode:
    • Option 1: Tap “Generate barcode” to auto-create unique code
    • Option 2: Tap scan icon to scan existing barcode
    • Option 3: Manually enter barcode
  5. Optionally set purchase date
  6. Tap “Add”
  7. Use “Show QR Code” to print a label for the physical pole

Renting Out a Pole (Admins & BPVA Coaches)

  1. Go to Inventory tab
  2. Expand the pole card
  3. Tap “Rent Out” button
  4. Select the athlete from dropdown (filtered to athletes only)
  5. Optionally set expected return date
  6. Add any notes
  7. Tap “Checkout”

Returning a Pole (Admins & BPVA Coaches)

  1. Go to Active Rentals tab
  2. Find the rental record
  3. Tap “Return” button
  4. Optionally add return notes
  5. Tap “Return Pole” to confirm

Viewing History

  1. Go to History tab
  2. View all past rentals with status indicators
  3. Filter by athlete (future enhancement)

Testing

Model Tests

Run tests:

flutter test test/models/pole_test.dart test/models/pole_checkout_test.dart

All 14 tests passing ✅

Service Tests

Future enhancement: Add integration tests for PoleInventoryService

Future Enhancements

  1. Search & Filter
    • Search poles by brand, weight, or barcode
    • Filter checkouts by athlete or date range
  2. Analytics Dashboard
    • Most rented poles
    • Average rental duration
    • Overdue statistics
  3. Notifications
    • Remind athletes of upcoming return dates
    • Alert admins of overdue rentals
  4. Batch Operations
    • Bulk barcode generation
    • Print multiple labels at once
    • Export inventory to CSV
  5. Damage Tracking
    • Log pole condition on checkout/return
    • Track maintenance history
  6. Mobile App for Athletes
    • View their current rentals
    • See rental history
    • Scan pole to view details

Architecture

Pattern: Service-Oriented with Singleton

Code Organization

lib/
├── models/
│   ├── pole.dart                    # Pole data model
│   └── pole_checkout.dart           # PoleCheckout data model
├── services/
│   └── pole_inventory_service.dart  # Business logic
├── screens/
│   └── admin/
│       └── pole_inventory_screen.dart  # Admin UI
└── widgets/
    └── barcode_scanner_widget.dart     # Reusable scanner

test/
└── models/
    ├── pole_test.dart
    └── pole_checkout_test.dart

Dependencies

Support

For questions or issues with the pole inventory system:

  1. Check Firestore console for data integrity
  2. Review security rules if permission errors occur
  3. Ensure camera permissions are granted on device
  4. Check Firestore indexes are deployed

Version History