refactor(prospecting): migrate SVC-006 transaction control to endpoint level
Some checks failed
Some checks failed
Move db.commit() from services to API endpoints and Celery tasks. Services now use db.flush() only; endpoints own the transaction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,8 +38,7 @@ class InteractionService:
|
||||
created_by_user_id=user_id,
|
||||
)
|
||||
db.add(interaction)
|
||||
db.commit()
|
||||
db.refresh(interaction)
|
||||
db.flush()
|
||||
logger.info("Interaction logged for prospect %d: %s", prospect_id, data["interaction_type"])
|
||||
return interaction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user