Document FRE-645 waitlist schema completion

The waitlist/leads database schema was already implemented
and migrated in 0002_chemical_shocker.sql.

Created plan document at plans/FRE-645-waitlist-schema.md
with schema documentation and usage examples.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-26 06:36:17 -04:00
parent a638b23c85
commit 3d5ff8650c
2 changed files with 79 additions and 0 deletions

View File

@@ -98,6 +98,8 @@ Multiple issues are reverting to `blocked` state immediately after being unblock
- FRE-622 (Analytics Phase 4)
- FRE-623 (Analytics Phase 3)
**FRE-645 Completed:** Waitlist/leads database schema verified and documented.
**Current Pipeline Status:**
- **blocked:** 0 ✓
- **in_review:** 0

View File

@@ -0,0 +1,77 @@
# FRE-645: Waitlist/Leads Database Schema
## Status: COMPLETE
The waitlist/leads database schema was already implemented and migrated in migration `0002_chemical_shocker.sql`.
## Current Schema
### waitlist_signups Table
Stores lead/waitlist signup records:
```typescript
- id: integer (PK, auto-increment)
- email: text (NOT NULL, UNIQUE)
- name: text (nullable)
- source: text (NOT NULL, default: "organic")
- status: text (NOT NULL, default: "waitlist")
- metadata: text (nullable, JSON)
- createdAt: timestamp
- updatedAt: timestamp
```
### waitlist_events Table
Tracks engagement events for each signup:
```typescript
- id: integer (PK, auto-increment)
- signupId: integer (FK waitlist_signups.id)
- eventType: text (NOT NULL)
- eventData: text (nullable, JSON)
- createdAt: timestamp
```
## Schema Location
- Schema definition: `/src/db/schema/waitlist.ts`
- Exported in: `/src/db/schema/index.ts`
- Migration: `/src/db/migrations/0002_chemical_shocker.sql`
## Usage Examples
### Insert a new signup
```typescript
import { db } from "./config/migrations";
import { waitlistSignups } from "./schema";
await db.insert(waitlistSignups).values({
email: "user@example.com",
name: "John Doe",
source: "product-hunt",
status: "waitlist",
}).returning();
```
### Track an event
```typescript
import { waitlistEvents } from "./schema";
await db.insert(waitlistEvents).values({
signupId: 1,
eventType: "email_opened",
eventData: JSON.stringify({ campaign: "welcome" }),
});
```
## Next Steps
The schema is ready for use. No additional work needed unless new requirements emerge:
1. **API endpoints** - Create REST/tRPC endpoints for signup submission
2. **Admin dashboard** - Build UI for managing waitlist/leads
3. **Email integration** - Connect to email service provider for nurturing
4. **Analytics** - Track conversion metrics from waitlist to active users