> ## Documentation Index
> Fetch the complete documentation index at: https://docs.younegotiate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Calendar Sync

> Jane connects Google Calendar from My Bill Pay Calendar.

## Real-World Example

Jane connects Google Calendar from My Bill Pay Calendar. After she grants access, the portal should store the Google calendar connection and create payment events for eligible future payments.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Consumer chooses Google Calendar"] --> B["Consumer grants Google access"]
    B --> C["Portal stores Google calendar metadata"]
    C --> D["CreateCalendarEvents job is dispatched"]
    D --> E["Future payments appear in Google Calendar"]
    classDef default fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef actor fill:#E0F2FE,stroke:#0284C7,stroke-width:2px,color:#0C4A6E;
    classDef system fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef decision fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F;
    classDef risk fill:#FEE2E2,stroke:#DC2626,stroke-width:2px,color:#7F1D1D;
    classDef outcome fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D;
    class A,B actor;
    class C,D system;
    class E outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should connect the authenticated consumer to their Google Calendar account.
* It should store the needed calendar metadata and enable live updates when the connection succeeds.
* It should dispatch calendar event creation for eligible future payments.

## How It Should Not Work

* It should not sync events for another consumer.
* It should not keep showing live sync as active after the connection is revoked or invalid.
* It should not create duplicate events for the same scheduled transaction.

## Developer Notes

* Google authorization redirects back to the consumer payment calendar.
* Calendar creation and updates should happen in jobs, not long-running page requests.

## Related App Areas

* `routes/consumer/index.php`
* `app/Http/Controllers/Consumer/GoogleCalendarController.php`
* `app/Jobs/CreateCalendarEvents.php`
* `app/Jobs/UpdateCalendarEvents.php`
