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>
87 lines
3.4 KiB
Markdown
87 lines
3.4 KiB
Markdown
# Event Catalog
|
||
|
||
Canonical event types. Envelope rules: [event-driven-architecture.md](../architecture/event-driven-architecture.md).
|
||
|
||
## Core Platform
|
||
|
||
| event_type | aggregate | Description |
|
||
| --- | --- | --- |
|
||
| `tenant.created` | tenant | New tenant created |
|
||
| `tenant.suspended` | tenant | Tenant suspended |
|
||
| `tenant.activated` | tenant | Tenant activated |
|
||
| `domain.created` | domain | Domain added |
|
||
| `subscription.created` | subscription | Subscription created |
|
||
| `subscription.updated` | subscription | Subscription changed |
|
||
| `feature_access.changed` | feature_access | Entitlement override/plan effect changed |
|
||
|
||
## Identity & Access
|
||
|
||
| event_type | Description |
|
||
| --- | --- |
|
||
| `user.registered` | New user registered |
|
||
| `tenant_member.added` | Member added (identity layer) |
|
||
| `tenant_member.removed` | Member removed (identity layer) |
|
||
|
||
## Accounting (Phases 5.1–5.6)
|
||
|
||
| event_type | Description |
|
||
| --- | --- |
|
||
| `voucher.created` | Voucher drafted |
|
||
| `voucher.validated` | Voucher passed validation |
|
||
| `voucher.posted` | Voucher posted to ledger |
|
||
| `voucher.reversed` | Voucher reversed |
|
||
| `journal_entry.created` | Journal entry created via Posting Engine |
|
||
| `posting.completed` | Posting operation succeeded |
|
||
| `ledger.updated` | General ledger updated |
|
||
| `trial_balance.generated` | Trial balance snapshot created |
|
||
| `fiscal_period.locked` | Fiscal period locked |
|
||
| `cash.received` | Cash receipt recorded |
|
||
| `settlement.completed` | AR/AP settlement completed |
|
||
| `sales_invoice.posted` | Sales invoice accounting posted |
|
||
| `revenue.recognized` | Revenue recognition recorded |
|
||
|
||
Full list: `backend/services/accounting/app/events/types.py`
|
||
|
||
## CRM (Phases 6.0–6.1)
|
||
|
||
| event_type | Description |
|
||
| --- | --- |
|
||
| `crm.lead.created` | Lead created |
|
||
| `crm.lead.updated` | Lead updated |
|
||
| `crm.contact.created` | Contact created |
|
||
| `crm.organization.created` | Organization created |
|
||
| `crm.opportunity.created` | Opportunity created |
|
||
| `crm.opportunity.updated` | Opportunity updated |
|
||
| `crm.opportunity.won` | Opportunity marked won |
|
||
| `crm.opportunity.lost` | Opportunity marked lost |
|
||
| `crm.pipeline.changed` | Pipeline updated |
|
||
| `crm.stage.changed` | Opportunity stage changed |
|
||
| `crm.playbook.assigned` | Sales playbook assigned |
|
||
| `crm.playbook.completed` | Playbook assignment completed |
|
||
| `crm.forecast.updated` | Sales forecast computed/updated |
|
||
| `crm.activity.completed` | Sales activity completed |
|
||
| `crm.task.completed` | Sales task completed |
|
||
| `crm.meeting.finished` | Meeting finished |
|
||
| `crm.call.logged` | Call logged against opportunity |
|
||
| `crm.timeline.updated` | Sales timeline entry appended |
|
||
| `crm.comment.created` | Collaboration comment created |
|
||
| `crm.mention.created` | User mentioned in CRM collaboration |
|
||
| `crm.quote.created` | Sales quote created |
|
||
| `crm.note.created` | CRM note created |
|
||
| `crm.attachment.added` | Attachment reference added |
|
||
|
||
Full list: `backend/services/crm/app/events/types.py`
|
||
|
||
## Future (reserved)
|
||
| Restaurant | `order.placed`, `order.completed` |
|
||
| Ecommerce | `order.placed`, `product.updated` |
|
||
| Notification | `notification.delivered` |
|
||
|
||
When adding events: update this catalog, module registry producers/consumers, and contracts in the same phase.
|
||
|
||
## Related Documents
|
||
|
||
- [Services Contracts](services-contracts.md)
|
||
- [ADR-006](../architecture/adr/ADR-006.md)
|
||
- [Module Registry](../module-registry.md)
|