(20250613) - whatsapp mongo log testing.

This commit is contained in:
yatmesh
2025-06-13 12:41:48 +05:30
parent 83a9c7cf89
commit 7f59105003
2 changed files with 24 additions and 3 deletions
+21 -1
View File
@@ -40,6 +40,7 @@ from utils_v2.date_time import date_time
from utils_v2.database.async_mysql_v2 import AsyncMySQL from utils_v2.database.async_mysql_v2 import AsyncMySQL
from utils_v2.database.async_mongo_v2 import AsyncMongo from utils_v2.database.async_mongo_v2 import AsyncMongo
from utils_v2.cache.async_redis_cache_v2 import AsyncRedisCache from utils_v2.cache.async_redis_cache_v2 import AsyncRedisCache
from utils_v2.logging.context import AsyncLoggerContext
# Controllers: # Controllers:
from controllers_v2.message.chat.base import ChatController from controllers_v2.message.chat.base import ChatController
@@ -65,6 +66,8 @@ import httpx
# For asynchronous activities: # For asynchronous activities:
import asyncio import asyncio
# Common:
from shared import constants
# ***************************************************************************************************************** # *****************************************************************************************************************
# ***** **** # ***** ****
@@ -153,7 +156,15 @@ class WhatsAppNimbusController(ChatController):
# ┗┓┏┓┏┓┏┫ ┃┃┃┏┓┏┏┏┓┏┓┏┓┏ # ┗┓┏┓┏┓┏┫ ┃┃┃┏┓┏┏┏┓┏┓┏┓┏
# ┗┛┗ ┛┗┗┻ ┛ ┗┗ ┛┛┗┻┗┫┗ ┛ # ┗┛┗ ┛┗┗┻ ┛ ┗┗ ┛┛┗┻┗┫┗ ┛
# ┛ # ┛
@AsyncLoggerContext.log_it(
api_version="1.0.0",
project=constants.PROJECT_NAME,
log_type=constants.MODULE_NAME,
operation="whatsappSendOne",
log_input=True,
log_output=True,
sensitive_keys=None
)
async def send_one_message( async def send_one_message(
self, self,
sql_conn: AsyncMySQL, sql_conn: AsyncMySQL,
@@ -221,6 +232,15 @@ class WhatsAppNimbusController(ChatController):
chatMessage = sent_message_model chatMessage = sent_message_model
) )
@AsyncLoggerContext.log_it(
api_version="1.0.0",
project=constants.PROJECT_NAME,
log_type=constants.MODULE_NAME,
operation="whatsappSendMany",
log_input=True,
log_output=True,
sensitive_keys=None
)
async def send_many_messages( async def send_many_messages(
self, self,
sql_conn: AsyncMySQL, sql_conn: AsyncMySQL,
+3 -2
View File
@@ -124,9 +124,10 @@ class NimbusWhatsAppMessage(BaseModel):
) )
# ---- ADDED BY OMKAR 2025-05-13 ---- # ---- ADDED BY OMKAR 2025-05-13 ----
waGroupId: str = Field( waGroupId: str | None = Field(
description="The Whatsapp group ID. of the target recipient(s) group", description="The Whatsapp group ID. of the target recipient(s) group",
frozen=True frozen=True,
default=None
) )
waGroupName: str | None = Field( waGroupName: str | None = Field(