Outreach Schema
The outreach schema contains 2 tables for public-facing engagement: newsletter subscriptions and contact form inquiries.
Schema: outreachDefined in: packages/core/src/models/schemas/outreach/
Entity Relationship Diagram
Tables
Subscriber
Newsletter subscription records with token-based unsubscribe.
Source: packages/core/src/models/schemas/outreach/subscriber/schema.ts
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | text | No | Snowflake | Primary key |
email | text | No | — | Subscriber email (unique) |
locale | text | No | 'vi' | Preferred language |
topics | jsonb | No | ['all'] | Subscribed topic tags |
status | text | No | ACTIVATED | Subscription status |
unsubscribe_token | text | No | Snowflake | Token for unsubscribe link |
subscribed_at | timestamptz | No | now() | When subscribed |
unsubscribed_at | timestamptz | Yes | — | When unsubscribed |
created_at | timestamptz | No | now() | Record creation |
modified_at | timestamptz | No | now() | Last modification |
deleted_at | timestamptz | Yes | — | Soft delete |
Indexes:
| Name | Columns | Type |
|---|---|---|
UQ_Subscriber_email | email | Unique |
IDX_Subscriber_status | status | Index |
IDX_Subscriber_unsubscribeToken | unsubscribe_token | Index |
Inquiry
Contact form submissions with lead tracking lifecycle.
Source: packages/core/src/models/schemas/outreach/inquiry/schema.ts
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | text | No | Snowflake | Primary key |
type | text | No | '000_CONSULT' | Inquiry type code |
status | text | No | NEW | Inquiry status |
first_name | text | No | — | Contact first name |
last_name | text | Yes | — | Contact last name |
email | text | No | — | Contact email |
phone | text | No | — | Contact phone |
business_name | text | Yes | — | Business name |
business_type | text | Yes | — | Business type/industry |
location_count | text | Yes | — | Number of business locations |
estimated_revenue | text | Yes | — | Estimated monthly revenue |
subject | text | Yes | — | Inquiry subject line |
message | text | Yes | — | Inquiry message body |
assigned_to | text | Yes | — | Assigned agent user ID |
replied_at | timestamptz | Yes | — | When agent replied |
replied_by | text | Yes | — | User ID of replier |
converted_at | timestamptz | Yes | — | When lead converted |
lost_reason | text | Yes | — | Reason for lost lead |
note | text | Yes | — | Internal notes |
created_at | timestamptz | No | now() | Record creation |
modified_at | timestamptz | No | now() | Last modification |
deleted_at | timestamptz | Yes | — | Soft delete |
Indexes:
| Name | Columns | Type |
|---|---|---|
IDX_Inquiry_type | type | Index |
IDX_Inquiry_status | status | Index |
IDX_Inquiry_email | email | Index |
Inquiry Type Codes
| Code | Description |
|---|---|
000_CONSULT | General consultation |
100_CONTACT | Contact form |
200_SALES | Sales inquiry |
300_DEMO | Demo request |
400_PARTNER | Partnership inquiry |
Related Documentation
- Outreach Service — Service using these schemas
- Migrations — Schema migration management