leadguru-jobs 0.658.0__py3-none-any.whl → 0.660.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: leadguru_jobs
3
- Version: 0.658.0
3
+ Version: 0.660.0
4
4
  Summary: LGT jobs builds
5
5
  Author-email: developer@leadguru.co
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -39,10 +39,10 @@ lgt_jobs/lgt_common/slack_client/web_client.py,sha256=WCu8mqYhauuxp9iDAMsjocchKD
39
39
  lgt_jobs/lgt_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  lgt_jobs/lgt_data/analytics.py,sha256=yfrFPXrBofzZqUNn479JkrbZXDa2ljgk-Le0YrQ9rew,21690
41
41
  lgt_jobs/lgt_data/engine.py,sha256=GY8FOl3dl7euKjQRML_H3ophaSTgfQ8ICMRv1NpE2oE,7745
42
- lgt_jobs/lgt_data/enums.py,sha256=si1DwMf4pOJYRYjz_c_SxmWxU5fBr8nN0kH4zFzNQ5Y,2338
42
+ lgt_jobs/lgt_data/enums.py,sha256=27Gd_o5QVCrSUMIfL0DJ72xV77T9fK0kYrOaC78O0SU,2292
43
43
  lgt_jobs/lgt_data/helpers.py,sha256=S_1P7pnx14dllmen-TzjA9pkKWQr39x8-v6iv7FUYnQ,423
44
44
  lgt_jobs/lgt_data/model.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
- lgt_jobs/lgt_data/mongo_repository.py,sha256=K5IHnd_w1Dsuhcrb2jL9F6YwnJ1Kr_W5_mAtDch8r2Y,55682
45
+ lgt_jobs/lgt_data/mongo_repository.py,sha256=ACUh3-pak2MHxwzBEa3kpDapJreJH2vwzZxxznAcwoU,55797
46
46
  lgt_jobs/lgt_data/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  lgt_jobs/lgt_data/models/base.py,sha256=YaiceCaaF45snOLx-bQoYJ1aTWrfgMQeHWjAaRnzGKE,592
48
48
  lgt_jobs/lgt_data/models/boards/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -75,7 +75,7 @@ lgt_jobs/lgt_data/models/leads/extended_lead.py,sha256=ezFrKv-f5GBXr3QAM-V_qJQ-i
75
75
  lgt_jobs/lgt_data/models/leads/lead.py,sha256=mTZh8YV06nX9OWYvv_X7rDdIperB-RPChrEuheeYMU0,1300
76
76
  lgt_jobs/lgt_data/models/leads/message.py,sha256=7mXwYfSpmhY_zC8TfUdAZzxsPP-02bOqVjdkN4Vid5s,1533
77
77
  lgt_jobs/lgt_data/models/notifications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
- lgt_jobs/lgt_data/models/notifications/notification.py,sha256=t923jbffz7l5lnVhoS5P2T8CRlfN0Q7xpo-fXG1uVUY,12787
78
+ lgt_jobs/lgt_data/models/notifications/notification.py,sha256=9g-Nz3a9MOo7q4cd6tHOeynRbSavsdn_CKCIDsfHZTU,12849
79
79
  lgt_jobs/lgt_data/models/notifications/notification_settings.py,sha256=VFddLvk2ROz4n50wYuZmqBDn7MssFwj-e9DbWweIVA4,2780
80
80
  lgt_jobs/lgt_data/models/people/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
81
  lgt_jobs/lgt_data/models/people/people.py,sha256=pm60uMVmNIxOGCBAtZWhmXSJOe0SJ4C1y_HurUq00oY,3420
@@ -103,7 +103,7 @@ lgt_jobs/lgt_data/repositories/post/posts.py,sha256=ZA19L-CYdxLhlapyMQtSJzP3QMUl
103
103
  lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
104
  lgt_jobs/services/web_client.py,sha256=oMyWJxwGeIe3f40fPT7xcisjDg3BhA3Ipf8dr1jVT-Y,1549
105
105
  lgt_jobs/templates/new_message.html,sha256=dZl8UmdAOOMq4nidvAgMFroSrTV7Pw0RWt2yLp_2idg,6989
106
- leadguru_jobs-0.658.0.dist-info/METADATA,sha256=a6aDoc-uEPzPdIp_pXgqXjgc3yAw-2IVNgP5dpHFFkw,1319
107
- leadguru_jobs-0.658.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
108
- leadguru_jobs-0.658.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
109
- leadguru_jobs-0.658.0.dist-info/RECORD,,
106
+ leadguru_jobs-0.660.0.dist-info/METADATA,sha256=E9aiya-du0zHCarlXP2C1bmorgbAkke2wP2OtLn50_s,1319
107
+ leadguru_jobs-0.660.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
108
+ leadguru_jobs-0.660.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
109
+ leadguru_jobs-0.660.0.dist-info/RECORD,,
@@ -97,4 +97,3 @@ class NotificationType(str, Enum):
97
97
  ONCE_A_WEEK = 'once_a_week'
98
98
  WEEK_BEFORE = 'week_before'
99
99
  UNREAD_FOR_FEW_MINUTES = 'unread_for_few_minutes'
100
- FEW_MINUTES_BEFORE = 'few_minutes_before'
@@ -37,7 +37,7 @@ class Notification(DictionaryModel):
37
37
  return False
38
38
 
39
39
  if ((self.type == NotificationType.ONCE_A_DAY or self.type == NotificationType.ONCE_A_WEEK)
40
- and now.hour != self.hour and now.minute < self.minute):
40
+ and (now.hour != self.hour or now.minute < self.minute)):
41
41
  return False
42
42
 
43
43
  if ((self.type == NotificationType.ONCE_A_DAY or self.type == NotificationType.ONCE_A_WEEK)
@@ -126,9 +126,9 @@ class SourceDeactivationNotification(Notification):
126
126
  return 'Inactivation of Community on Leadguru'
127
127
 
128
128
  def get_notification_text(self, bots: list[DedicatedBotModel]):
129
- names = [server.name.capitalize() for bot in bots for server in bot.servers]
129
+ names = [bot.source.source_name.capitalize() for bot in bots]
130
130
  if self.type == NotificationType.INSTANTLY:
131
- return f'{names[-1]} became inactive on Leadguru.'
131
+ return f'{bots[-1].source.source_name.capitalize()} became inactive on Leadguru.'
132
132
  elif (self.type == NotificationType.ONCE_A_DAY or self.type == NotificationType.ONCE_A_WEEK) and bots:
133
133
  match len(bots):
134
134
  case 1:
@@ -200,7 +200,8 @@ class FollowUpNotification(Notification):
200
200
 
201
201
  @property
202
202
  def need_to_notify_now(self) -> bool:
203
- allowed_types = [NotificationType.ONCE_A_DAY, NotificationType.ONCE_A_DAY, NotificationType.FEW_MINUTES_BEFORE]
203
+ allowed_types = [NotificationType.ONCE_A_DAY, NotificationType.ONCE_A_DAY,
204
+ NotificationType.UNREAD_FOR_FEW_MINUTES]
204
205
  if not self.enabled or self.type not in allowed_types:
205
206
  return False
206
207
 
@@ -219,7 +220,7 @@ class FollowUpNotification(Notification):
219
220
  return True
220
221
 
221
222
  def has_not_notified_leads(self, actual: list[UserLeadModel]) -> bool:
222
- if self.type == NotificationType.FEW_MINUTES_BEFORE and self.last_notification:
223
+ if self.type == NotificationType.UNREAD_FOR_FEW_MINUTES and self.last_notification:
223
224
  self.last_notification = self.last_notification.replace(tzinfo=UTC)
224
225
  not_notified_leads = [lead for lead in actual if lead.followup_date.replace(tzinfo=UTC) >
225
226
  (self.last_notification + timedelta(minutes=self.minute))]
@@ -235,7 +236,7 @@ class FollowUpNotification(Notification):
235
236
 
236
237
  def get_button_url(self, actual: list[UserLeadModel]) -> str:
237
238
  if len(actual) > 1:
238
- if self.type == NotificationType.ONCE_A_DAY or self.type == NotificationType.FEW_MINUTES_BEFORE:
239
+ if self.type == NotificationType.ONCE_A_DAY or self.type == NotificationType.UNREAD_FOR_FEW_MINUTES:
239
240
  return f'{portal_url}/dashboard/calendar?view=day'
240
241
  return f'{portal_url}/dashboard/calendar?view=week'
241
242
  return f'{portal_url}/feed?senderId={actual[0].message.sender_id}&sourceId={actual[0].message.source.source_id}'
@@ -247,7 +248,7 @@ class FollowUpNotification(Notification):
247
248
  return f'{subject_text} for today'
248
249
  elif self.type == NotificationType.ONCE_A_WEEK:
249
250
  return f'{subject_text} for this week'
250
- elif self.type == NotificationType.FEW_MINUTES_BEFORE:
251
+ elif self.type == NotificationType.UNREAD_FOR_FEW_MINUTES:
251
252
  return f'{subject_text} for today in {self.minute} minutes'
252
253
 
253
254
  return subject_text
@@ -273,7 +274,7 @@ class FollowUpNotification(Notification):
273
274
  case _:
274
275
  notification_text = (f'You have planned to send follow-up to {", ".join(names[:3])} '
275
276
  f'and {len(names) - 3} other leads this week.')
276
- elif self.type == NotificationType.FEW_MINUTES_BEFORE:
277
+ elif self.type == NotificationType.UNREAD_FOR_FEW_MINUTES:
277
278
  match len(actual):
278
279
  case 1:
279
280
  notification_text = (f'You have planned to send follow-up today in '
@@ -82,7 +82,7 @@ class UserMongoRepository(BaseMongoRepository):
82
82
  update_dict = {k: v for k, v in kwargs.items() if v is not None}
83
83
  self.collection().update_one({'_id': to_object_id(_id)}, {'$set': update_dict})
84
84
 
85
- def get_users(self, users_ids=None, include_inactive=False, **kwargs):
85
+ def get_users(self, users_ids=None, include_inactive=False, name=None, **kwargs):
86
86
  pipeline = {}
87
87
 
88
88
  subscription_expired = kwargs.get('subscription_expired')
@@ -129,6 +129,9 @@ class UserMongoRepository(BaseMongoRepository):
129
129
  if users_ids is not None:
130
130
  pipeline['_id'] = {'$in': [to_object_id(_id) for _id in users_ids]}
131
131
 
132
+ if name is not None:
133
+ pipeline['user_name'] = {"$regex": name, "$options": 'i'}
134
+
132
135
  if not include_inactive:
133
136
  pipeline['inactive'] = False
134
137
 
@@ -254,7 +257,7 @@ class UserLeadMongoRepository(BaseMongoRepository):
254
257
  },
255
258
  {
256
259
  'case': {'$eq': ['$user.notification_settings.follow_ups.type',
257
- 'few_minutes_before']},
260
+ 'unread_for_few_minutes']},
258
261
  'then': {
259
262
  '$dateSubtract': {
260
263
  'startDate': now,