# PILOT-004

## Public Invitation Rendering Engine

You are implementing the fourth Pilot Launch feature for the INVEETAIRE platform.

Current Status

✅ Sprint 0 Complete

✅ Sprint 1 Complete

✅ Sprint 2 Complete

✅ Sprint 3 Complete

✅ PILOT-001 Invitation Engine

✅ PILOT-002 Guest Import

✅ PILOT-003 Public Guest Identity Layer

Implement ONLY the Public Invitation Rendering Engine.

Do NOT implement RSVP.

Do NOT implement Wish.

Do NOT implement WhatsApp Distribution.

Do NOT implement Check-In.

Do NOT implement Attendance Dashboard.

---

# Goal

Render a complete public invitation page for an invited guest.

The page must use the Guest Identity Layer implemented in PILOT-003.

---

# Mandatory Reading

Read:

* AI.md
* WORKFLOW.md
* IMPLEMENTATION_ROADMAP.md

Read implementation memories:

* PILOT-001
* PILOT-002
* PILOT-003

---

# Files Allowed

Create:

app/modules/PublicInvitation/

```
InvitationRenderer.php
```

Modify:

app/modules/PublicInvitation/

```
PublicInvitationController.php

PublicInvitationService.php

PublicInvitationModel.php
```

app/views/public/

```
identity.php
```

No other files.

---

# Rendering Flow

Incoming Request

↓

workspace_slug

↓

guest_token

↓

Resolve Guest

↓

Resolve Invitation

↓

Resolve Theme

↓

Resolve Invitation Sections

↓

Render Theme

---

# Render Responsibilities

InvitationRenderer owns:

* section ordering
* section visibility
* theme data mapping
* rendering preparation

No SQL.

No HTML output generation outside the view.

No session access.

---

# Public Invitation Content

Render dynamically:

## Hero

Bride

Groom

Hero Quote

Cover Image

Guest Name

---

## Countdown

Wedding Date

Countdown

---

## Story

Love Story

---

## Wedding Events

Support multiple events.

Examples:

Holy Matrimony

Reception

If the guest is invited to only one event:

Render only that event.

If invited to multiple:

Render all assigned events in chronological order.

---

## Venue

Venue Name

Address

Google Maps Button

---

## Gallery

Render gallery if available.

Hide section if empty.

---

## Gift

Render gift information if enabled.

Hide if disabled.

---

## Footer

Closing message.

---

# Theme Rules

Never hardcode Klasik Putih.

Always resolve:

Theme Version

↓

InvitationRenderer

↓

View

The renderer must support future themes.

---

# Visibility Rules

Every section respects:

is_visible

If hidden:

Do not render.

---

# Guest Personalization

Render:

Dear

Guest Name

Automatically.

Never request guest name input.

---

# Security

Verify:

workspace_slug

guest_token

Workspace isolation

404 on invalid guest

No internal IDs

escape_html()

---

# Constraints

Do NOT:

* implement RSVP
* implement Wish
* implement WhatsApp
* implement QR Check-In
* modify Guest module
* modify Invitation module
* modify Workspace module
* modify app/core/*
* modify database schema

---

# Verification

Verify:

Guest resolution.

Theme resolution.

Section ordering.

Section visibility.

Multi-event rendering.

Gallery hidden when empty.

Gift hidden when disabled.

404 boundaries.

PHP syntax.

---

# Acceptance Criteria

PASS only if:

* InvitationRenderer created.
* Public invitation rendered.
* Theme resolved dynamically.
* Guest name personalized.
* Multi-event supported.
* Visibility rules respected.
* Gallery conditional.
* Gift conditional.
* No SQL outside Model.
* No HTML outside View.
* PHP syntax passes.

---

# Output

Provide:

1. Files created.
2. Files modified.
3. Rendering workflow.
4. Theme workflow.
5. Multi-event workflow.
6. Visibility workflow.
7. Security verification.
8. Acceptance checklist.
9. PHP syntax results.

Stop after implementation.

Wait for Human Approval.
