# PILOT-001

## Invitation Engine Foundation

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

Sprint 3 has been completed.

Workspace architecture is complete.

Do NOT continue using Sprint terminology.

This is now Pilot Launch development.

---

# Goal

Implement the Invitation Engine foundation.

The result should allow one wedding invitation to be created, edited, previewed and published.

Do NOT implement Guest Management yet.

Do NOT implement RSVP yet.

Do NOT implement QR yet.

---

# Existing Architecture

Workspace

↓

Invitation

↓

Invitation Sections

↓

Theme Version

↓

Public Render

The Layered Architecture established during Sprint 3 remains mandatory.

---

# Mandatory Reading

Read:

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

Read the implementation memories from Sprint 3.

---

# Files Allowed

Create only:

```text
app/modules/Invitation/

    InvitationController.php

    InvitationService.php

    InvitationModel.php

    InvitationValidator.php

    routes.php
```

Create Views:

```text
app/views/invitation/

    edit.php

    preview.php
```

Modify:

```text
routes/couple.php
```

No other files.

---

# Functional Scope

Implement:

## Couple Dashboard

Invitation menu

↓

Edit Invitation

Fields:

* Bride Name
* Groom Name
* Wedding Date
* Wedding Time
* Venue
* Address
* Google Maps URL
* Story
* Cover Image
* Hero Quote

---

Theme

Select Theme Version

(Default:

Klasik Putih)

---

Status

Draft

Published

---

Preview

Render preview using current theme.

No public URL yet.

---

# Controller

Controller remains thin.

No SQL.

No business logic.

---

# Service

Owns business rules.

Publication state.

Validation flow.

Theme selection.

---

# Model

Owns every PDO query.

Prepared statements only.

Workspace isolation mandatory.

---

# Validator

Validate:

Date

Time

URL

Required fields

Lengths

No database writes.

---

# Security

Workspace isolation.

Prepared SQL.

escape_html()

CSRF

No XSS.

---

# Constraints

Do NOT:

* implement Guest
* implement RSVP
* implement QR
* implement WhatsApp
* implement Public URL
* implement Check-in
* modify app/core/*
* modify Workspace module
* modify Auth module
* modify database schema

---

# Verification

Verify:

Controller thin.

Service owns business rules.

Model owns SQL.

Preview renders.

Draft saves.

Publish updates status.

Workspace isolation works.

PHP syntax passes.

---

# Output

Provide:

1. Files created.
2. Files modified.
3. Invitation workflow.
4. Publication workflow.
5. Theme workflow.
6. Security verification.
7. Acceptance checklist.
8. PHP syntax results.

Stop after implementation.

Wait for Human Approval.
