leadguru-jobs 0.474.0__py3-none-any.whl → 0.476.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.474.0
3
+ Version: 0.476.0
4
4
  Summary: LGT jobs builds
5
5
  Author-email: developer@leadguru.co
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -40,14 +40,14 @@ lgt_jobs/lgt_common/slack_client/web_client.py,sha256=oZV7oUcSXXngfMI6oXDedlQWeP
40
40
  lgt_jobs/lgt_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  lgt_jobs/lgt_data/analytics.py,sha256=qo5nNFQxOTTk8i3tmCq0d3F9iaV9MTIR84SSi6uNrJ8,23427
42
42
  lgt_jobs/lgt_data/engine.py,sha256=OkTIIsVhb4o0dcDOzolb-NNTftzhJvsCuldxg1PvLUM,8113
43
- lgt_jobs/lgt_data/enums.py,sha256=8cTLz8e6Jz4ikjNzqMiorwMMdVjU2SyXtl_tD7nHKxw,2326
43
+ lgt_jobs/lgt_data/enums.py,sha256=P-Jo_kQfFanbN5ztjQZIaWkZ6qOmAjHdypZ85ReOgdA,2407
44
44
  lgt_jobs/lgt_data/helpers.py,sha256=58ycqKF1z5nAw0vs6yVCg-SQet107YHyKYXaQUc7M68,157
45
- lgt_jobs/lgt_data/model.py,sha256=wsa7_MzCU9EGcdclpzLaQx_ovybBARyfpnzJ-P-G2pM,28583
46
- lgt_jobs/lgt_data/mongo_repository.py,sha256=dEdpMkBMhdzSWzj_HJCZYEo89zkVBqGXgyjyFLNOTVA,45463
45
+ lgt_jobs/lgt_data/model.py,sha256=6eds2J7gPfIVAs7E1bTJEvH_M8rWdJ091cQmIw5Sznk,29090
46
+ lgt_jobs/lgt_data/mongo_repository.py,sha256=NO6w1mkTfzFa3_qIP-2_SnPGaItxI33Z1EXbQMgbRng,45971
47
47
  lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
48
  lgt_jobs/services/web_client.py,sha256=eCgzyyXco6iPwAJziyRek_3ns1bxJZKknnLIJApKeoo,2070
49
49
  lgt_jobs/templates/new_message.html,sha256=I3J6YPz-uhGbGnuGc5d7Hxj0X4VzOtT8PqrQQGPJfc4,7002
50
- leadguru_jobs-0.474.0.dist-info/METADATA,sha256=b-2UyZBdRHr6UglK1sU4Axa9SqtCTn01aEI2ga6kg_8,1319
51
- leadguru_jobs-0.474.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
52
- leadguru_jobs-0.474.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
53
- leadguru_jobs-0.474.0.dist-info/RECORD,,
50
+ leadguru_jobs-0.476.0.dist-info/METADATA,sha256=hNAP57CcPNJkE0MXhAf98UZmF3ex2ZqWxnu0cZRw6DE,1319
51
+ leadguru_jobs-0.476.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
52
+ leadguru_jobs-0.476.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
53
+ leadguru_jobs-0.476.0.dist-info/RECORD,,
@@ -101,3 +101,8 @@ class FeaturesEnum(str, Enum):
101
101
  SCHEDULED_MESSAGES = 'scheduled_messages'
102
102
  SOURCES = 'sources'
103
103
  ALGORITHMS = 'algorithms'
104
+
105
+
106
+ class FeatureOptions(str, Enum):
107
+ BASIC = 'basic'
108
+ ADVANCED = 'advanced'
@@ -4,7 +4,7 @@ import json
4
4
  from abc import ABC
5
5
  from datetime import datetime, UTC
6
6
  from typing import Optional, List, Dict
7
- from .enums import UserRole, SourceType
7
+ from .enums import UserRole, SourceType, FeaturesEnum, FeatureOptions
8
8
  from .helpers import get_linkedin_search_contact
9
9
  from bson import ObjectId
10
10
 
@@ -287,6 +287,8 @@ class UserModel(BaseModel):
287
287
  self.slack_users: List[SlackUser] = []
288
288
  self.discord_users: List[DiscordUser] = []
289
289
  self.verified: bool = False
290
+ self.subscription_id: ObjectId | None = None
291
+ self.subscription_expired_at: datetime | None = None
290
292
 
291
293
  @classmethod
292
294
  def from_dic(cls, dic: dict):
@@ -990,4 +992,22 @@ class UsersPage:
990
992
  def from_dic(dic: dict):
991
993
  users = [UserModel.from_dic(doc) for doc in dic.get('page', [])]
992
994
  count = dic.get('count', 0)
993
- return UsersPage(users=users, count=count)
995
+ return UsersPage(users=users, count=count)
996
+
997
+
998
+ class Feature(DictionaryModel):
999
+ display_name: str
1000
+ name: FeaturesEnum
1001
+ description: str | None = None
1002
+ limit: int | None = None
1003
+ options: FeatureOptions | None = None
1004
+
1005
+
1006
+ class Subscription(BaseModel):
1007
+ features: list[Feature]
1008
+ duration_days: int
1009
+ name: str
1010
+ price: int
1011
+ limits: int
1012
+ trial: bool
1013
+ updated_at: datetime = None
@@ -9,7 +9,7 @@ from lgt_jobs.lgt_data.enums import SourceType
9
9
  from lgt_jobs.lgt_data.model import (LeadModel, BaseModel, UserModel, UserResetPasswordModel, BoardModel, BoardedStatus,
10
10
  DedicatedBotModel, SlackMemberInformation, UserTemplateModel, LinkedinContact,
11
11
  ExtendedUserLeadModel, UserLeadModel, ExtendedLeadModel, UserContact, ChatMessage,
12
- GroupedMessagesModel, UserVerificationModel, UsersPage)
12
+ GroupedMessagesModel, UserVerificationModel, UsersPage, Subscription)
13
13
  from datetime import datetime, UTC, timedelta
14
14
  from collections import OrderedDict
15
15
 
@@ -1227,3 +1227,21 @@ class UserVerificationMongoRepository(BaseMongoRepository):
1227
1227
  model.email = email
1228
1228
  model.created_at = datetime.now(UTC)
1229
1229
  return self.collection().insert_one(model.to_dic()).inserted_id
1230
+
1231
+
1232
+ class SubscriptionsRepository(BaseMongoRepository):
1233
+ pass
1234
+
1235
+ collection_name = 'subscriptions'
1236
+ model = Subscription
1237
+
1238
+ def find_one(self, **kwargs):
1239
+ pipeline = {}
1240
+ subscription_id = kwargs.get('id')
1241
+ trial = kwargs.get('trial')
1242
+ if subscription_id:
1243
+ pipeline['_id'] = to_object_id(subscription_id)
1244
+ if trial is not None:
1245
+ pipeline['trial'] = trial
1246
+
1247
+ return Subscription.from_dic(self.collection().find_one(pipeline))