# User Guide — Calendar Booking Platform

This guide covers how **hosts** set up their account and how **guests** book appointments via a public link.

---

## For Hosts

### 1. Create Your Account

1. Go to `https://book.example.com/signup`.
2. Enter your **email**, **password**, **full name**, and choose a **username**.
   - Your username becomes part of your booking URL: `https://book.example.com/book/your-username/...`
   - Usernames must be lowercase letters, numbers, and hyphens only (e.g. `jane-doe`).
3. Verify your email by clicking the link sent to your inbox.
4. Log in to your dashboard.

### 2. Set Your Timezone

Your timezone controls how **your working hours** are interpreted.

1. Go to **Settings → Profile**.
2. Select your timezone from the dropdown (e.g. `America/New_York`, `Europe/London`, `Asia/Tokyo`).
3. Save changes.

> **Tip:** Choose the timezone where you physically work, not where your clients are. Guests will see times converted to their own timezone on the booking page.

### 3. Define Working Hours

Working hours define when guests **can** book you.

1. Go to **Settings → Availability**.
2. For each day of the week, set:
   - **Available** — toggle on/off
   - **Start time** and **End time** — e.g. Monday 09:00–17:00
   - You can add **multiple intervals** per day (e.g. morning and afternoon with a lunch break).
3. Configure booking rules:
   - **Minimum notice** — e.g. "At least 4 hours before the meeting"
   - **Scheduling window** — e.g. "Guests can book up to 60 days ahead"
4. Save.

#### Date-Specific Overrides

For holidays or special days:

1. Click **Add date override** on the Availability page.
2. Pick a date.
3. Choose:
   - **Unavailable all day**, or
   - **Custom hours** for that date only.

### 4. Connect Your Calendars

Connecting calendars prevents double-booking and adds new appointments to your existing calendar.

1. Go to **Settings → Calendars**.
2. Click **Connect** next to your provider:

| Provider | What you need |
|----------|---------------|
| Google Calendar | Google account; approve OAuth permissions |
| Microsoft Outlook / 365 | Work or personal Microsoft account |
| Apple iCloud | Apple ID + [app-specific password](https://appleid.apple.com) |

3. After connecting, choose:
   - **Calendars to check for conflicts** — events on these calendars block your availability.
   - **Calendar to add bookings to** — new appointments are created here (pick one primary calendar).

4. Click **Save**.

> **Important:** If you disconnect a calendar, existing bookings remain in the app but will no longer sync to that calendar.

See [Calendar Integrations](./CALENDAR_INTEGRATIONS.md) for troubleshooting.

### 5. Create an Event Type

An event type is what guests book — e.g. "30-minute intro call."

1. Go to **Event Types → New Event Type**.
2. Fill in:

| Field | Example | Notes |
|-------|---------|-------|
| Title | 30 Minute Intro Call | Shown to guests |
| URL slug | `30min-intro` | Part of your public link |
| Duration | 30 minutes | Meeting length |
| Buffer before | 5 min | Prep time before meeting |
| Buffer after | 5 min | Break after meeting |
| Location | Google Meet / Phone / Address | Optional |
| Description | What to expect... | Optional |
| Custom questions | "What would you like to discuss?" | Optional intake form |

3. Save. Your **public booking link** is displayed:

```
https://book.example.com/book/your-username/30min-intro
```

### 6. Share Your Link

Copy your booking link and share it via:

- Email signature
- Website ("Schedule a call" button)
- Social media bio
- QR code (generate from dashboard)

You can create **multiple event types**, each with its own link (e.g. 15-min quick chat vs 60-min deep dive).

### 7. Manage Bookings

From **Dashboard → Bookings**:

| Action | How |
|--------|-----|
| View upcoming | Filter by date range |
| Cancel | Click booking → Cancel → guest is notified |
| Reschedule | Click booking → Reschedule → pick new time → guest notified |
| Export | Download CSV of bookings |

---

## For Guests

### 1. Open the Booking Link

Your host will share a link like:

```
https://book.example.com/book/alice/30min-intro
```

No account or login is required.

### 2. Pick a Date and Time

1. The page shows the host name, meeting type, and duration.
2. **Select your timezone** from the dropdown (defaults to your browser timezone).
3. Pick a **date** on the calendar — only dates with available slots are selectable.
4. Choose an **available time slot**.

### 3. Enter Your Details

Fill in:

- **Name** (required)
- **Email** (required — used for confirmation and calendar invite)
- **Phone** (optional, if host requested)
- Any **custom questions** the host configured

Click **Confirm Booking**.

### 4. Confirmation

After booking:

- You see a confirmation page with meeting details.
- You receive an **email** with:
  - Date, time, and timezone
  - Location or meeting link
  - **Add to calendar** (.ics file attachment)
  - **Cancel booking** link (if host allows cancellations)

### 5. Cancel a Booking

1. Open the cancellation link from your confirmation email.
2. Confirm cancellation.
3. You and the host receive a cancellation email.
4. The time slot becomes available again for others.

> Cancellation may not be allowed if you are within the host's minimum cancellation window (e.g. less than 24 hours before the meeting).

---

## FAQ

### Why don't I see any available times?

Possible reasons:

- Host has no working hours set for that day.
- All slots are already booked.
- Host's connected calendars show conflicts.
- You are outside the host's scheduling window (too soon or too far in the future).

Try another date or contact the host directly.

### Which timezone is used?

- **Hosts** set availability in their own timezone.
- **Guests** see times converted to the timezone they select on the booking page.
- Confirmation emails include the time in both UTC and the guest's selected timezone.

### Can I book without an account?

Yes. Guests only need a name and email.

### Is my data shared?

Guest email and answers are visible only to the host. They are not published publicly.

### What calendars work with the .ics file?

The `.ics` attachment works with:

- Google Calendar (import or open attachment)
- Microsoft Outlook
- Apple Calendar (macOS / iOS)

---

## Support

| Issue | Contact |
|-------|---------|
| Booking page not loading | Check link URL; try another browser |
| Wrong timezone on confirmation | Re-select timezone before booking |
| Calendar not syncing (hosts) | Settings → Calendars → Reconnect |
| General support | support@example.com |
