# CC Soccer D11 - Session Handoff

**Last Updated:** January 1, 2026 - 16:41

---

## **COMPLETED TODAY (Jan 1, 2026)**

1. ✅ **Dev Mode Banner** - Shows user ID and role on all pages (dev environment only)
2. ✅ **Season Entity Fields** - Visibility flags + league inheritance fields
3. ✅ **Game Entity Installation** - Update hook 9012 installed Game entity
4. ✅ **Game Status Admin Form** - Complete with rainout credit system
5. ✅ **CreditManagerService** - Implemented with issueRainoutCredit() and getUserBalance()

---

## **IMMEDIATE TODO - REMAINING THIS SESSION**

### **4. Override Admin UI**
- Create form to manually issue overrides (e.g., under-35 in Mens 35+)
- List all active overrides with actions (revoke, extend, nudge)
- Admin can extend override expiration

### **5. Basic Content Pages**
- **Home page** - Landing page with key links
- **Roster page** - Players view their team roster
- **Schedule page** - Players view their game schedule

### **6. Menus**
- Navigation structure for user roles
- Admin menus organization

### **7. Masquerade Setup**
- Install Masquerade module
- Configure for admin/support testing

---

## **NEXT SPRINT**

### **8. Reports** (documented in requirements)
- City Payment Report (with rainout exclusion) - see `CITY_REVENUE_REPORT_REQUIREMENTS.md`
- Jersey Report (sizes, distribution by league/night)
- Insurance Report (player roster for insurance)
- Tournament Team/Captain Report (deposits and team formation)

### **9. Schedule Cancellation Overlay**
- Display cancellation reason on schedule
- Visual indicator for cancelled games

---

## **CORE SYSTEMS - COMPLETE ✅**

- ✅ All 7 custom entities (League, Season, Tournament, Team, Game, Registration, Credits)
- ✅ Game entity with cancellation tracking (cancelled_date, credits_applied)
- ✅ Season visibility flags (active, registration_visible, roster_visible, schedule_visible)
- ✅ Season league inheritance (team_size, day_of_week, time_slots, num_fields, location, game_duration)
- ✅ Registration system (custom entity, NOT contrib)
- ✅ Waitlist entity with override system
- ✅ Override entity + OverrideManagerService (needs admin UI)
- ✅ Invitation system for groups/teams
- ✅ Commerce integration (auto-creates products for seasons/tournaments)
- ✅ Notification system (Symfony Mailer + Clickatell SMS)
- ✅ Complete checkout flow with custom panes
- ✅ Unified group management (same interface for seasons AND tournaments)
- ✅ Roles & permissions (Board Member, Slofriendly, Captain, Player)
- ✅ Team Balancer algorithm
- ✅ Credits system (entity + service with rainout credit issuance)
- ✅ Game status form with auto-credit calculation

---

## **ADMIN PAGES**

- `/admin/ccsoccer` - Dashboard
- `/admin/ccsoccer/seasons` - Season list (with visibility indicators)
- `/admin/ccsoccer/season/{id}/edit` - Edit season
- `/admin/ccsoccer/season/{id}/roster` - Roster Builder UI
- `/admin/ccsoccer/season/{id}/schedule` - Schedule Builder UI (Andrew's work)
- `/admin/ccsoccer/game-status` - Game status form (cancel games, issue credits)
- `/admin/ccsoccer/overrides` - Override list (needs full CRUD UI)
- `/admin/ccsoccer/waitlist/manage` - Waitlist management
- `/admin/ccsoccer/teams` - Team list
- `/admin/ccsoccer/registrations` - Registration list

---

## **USER-FACING PAGES**

- `/register` - Registration page with state-based cards
- `/my-registrations` - User's active registrations
- `/my-group/{registration}` - Group/team management (unified interface)

---

## **KEY DECISIONS & PATTERNS**

**Unified Group Management:**
- Single interface at `/my-group/{registration}` handles both season groups AND tournament teams
- No separate captain-specific routes
- Cleaner code, better UX

**Credits System:**
- Credits earned (rainouts), used (checkout), or expired (1 year)
- Rainout credits = (season price / total games) × 0.75
- Auto-applied when game status set to "off" with checkbox

**Season Field Inheritance:**
- Season fields can override league defaults
- Getter methods check season first, fall back to league
- Example: `$season->getTeamSize()` returns season value or league default

**Game Status Workflow:**
1. Admin sets status to "off" at `/admin/ccsoccer/game-status`
2. Enters cancellation reason
3. Optionally checks "Apply Credits"
4. System updates all today's games (status='cancelled', sets cancelled_date, cancellation_reason)
5. Issues credits to all paid/active players for affected seasons
6. Sends notifications with reason and credit confirmation

---

## **GIT WORKFLOW**

**CRITICAL:** Always `git pull` before `git push` (Andrew may have pushed changes)

After pulling changes:
```bash
ddev drush cr
ddev drush updb  # if entity/field changes
```

---

## **COLLABORATION WITH ANDREW**

- Andrew: Roster builder algorithm + schedule generation
- Caleb: UI, admin forms, content pages, menus
- Coordinate: Team name taxonomy, Game entity structure

---

## **COMMANDS**

```bash
# Daily
ddev drush cr  # Clear cache (do this A LOT)

# Database updates
ddev drush updb

# Test data
ddev drush ccs-seed --test --users --force
```

---

## **NEXT SESSION STARTS WITH:**

Override Admin UI implementation
