# Sprint G006 — Guest & Invitation Engine

## Objective

The Media Engine (G004) and Image Processing Engine (G005) have already been completed.

Do NOT redesign or replace any existing architecture.

Your responsibility is to review the existing Invitation architecture, then extend it into a complete Guest & Invitation Engine.

This sprint establishes the foundation for:

- Personalized Invitation URLs
- Personalized Guest Invitations
- QR Attendance
- WhatsApp Sharing
- Analytics
- RSVP
- Reminder System

Future sprints will depend on this architecture.

---

# Phase 1 — Architecture Review (Mandatory)

Before writing any code, review the current implementation.

Analyze:

- Invitation module
- Invitation Builder
- Database schema
- Routing
- Models
- Controllers
- Existing Media integration
- Existing JSON configuration
- Existing authentication & permissions

Determine whether the current architecture is suitable.

If it already is:

Extend it.

Do NOT redesign it.

Only introduce changes when there is a clear architectural benefit.

---

# Objective

Each Couple can create multiple Guest Invitations.

Example:

Couple

David & Nathasya

Guests

- Timoty
- Michael
- Family Budi
- Family Jonathan

Each Guest represents one personalized invitation.

---

# Guest Information

Each Guest should support at minimum:

- Guest Name
- Honorific / Prefix (optional)
- Category (Family, Friend, VIP, etc.)
- Number of Seats (optional)
- Notes (optional)
- Invitation Status
- RSVP Status (future)
- Attendance Status (future)

The design should remain extensible.

---

# Invitation Code

Each Guest Invitation must receive its own unique Invitation Code.

Do NOT immediately decide the implementation.

Review the existing architecture first.

Determine whether:

- UUID
- Random code
- Short code
- Another strategy

is most appropriate.

Minimise breaking changes.

Future public URL should support a structure similar to:

/i/{couple_slug}/{invitation_code}

Only implement this if compatible with the existing architecture.

---

# Guest Management

Implement Guest Management inside the Couple Dashboard.

Capabilities:

- Create Guest
- Edit Guest
- Delete Guest
- Search Guest
- Filter Guest
- Pagination
- Copy Invitation Link
- Preview Invitation

Do not redesign the existing dashboard.

Integrate naturally.

---

# Public Invitation

Each Guest should represent one personalized invitation.

Future features should be able to retrieve:

- Couple
- Theme
- Media
- Guest Name
- Guest Settings

using the Guest Invitation.

Do not implement RSVP or Attendance yet.

Only prepare the architecture.

---

# Data Relationships

Review the existing database.

Determine the best relationship between:

Couple

↓

Invitation

↓

Guest

Preserve existing architecture whenever possible.

Avoid unnecessary duplication.

---

# Routing

Review current routes.

Extend only where necessary.

Maintain consistency with existing route naming.

---

# Controllers

Keep controllers thin.

Business logic belongs inside services.

Introduce new services only when appropriate.

---

# Models

Review current InvitationModel.

Determine whether:

- GuestModel
- InvitationGuestModel

or another structure

is more appropriate.

Explain the reasoning in the documentation.

---

# UI

Integrate Guest Management naturally into the existing Invitation Builder.

The interface should support:

- Guest List
- Search
- Pagination
- Add Guest
- Edit Guest
- Delete Guest
- Copy Link
- Preview

Do not redesign the overall layout.

---

# Security

Maintain all existing security protections.

Review:

- Authentication
- Authorization
- Input validation
- CSRF protection
- XSS protection
- SQL Injection prevention

Improve only if necessary.

---

# Future Compatibility

Design the architecture so future sprints can easily add:

- QR Download
- RSVP
- Attendance
- WhatsApp Blast
- Reminder System
- Analytics
- Guest Tags
- Bulk Import
- Bulk Export

without requiring another architectural refactor.

---

# Deliverables

Produce:

- Database migration(s) if required
- New models
- New services
- Updated controllers
- Updated views
- Updated routes
- Technical documentation

---

# Validation

Before completing the sprint:

- Verify every modified file
- Ensure no syntax errors
- Verify CRUD operations
- Verify search
- Verify pagination
- Verify backward compatibility
- Verify Media Engine compatibility
- Verify Image Processing compatibility

---

# Important

This sprint extends the existing Invitation architecture.

Do NOT redesign the application.

Prioritise:

- Clean Architecture
- Maintainability
- Scalability
- Backward Compatibility
- Minimal Breaking Changes

Always review the existing implementation before introducing new code.