system-prompts-and-models-o.../salesflow-saas/memory/adr/001-multi-tenant.md
Claude a329957a3b
feat: Add AI engine, PDPL compliance, sequences, CPQ, and governance layers
Phase 1-6 implementation for Dealix AI Revenue OS:

- AI Arabic Engine: NLP (arabic_nlp.py), lead scoring (lead_scoring.py)
- PDPL Compliance: consent manager, data rights handler, consent model
- Sequence Engine: multi-channel sequences with WhatsApp/Email/SMS
- CPQ System: quote engine, AI proposal generator
- Security Gate: pre-release checks, PDPL message validation
- Tool Verification: agent action audit trail
- Project Operating Files: AGENTS.md, CLAUDE.md
- Project Memory: architecture, ADRs, provider routing, PDPL checklist
- Design System: IBM Plex Sans Arabic tokens, RTL-safe components
- Sequence/Consent models for database

https://claude.ai/code/session_01LsnvBa7HwF5hs99VZbgLGj
2026-04-11 07:40:39 +00:00

24 lines
841 B
Markdown

# ADR-001: Multi-Tenant Data Isolation
**Status**: accepted
**Date**: 2026-03-28
**Decision**: Row-level tenant isolation with tenant_id on every table
## Context
Dealix serves multiple Saudi SMBs. Each company's data must be completely isolated.
## Decision
Use row-level isolation with `tenant_id` foreign key on every data table. All queries filter by tenant_id automatically.
## Rationale
- Simpler than schema-per-tenant for our scale (< 10K tenants initially)
- Lower operational cost (single database)
- Easier migrations
- Good enough isolation for SMB CRM data
## Consequences
- Must enforce tenant_id in every query (risk of data leak if missed)
- Use SQLAlchemy query filters/middleware to auto-add tenant_id
- Performance monitoring needed as tenant count grows
- Future: consider schema-per-tenant for enterprise customers