Data Model
Quinn’s data model is built around these core entities:Key Entities
Organization
The top-level tenant in Quinn’s multi-tenant architecture. Every user, customer, and record belongs to exactly one organization. Key Fields:- Business information (name, address, phone, email, website)
- Business hours and timezone
- Feature toggles and AI settings
- Integration credentials (Twilio, Aircall, etc.)
Contacts (Unified System)
Quinn is transitioning to a unified contact system that consolidates customers, leads, and unknown contacts into one table.
customer- Paying customer with transaction historylead- Sales prospect not yet convertedunknown- Contact created from inbound communication (call, email) without known status
- Name, email, phone
- Company affiliation
- Owner (assigned team member)
- Last contact date
- Lifecycle status
Customers (Legacy)
Represents equipment rental customers. Key Fields:- Customer name, contact info
- Billing address
- Company association
- Lifetime order value (calculated)
- Owner assignment
Leads (Legacy)
Sales prospects at various stages of qualification. Lead Statuses:new- Just discovered/importedcontacted- Initial outreach madequalified- Meets criteria, shows interestnegotiation- Active deal discussionconverted- Became a customerlost- Not interested / bad fit
- Google rating (if business)
- Review count
- Website quality
- Contact information completeness
- Business keywords
Companies
B2B accounts representing contractor firms, construction companies, etc. Key Fields:- Company name, website
- Industry, employee count, revenue
- Google Places ID
- Enrichment data from Ocean.io
- Service areas
- Created from Google Places search OR
- Linked to contact/lead with company name
- Ocean.io enrichment adds firmographic data
- AI analysis of website for sales intelligence
Opportunities
Deals in your sales pipeline. Key Fields:- Associated contact/customer
- Pipeline stage
- Estimated value
- Win probability (0-100%)
- Expected close date
- Products/line items
- Created manually or AI-generated from conversation
- Moves through custom pipeline stages
- AI predicts revenue potential
- Stage drift detection alerts on stagnant deals
- Won → Creates transaction OR Lost → Archives
Tasks
Action items for team members. Sources:- Manual creation by users
- AI extraction from voice memos
- AI extraction from call transcripts
- AI generation from opportunities
- Automated from workflows
- Title, description
- Assigned user
- Associated contact/customer/opportunity
- Priority (low, medium, high)
- Due date
isAiGeneratedflag
Inventory
Equipment catalog with pricing. Key Fields:- Item name, number, category
- Daily/weekly/monthly rental rates
- Quantity available
- Specifications
- Image URL
Transactions
Rental orders/invoices. Key Fields:- Customer
- Order date, return date
- Line items (inventory × quantity × days)
- Total amount
- Status (pending, completed, cancelled)
Activities
Communication log across all channels. Types:call- Voice calls (inbound/outbound)email- Email messages (sent/received)sms- SMS messagesmeeting- Calendar events
- Associated contact
- Type, direction (inbound/outbound)
- Timestamp
- Transcript/body
- Sentiment analysis
- Source (user, AI, webhook)
Core Workflows
Lead → Customer Conversion
AI Task Extraction
Email Auto-Link
When an email arrives via webhook:- Find Contact by email address
- If found: Link email to contact, log activity
- If not found: Create new contact with
status='unknown' - Auto-subscribe contact to email sync
- AI Analysis: Extract sentiment, generate summary
- Notifications: Alert assigned owner
Multi-Tenant Architecture
How Tenant Isolation Works
How Tenant Isolation Works
Every database table includes Query Pattern:Route Pattern:Security Guarantees:
organizationId foreign key:- ✅ No cross-organization data access
- ✅ Foreign key constraints prevent orphaned records
- ✅ TypeScript enforces organizationId parameters
- ✅ Database indexes optimize tenant queries
Pagination
All list endpoints support pagination:- Page: 1
- Limit: 50 (max 100)
Filtering & Search
Most endpoints support filtering:Sorting
UsesortBy and sortOrder:
createdAt,updatedAtname,emaillifetimeOrders(customers)expectedCloseDate(opportunities)
Webhooks
Quinn sends webhooks for real-time events: Event Types:lead.createdlead.convertedopportunity.createdopportunity.stage_changedtask.createdtask.completedcall.receivedemail.received
AI Features
Task Extraction
Automatically creates tasks from:- Voice call transcripts
- Voice memo recordings
- Email content
- Meeting notes
- Content sent to GPT-4
- AI identifies action items
- Tasks created with:
- Priority assignment
- Due date suggestion
- Owner recommendation (based on context)
- Links to source (voiceMemo, email, etc.)
Lead Scoring
AI scores leads 0-7 based on:- Business signals (Google rating, reviews, website)
- Contact quality (email, phone availability)
- Firmographic (industry, size, location)
- Behavioral (engagement, response rate)
- 6-7: Hot leads (auto-enrich with LeadMagic)
- 4-5: Warm leads
- 2-3: Cold leads
- 0-1: Poor fit
Revenue Prediction
For opportunities, AI predicts:- Likely close amount
- Win probability
- Expected close date
- Recommended next steps
- Historical deal data
- Customer transaction history
- Stage conversion rates
- Seasonality patterns
Best Practices
Use Contacts, Not Customers/Leads
The unified Contact system is the future. Start using
status field instead of separate tables.Let AI Do the Work
Enable AI task extraction and lead scoring. Your team will thank you.
Automate Email Sync
All contacts with emails are auto-subscribed to 2-way sync. Never manually log emails.
Use Bulk Imports
CSV upload for initial data, Snowflake for ongoing syncs, Browse AI for prospecting.
Ready to start building? Check out the API Reference or explore Integration Guides.