mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-18 23:39:34 +00:00
Full-stack AI-powered sales automation platform for Saudi SMEs: Backend (FastAPI + PostgreSQL): - Multi-tenant architecture with row-level isolation - JWT auth with RBAC (owner/manager/agent/admin) - Lead, Customer, Deal, Pipeline, Activity, Message, Proposal models - Dashboard analytics API (overview, pipeline, revenue) - WhatsApp Business API, Email (SMTP/SendGrid), SMS (Unifonic) integrations - Celery + Redis workers for automated follow-ups and scheduled messages - Property model for Real Estate module (Riyadh districts) - Hijri date utilities, Arabic/English localization Frontend (Next.js + Tailwind): - Professional Arabic RTL landing page with 10 sections - Brand identity: SalesMatic (سيلزماتك) with custom SVG logo - Color system: Trust Blue #0F4C81, Growth Teal #00BFA6, CTA Orange #FF6B35 - IBM Plex Sans Arabic + Inter typography - Responsive design, dark hero section, pricing table, FAQ Industry Templates: - Healthcare/Clinics: pipeline stages, WhatsApp message templates, auto-workflows - Real Estate Riyadh: 20 districts, property tours, payment plans, matching Infrastructure: - Docker Compose (PostgreSQL, Redis, Backend, Celery, Frontend, Nginx) - Nginx reverse proxy config - Makefile for common operations https://claude.ai/code/session_01LLR7jzpyNRwDA9kojtT3CW
30 lines
1.4 KiB
Python
30 lines
1.4 KiB
Python
from sqlalchemy import Column, String, Integer, Text, DateTime, Date, ForeignKey, Numeric
|
|
from sqlalchemy.dialects.postgresql import UUID
|
|
from sqlalchemy.orm import relationship
|
|
from datetime import datetime, timezone
|
|
from app.models.base import TenantModel
|
|
|
|
|
|
class Deal(TenantModel):
|
|
__tablename__ = "deals"
|
|
|
|
lead_id = Column(UUID(as_uuid=True), ForeignKey("leads.id"), nullable=True)
|
|
customer_id = Column(UUID(as_uuid=True), ForeignKey("customers.id"), nullable=True)
|
|
assigned_to = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
|
|
title = Column(String(255), nullable=False)
|
|
value = Column(Numeric(12, 2))
|
|
currency = Column(String(3), default="SAR")
|
|
stage = Column(String(50), default="new") # new, negotiation, proposal, closed_won, closed_lost
|
|
probability = Column(Integer, default=0)
|
|
expected_close_date = Column(Date)
|
|
closed_at = Column(DateTime(timezone=True))
|
|
notes = Column(Text)
|
|
updated_at = Column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc), onupdate=lambda: datetime.now(timezone.utc))
|
|
|
|
tenant = relationship("Tenant", back_populates="deals")
|
|
lead = relationship("Lead", back_populates="deals")
|
|
customer = relationship("Customer")
|
|
assigned_user = relationship("User", foreign_keys=[assigned_to])
|
|
activities = relationship("Activity", back_populates="deal")
|
|
proposals = relationship("Proposal", back_populates="deal")
|