leadguru-jobs 0.527.0__py3-none-any.whl → 0.529.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {leadguru_jobs-0.527.0.dist-info → leadguru_jobs-0.529.0.dist-info}/METADATA +1 -1
- {leadguru_jobs-0.527.0.dist-info → leadguru_jobs-0.529.0.dist-info}/RECORD +5 -5
- lgt_jobs/lgt_data/mongo_repository.py +36 -1
- {leadguru_jobs-0.527.0.dist-info → leadguru_jobs-0.529.0.dist-info}/WHEEL +0 -0
- {leadguru_jobs-0.527.0.dist-info → leadguru_jobs-0.529.0.dist-info}/top_level.txt +0 -0
@@ -43,11 +43,11 @@ lgt_jobs/lgt_data/engine.py,sha256=YJYEAj1Z4_XIhPMaoB7bp8x9ponANBzw7gZRrj6c-c4,8
|
|
43
43
|
lgt_jobs/lgt_data/enums.py,sha256=p54wjKBWz8behNZGnfsPI-sq9ELwbk9HlP7t3N9USuA,2471
|
44
44
|
lgt_jobs/lgt_data/helpers.py,sha256=NDa-V5EYaJfkGoWsmQSwSe6N_jxNxs8tHRQzW1iST6k,480
|
45
45
|
lgt_jobs/lgt_data/model.py,sha256=ZXJHbsQ-BgH09o9siw5yqKNWqQSymsOQ5HH8nKFeACQ,29312
|
46
|
-
lgt_jobs/lgt_data/mongo_repository.py,sha256=
|
46
|
+
lgt_jobs/lgt_data/mongo_repository.py,sha256=gx_uUl31xDu5-U5YBg5eRLEgYgUxX5SX8YKCtIF5rx8,48975
|
47
47
|
lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
48
48
|
lgt_jobs/services/web_client.py,sha256=GLWsJkIC8rv6xLFaLwcMm4EwBlVDu0njORwkZqBJaE4,2086
|
49
49
|
lgt_jobs/templates/new_message.html,sha256=BD_E90akmQ1Wf07wtZAjeK_7DUKRmja5HFHVo_AKI24,6994
|
50
|
-
leadguru_jobs-0.
|
51
|
-
leadguru_jobs-0.
|
52
|
-
leadguru_jobs-0.
|
53
|
-
leadguru_jobs-0.
|
50
|
+
leadguru_jobs-0.529.0.dist-info/METADATA,sha256=3KOADwN6KycvgaoHKGfPvU7HOwxSw2hzvLITH_iCqSA,1319
|
51
|
+
leadguru_jobs-0.529.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
52
|
+
leadguru_jobs-0.529.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
|
53
|
+
leadguru_jobs-0.529.0.dist-info/RECORD,,
|
@@ -1156,6 +1156,41 @@ class UserContactsRepository(BaseMongoRepository):
|
|
1156
1156
|
contacts_groups[doc['source_id']] = [UserContact.from_dic(contact) for contact in doc['contacts']]
|
1157
1157
|
return contacts_groups
|
1158
1158
|
|
1159
|
+
def find_actual_contacts_users(self, days: int = 90):
|
1160
|
+
pipeline = [
|
1161
|
+
{
|
1162
|
+
'$lookup': {
|
1163
|
+
'from': 'user_leads',
|
1164
|
+
'as': 'leads',
|
1165
|
+
'let': {'user_id': '$user_id', 'sender_id': '$sender_id'},
|
1166
|
+
'pipeline': [
|
1167
|
+
{'$sort': {'last_action_at': -1}},
|
1168
|
+
{
|
1169
|
+
'$match': {
|
1170
|
+
'$expr': {
|
1171
|
+
'$and': [
|
1172
|
+
{'$eq': ['$$sender_id', '$message.sender_id']},
|
1173
|
+
{'$eq': ['$$user_id', '$user_id']}
|
1174
|
+
]
|
1175
|
+
}
|
1176
|
+
}
|
1177
|
+
},
|
1178
|
+
{'$limit': 1}
|
1179
|
+
]
|
1180
|
+
}
|
1181
|
+
},
|
1182
|
+
{
|
1183
|
+
'$match': {'leads.last_action_at': {'$gte': datetime.now(UTC) - timedelta(days)}}
|
1184
|
+
},
|
1185
|
+
{
|
1186
|
+
'$group': {'_id': '$user_id'}
|
1187
|
+
}
|
1188
|
+
]
|
1189
|
+
user_ids = []
|
1190
|
+
for doc in list(self.collection().aggregate(pipeline)):
|
1191
|
+
user_ids.append(doc['_id'])
|
1192
|
+
return user_ids
|
1193
|
+
|
1159
1194
|
|
1160
1195
|
class TeamRepository(BaseMongoRepository):
|
1161
1196
|
collection_name = 'teams'
|
@@ -1289,4 +1324,4 @@ class SubscriptionsRepository(BaseMongoRepository):
|
|
1289
1324
|
if expired is not None:
|
1290
1325
|
pipeline['expired'] = expired
|
1291
1326
|
|
1292
|
-
return Subscription.from_dic(self.collection().find_one(pipeline))
|
1327
|
+
return Subscription.from_dic(self.collection().find_one(pipeline))
|
File without changes
|
File without changes
|