TorbatYar/backend/services/crm/README.md
Mortezakoohjani 064d67f099 Ship CRM Core Platform (phases 6.0–6.3) with docs and prod deploy.
Add the Sales CRM service through collaboration, sync architecture/registry docs, expose crm.torbatyar.ir, and include a production deploy script.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 20:32:00 +03:30

75 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CRM Service — Sales CRM
> Phase 6.3 collaboration complete. **CRM Core Platform** (6.06.3) Active.
Sales CRM only. CRM does **not** own Automation, Customer360, Marketing,
Notification delivery, Messaging, Communication, Helpdesk, Analytics, AI,
Identity, Accounting, Inventory, Restaurant, Marketplace, Files, or Search.
## Ownership
| Owns | Does not own |
| --- | --- |
| Lead, Contact, Organization | Workflow / Automation |
| Opportunity, Pipeline, Playbooks, Forecasts | Customer360 |
| Activities, Tasks, Meetings, Calls, Timeline | Notification delivery |
| Comments, Mentions, Bookmarks, Sales Team | Communication / Helpdesk |
| Quotes, Tags, Notes, Attachment refs, Audit | Analytics / AI / Inventory |
## Boundaries
- Independent database: `crm_db` (ADR-001)
- Row-level tenancy via `tenant_id` from request context (ADR-003)
- Inter-service communication: REST + Events only
- Platform providers are **contracts only** under `app/providers/`
- Timeline entries are immutable; email/call recording refs only
## Structure
```
app/
api/v1/ # CRM HTTP APIs only
models/ # foundation + supporting + sales_engine + collaboration
repositories/
services/
validators/
schemas/
events/
permissions/
providers/
tests/
alembic/versions/0001_initial.py
alembic/versions/0002_phase_61_entities.py
alembic/versions/0003_phase_62_sales_engine.py
alembic/versions/0004_phase_63_collaboration.py
```
## API Prefix
`/api/v1` on port **8003**
See [crm-phase-6-3.md](../../../docs/crm-phase-6-3.md) for collaboration endpoints.
## Permissions
`crm.*` including `crm.activities.*`, `crm.tasks.*`, `crm.meetings.*`,
`crm.calls.*`, `crm.timeline.*`, `crm.comments.*`, `crm.mentions.*`, `crm.team.*`
## Run locally
```bash
cd backend/services/crm
pip install -r requirements.txt
pytest -q
uvicorn app.main:app --port 8003 --reload
```
## Related Documents
- [Phase 6.0](../../../docs/crm-phase-6-0.md)
- [Phase 6.1](../../../docs/crm-phase-6-1.md)
- [Phase 6.2](../../../docs/crm-phase-6-2.md)
- [Phase 6.3](../../../docs/crm-phase-6-3.md)
- [Module Registry](../../../docs/module-registry.md#crm)
- [Architecture](../../../docs/architecture/architecture.md)