forked from erp-dev/erp
feat: added custom signal for pre sales order created
This commit is contained in:
21
business/signals.py
Normal file
21
business/signals.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""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()
|
||||
Reference in New Issue
Block a user