forked from erp-dev/erp
22 lines
636 B
Python
22 lines
636 B
Python
"""business domain signals.
|
|
|
|
We use domain-level signals (instead of model post_save) to:
|
|
- keep semantics clean (only fire on business "create" flow)
|
|
- allow passing explicit actor (created_by / operator)
|
|
- keep integrations in handlers
|
|
|
|
NOTE:
|
|
Signals should be triggered via transaction.on_commit to avoid firing when a
|
|
transaction rolls back.
|
|
"""
|
|
|
|
from django.dispatch import Signal
|
|
|
|
# Fired when a PreSalesOrder (and its items) is created via service layer.
|
|
# Payload:
|
|
# - instance: PreSalesOrder
|
|
# - created_by: Django User (may be None)
|
|
# - operator: Employee (may be None)
|
|
# - items_count: int
|
|
pre_sales_order_created = Signal()
|