(20241217) payment reference will now be the same as the payment id.

This commit is contained in:
2024-12-17 15:57:13 +05:30
parent d24d9cc248
commit 2e0c0224d4
15 changed files with 93 additions and 69 deletions
+2 -12
View File
@@ -302,14 +302,12 @@ class CoreMessageController(BaseModel):
async def get_message(
self,
mongo_conn: AsyncMongo,
token_id: ObjectId | str,
message_id: ObjectId | str,
) -> CoreMessageModel | None:
"""
Gets one message if you know its message id.
:param mongo_conn: The instance of the database connector to use for the operation.
:param token_id: The id of the auth-token associated with the message. Needed for security.
:param message_id: The id of the message that needs to be read.
:return: The contents of that one message in a structured format.
"""
@@ -317,10 +315,7 @@ class CoreMessageController(BaseModel):
# We fetch the whole payload of that one message:
record = await mongo_conn.find_one(
collection = self.MESSAGES_COLLECTION,
filter = {
"_id": ObjectId(message_id),
"tokenId": ObjectId(token_id)
},
filter = {"_id": ObjectId(message_id)},
raise_exception = True
)
@@ -342,7 +337,6 @@ class CoreMessageController(BaseModel):
async def update_tags(
self,
mongo_conn: AsyncMongo,
token_id: ObjectId | str,
message_id: ObjectId | str,
unset_tags: List[str] = None,
set_tags: List[str] = None
@@ -351,7 +345,6 @@ class CoreMessageController(BaseModel):
"""
Updates the tags on one message. The tags to remove are processed first, the ones to add are processed later.
:param mongo_conn: The instance of the database connector to use for the operation.
:param token_id: The id of the auth-token associated with the message. Needed for security.
:param message_id: The id of the message that needs to be read.
:param unset_tags: The tags to remove from the message.
:param set_tags: The tags to add to the message.
@@ -361,10 +354,7 @@ class CoreMessageController(BaseModel):
# Update the tags:
return await mongo_conn.update_one(
collection = self.MESSAGES_COLLECTION,
filter = {
"_id": ObjectId(message_id),
"tokenId": ObjectId(token_id)
},
filter = {"_id": ObjectId(message_id)},
update = [{
"$set": {
"tags": {