mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-18 15:29:36 +00:00
Phase 1 - Repo Hardening: - README.md, LICENSE, SECURITY.md, CONTRIBUTING.md - GitHub Actions repo-hygiene workflow - docs/: ARCHITECTURE, DATA-MODEL, API-MAP, AGENT-MAP, DEPLOYMENT-NOTES Phase 2 - Database Models (7 new): - Company, Contact, Call, Commission, Payout, Dispute, GuaranteeClaim - Consent, Complaint, Policy, KnowledgeArticle, SectorAsset - Updated models/__init__.py with all 32+ models Phase 3 - API Surfaces (16 new route files): - companies, contacts, calls, meetings, commissions, payouts - disputes, guarantees, consents, complaints, knowledge - sectors, presentations, supervisor, admin, health - Updated router.py with all 24 route groups Phase 4 - AI Prompt Registry (18 agent contracts): - Lead Qualification, Affiliate Recruitment Evaluator, Onboarding Coach - Outreach Writer, Arabic WhatsApp, English Conversation, Voice Call - Meeting Booking, Sector Strategist, Objection Handler - Proposal Drafter, QA Reviewer, Compliance Reviewer - Knowledge Retrieval, Revenue Attribution, Fraud Reviewer - Guarantee Claim Reviewer, Management Summary Phase 5 - Communication Templates: - 15 production templates (WhatsApp, email, voice, internal) - Arabic + English variants with variable interpolation Phase 6 - Compliance Center (7 legal docs): - Privacy policy, Terms of service, Refund policy - Commission policy, Affiliate rules, Consent policy, Data protection - All PDPL-compliant, Arabic Phase 7 - Celery Workers (fully implemented): - follow_up_tasks: automated lead follow-ups with workflow execution - message_tasks: WhatsApp/email/SMS with retry logic - notification_tasks: daily reports, meeting reminders, in-app notifications - affiliate_tasks: target checking, commission calculation, weekly reports, AI outreach Phase 8 - Knowledge Base OS (8 files): - Services overview, Pricing policy, Channel policy, Meeting policy - Identity rules, Escalation rules, Hiring path, Internal SOPs https://claude.ai/code/session_01KnJgK7RwyeCvRZTRThHtfU
86 lines
2.9 KiB
Python
86 lines
2.9 KiB
Python
import enum
|
|
from sqlalchemy import Column, String, Integer, Text, DateTime, Boolean, Enum, ForeignKey
|
|
from sqlalchemy.dialects.postgresql import UUID, JSONB
|
|
from sqlalchemy.orm import relationship
|
|
from app.models.base import BaseModel
|
|
|
|
|
|
class ConsentChannel(str, enum.Enum):
|
|
WHATSAPP = "whatsapp"
|
|
SMS = "sms"
|
|
EMAIL = "email"
|
|
VOICE = "voice"
|
|
ALL = "all"
|
|
|
|
|
|
class ConsentStatus(str, enum.Enum):
|
|
OPTED_IN = "opted_in"
|
|
OPTED_OUT = "opted_out"
|
|
PENDING = "pending"
|
|
|
|
|
|
class ComplaintType(str, enum.Enum):
|
|
SERVICE = "service"
|
|
BILLING = "billing"
|
|
PRIVACY = "privacy"
|
|
AFFILIATE = "affiliate"
|
|
OTHER = "other"
|
|
|
|
|
|
class ComplaintStatus(str, enum.Enum):
|
|
RECEIVED = "received"
|
|
INVESTIGATING = "investigating"
|
|
RESOLVED = "resolved"
|
|
ESCALATED = "escalated"
|
|
|
|
|
|
class Consent(BaseModel):
|
|
__tablename__ = "consents"
|
|
|
|
tenant_id = Column(UUID(as_uuid=True), nullable=True, index=True)
|
|
lead_id = Column(UUID(as_uuid=True), ForeignKey("leads.id"), nullable=True)
|
|
customer_id = Column(UUID(as_uuid=True), ForeignKey("customers.id"), nullable=True)
|
|
contact_phone = Column(String(20), nullable=True, index=True)
|
|
contact_email = Column(String(255), nullable=True)
|
|
channel = Column(Enum(ConsentChannel), nullable=False)
|
|
status = Column(Enum(ConsentStatus), default=ConsentStatus.PENDING, nullable=False)
|
|
opted_in_at = Column(DateTime(timezone=True), nullable=True)
|
|
opted_out_at = Column(DateTime(timezone=True), nullable=True)
|
|
source = Column(String(100), nullable=True)
|
|
ip_address = Column(String(45), nullable=True)
|
|
metadata = Column(JSONB, default={})
|
|
|
|
lead = relationship("Lead")
|
|
customer = relationship("Customer")
|
|
|
|
|
|
class Complaint(BaseModel):
|
|
__tablename__ = "complaints"
|
|
|
|
tenant_id = Column(UUID(as_uuid=True), nullable=True, index=True)
|
|
complainant_name = Column(String(255), nullable=False)
|
|
complainant_phone = Column(String(20), nullable=True)
|
|
complainant_email = Column(String(255), nullable=True)
|
|
type = Column(Enum(ComplaintType), nullable=False)
|
|
status = Column(Enum(ComplaintStatus), default=ComplaintStatus.RECEIVED, nullable=False)
|
|
subject = Column(String(255), nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
resolution = Column(Text, nullable=True)
|
|
assigned_to = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
|
|
resolved_at = Column(DateTime(timezone=True), nullable=True)
|
|
|
|
assigned_user = relationship("User")
|
|
|
|
|
|
class Policy(BaseModel):
|
|
__tablename__ = "policies"
|
|
|
|
key = Column(String(100), unique=True, nullable=False, index=True)
|
|
title = Column(String(255), nullable=False)
|
|
title_ar = Column(String(255), nullable=True)
|
|
content = Column(Text, nullable=False)
|
|
content_ar = Column(Text, nullable=True)
|
|
version = Column(Integer, default=1)
|
|
is_active = Column(Boolean, default=True)
|
|
published_at = Column(DateTime(timezone=True), nullable=True)
|