NPC shop implimented
This commit is contained in:
@@ -421,7 +421,7 @@ class SessionService:
|
||||
from the database. Use this when the user wants to free up their session
|
||||
slot and doesn't need to preserve the game history.
|
||||
|
||||
Also deletes all chat messages associated with this session.
|
||||
Also deletes all chat messages and shop transactions associated with this session.
|
||||
|
||||
Args:
|
||||
session_id: Session ID to delete
|
||||
@@ -439,7 +439,15 @@ class SessionService:
|
||||
# Verify ownership first (raises SessionNotFound if invalid)
|
||||
self.get_session(session_id, user_id)
|
||||
|
||||
# Delete associated chat messages first
|
||||
# Delete associated shop transactions first
|
||||
from app.services.shop_service import get_shop_service
|
||||
shop_service = get_shop_service()
|
||||
deleted_transactions = shop_service.delete_transactions_by_session(session_id)
|
||||
logger.info("Deleted associated transactions",
|
||||
session_id=session_id,
|
||||
transaction_count=deleted_transactions)
|
||||
|
||||
# Delete associated chat messages
|
||||
chat_service = get_chat_message_service()
|
||||
deleted_messages = chat_service.delete_messages_by_session(session_id)
|
||||
logger.info("Deleted associated chat messages",
|
||||
|
||||
Reference in New Issue
Block a user