# CRM Service — Sales CRM

> Phase 6.3 collaboration complete. **CRM Core Platform** (6.0–6.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)
