fixed full deals

This commit is contained in:
2025-07-26 17:20:34 +03:00
parent 94b7585f8b
commit d25280f368

View File

@ -334,20 +334,32 @@ async def additional_deals_data(*deals: dict, full: bool):
async def get_all_summaries(full: bool): async def get_all_summaries(full: bool):
deals = await deals_collection.find({ if not full:
"$and": [ deals = await deals_collection.find({
{ "$and": [
"$or": [ {
{"isDeleted": False}, "$or": [
{"isDeleted": {"$exists": False}} {"isDeleted": False},
] {"isDeleted": {"$exists": False}}
}, ]
{ },
"$or": [ {
{"isCompleted": False}, "$or": [
{"isCompleted": {"$exists": False}} {"isCompleted": False},
] {"isCompleted": {"$exists": False}}
} ]
] }
}, {"_id": False}).sort("id", asc).to_list() ]
}, {"_id": False}).sort("id", asc).to_list()
else:
deals = await deals_collection.find({
"$and": [
{
"$or": [
{"isDeleted": False},
{"isDeleted": {"$exists": False}}
]
}
]
}, {"_id": False}).sort("id", asc).to_list()
return await additional_deals_data(*deals, full=full) return await additional_deals_data(*deals, full=full)