# Events & Sessions

In CSP Connect, it is crucial to understand the distinction between an **Event** and a **Session**. This structure allows for flexible scheduling, especially for multi-day festivals or tournaments.

## Core Definitions

### 1. Event
An **Event** is the high-level container. It represents the overall engagement.
*   *Example:* "Glastonbury Festival 2026" or "Arsenal vs Chelsea Match".
*   It holds overall settings, location defaults, and the pool of potential staff.

### 2. Session
A **Session** is a specific block of time within an Event. **Workers are assigned to Sessions, not just Events.**
*   *Example:* "Glastonbury Day 1 (June 20)", "Glastonbury Day 2 (June 21)".
*   Each Session has its own unique **Check-in Requirements** and **Payroll Approvals**.

## How It Works in Practice

### Single-Day Event
For a football match, there is typically 1 Event with 1 Session.
*   **Event:** Arsenal Match
*   **Session:** Match Day Security (10:00 AM - 6:00 PM)

### Multi-Day Event (The "Glastonbury" Model)
For a 3-day festival, there is 1 Event with 3 Sessions.

1.  **Day 1 Session:** Workers check in. If they are working Day 2, they may be allowed to keep their equipment.
2.  **Day 2 Session:** A new attendance record is created. Payroll for Day 1 can be submitted independently.
3.  **Day 3 Session:** Final day. Equipment **MUST** be returned before check-out is allowed.

> [!NOTE]
> **Key Takeaway:** Payroll is processed per **Session**. This means workers can be paid for Friday's shift before Sunday's shift is even completed.

## Sub-sessions and Check-in Geofence Logic

Sessions can optionally be divided into **sub-sessions**, each with their own geofence radius. When sub-sessions are in use, the check-in rules change for casual workers:

| Scenario | Check-in requirement |
| :--- | :--- |
| **Session has no sub-sessions** | Worker must be within the **session geofence** |
| **Session has sub-sessions** | Worker must be within their **assigned sub-session's geofence** |

Being inside the main session boundary is not enough when sub-sessions are configured — the worker's position must fall within their specific sub-session's geofence before check-in is allowed.

> [!NOTE]
> Sub-sessions are fully optional. If none are configured, check-in works as normal against the session geofence.

## Intelligent Payroll Rules

The system applies smart rules to calculate payable hours based on scheduled vs. actual times:

| Scenario | Rule | Result |
| :--- | :--- | :--- |
| **Early Arrival** | User checks in 15 mins early | Paid from **Scheduled Start** |
| **Late Arrival** | User checks in 15 mins late | Paid from **Actual Check-in** |
| **Overtime** | User works 2 hours late | Paid until **Actual Check-out** (requires approval) |