ipulse-shared-core-ftredge 5.1.1__py3-none-any.whl → 5.2.1__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.
Potentially problematic release.
This version of ipulse-shared-core-ftredge might be problematic. Click here for more details.
- ipulse_shared_core_ftredge/models/organisation.py +33 -8
- ipulse_shared_core_ftredge/models/subscription.py +17 -4
- ipulse_shared_core_ftredge/models/user_profile.py +24 -8
- ipulse_shared_core_ftredge/models/user_profile_update.py +9 -3
- ipulse_shared_core_ftredge/models/user_status.py +21 -15
- {ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/METADATA +1 -1
- {ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/RECORD +10 -10
- {ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/LICENCE +0 -0
- {ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/WHEEL +0 -0
- {ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/top_level.txt +0 -0
|
@@ -13,7 +13,11 @@ import uuid
|
|
|
13
13
|
import dateutil.parser
|
|
14
14
|
from ipulse_shared_base_ftredge import (
|
|
15
15
|
OrganizationRelation,
|
|
16
|
-
OrganizationIndustry
|
|
16
|
+
OrganizationIndustry,
|
|
17
|
+
Layer,
|
|
18
|
+
Module,
|
|
19
|
+
list_as_lower_strings,
|
|
20
|
+
Sector
|
|
17
21
|
)
|
|
18
22
|
|
|
19
23
|
class Organisation(BaseModel):
|
|
@@ -24,15 +28,27 @@ class Organisation(BaseModel):
|
|
|
24
28
|
model_config = ConfigDict(frozen=True, extra="forbid")
|
|
25
29
|
|
|
26
30
|
# Class constants
|
|
27
|
-
VERSION: ClassVar[float] = 1
|
|
28
|
-
MODULE: ClassVar[str] = "
|
|
29
|
-
|
|
31
|
+
VERSION: ClassVar[float] = 4.1
|
|
32
|
+
MODULE: ClassVar[str] = "_".join(list_as_lower_strings(Layer.PULSE_APP, Module.CORE.name, Sector.USERCORE.name))
|
|
33
|
+
OBJ_REF: ClassVar[str] = "orgprofile"
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
schema_version: float = Field(
|
|
36
|
+
default=VERSION,
|
|
37
|
+
description="Version of this Class == version of DB Schema",
|
|
38
|
+
frozen=True
|
|
35
39
|
)
|
|
40
|
+
|
|
41
|
+
org_uid: str = Field(
|
|
42
|
+
default_factory=lambda: uuid.uuid4().hex,
|
|
43
|
+
description="Unique identifier for the organisation",
|
|
44
|
+
frozen=True
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
id: str = Field(
|
|
48
|
+
default=None,
|
|
49
|
+
description="Organisation ID, format: {OBJ_REF}_{org_uid}"
|
|
50
|
+
)
|
|
51
|
+
|
|
36
52
|
name: str = Field(..., min_length=1, max_length=100)
|
|
37
53
|
relations: Set[OrganizationRelation] = Field(..., description="Organisation relations/types")
|
|
38
54
|
|
|
@@ -48,6 +64,15 @@ class Organisation(BaseModel):
|
|
|
48
64
|
website: Optional[str] = Field(None, max_length=200)
|
|
49
65
|
org_admin_user_uids: Optional[Set[str]] = None
|
|
50
66
|
|
|
67
|
+
@field_validator('id', mode='before')
|
|
68
|
+
@classmethod
|
|
69
|
+
def generate_id(cls, v: Optional[str], info) -> str:
|
|
70
|
+
values = info.data
|
|
71
|
+
org_uid = values.get('org_uid')
|
|
72
|
+
if not org_uid:
|
|
73
|
+
raise ValueError("org_uid must be set before generating id")
|
|
74
|
+
return f"{cls.OBJ_REF}_{org_uid}"
|
|
75
|
+
|
|
51
76
|
@field_validator('relations')
|
|
52
77
|
@classmethod
|
|
53
78
|
def validate_relations(cls, v: Set[OrganizationRelation]) -> Set[OrganizationRelation]:
|
|
@@ -2,20 +2,33 @@ from datetime import datetime, timezone
|
|
|
2
2
|
from dateutil.relativedelta import relativedelta
|
|
3
3
|
from typing import Set, Optional, Dict, List, ClassVar
|
|
4
4
|
from pydantic import BaseModel, Field, ConfigDict
|
|
5
|
-
from ipulse_shared_base_ftredge import Layer, Module, list_as_lower_strings
|
|
5
|
+
from ipulse_shared_base_ftredge import Layer, Module, list_as_lower_strings, Sector, SubscriptionPlan
|
|
6
6
|
# ORIGINAL AUTHOR ="Russlan Ramdowar;russlan@ftredge.com"
|
|
7
7
|
# CLASS_ORGIN_DATE=datetime(2024, 2, 12, 20, 5)
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
DEFAULT_SUBSCRIPTION_PLAN=
|
|
11
|
-
DEFAULT_SUBSCRIPTION_STATUS="active"
|
|
10
|
+
DEFAULT_SUBSCRIPTION_PLAN = SubscriptionPlan.FREE
|
|
11
|
+
DEFAULT_SUBSCRIPTION_STATUS = "active"
|
|
12
12
|
|
|
13
13
|
############################################ !!!!! ALWAYS UPDATE SCHEMA VERSION , IF SCHEMA IS BEING MODIFIED !!! ############################################
|
|
14
14
|
class Subscription(BaseModel):
|
|
15
15
|
"""
|
|
16
16
|
Represents a single subscription cycle.
|
|
17
17
|
"""
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
model_config = ConfigDict(frozen=True, extra="forbid")
|
|
20
|
+
|
|
21
|
+
VERSION: ClassVar[float] = 1.1
|
|
22
|
+
DOMAIN: ClassVar[str] = "_".join(list_as_lower_strings(Layer.PULSE_APP, Module.CORE.name, Sector.LOOKUP.name))
|
|
23
|
+
|
|
24
|
+
# System-managed fields (read-only)
|
|
25
|
+
schema_version: float = Field(
|
|
26
|
+
default=VERSION,
|
|
27
|
+
description="Version of this Class == version of DB Schema",
|
|
28
|
+
frozen=True
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
plan_name: SubscriptionPlan = Field(
|
|
19
32
|
default=DEFAULT_SUBSCRIPTION_PLAN,
|
|
20
33
|
description="Subscription Plan Name"
|
|
21
34
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from datetime import datetime, date
|
|
2
2
|
from typing import Set, Optional, ClassVar
|
|
3
3
|
from pydantic import BaseModel, EmailStr, Field, ConfigDict
|
|
4
|
-
from ipulse_shared_base_ftredge import Layer, Module, list_as_lower_strings
|
|
4
|
+
from ipulse_shared_base_ftredge import Layer, Module, list_as_lower_strings, Sector
|
|
5
5
|
|
|
6
6
|
# # Revision history (as model metadata)
|
|
7
7
|
# CLASS_ORIGIN_AUTHOR: ClassVar[str] = "Russlan Ramdowar;russlan@ftredge.com"
|
|
@@ -14,8 +14,8 @@ class UserProfile(BaseModel):
|
|
|
14
14
|
model_config = ConfigDict(frozen=True, extra="forbid")
|
|
15
15
|
|
|
16
16
|
# Metadata as class variables
|
|
17
|
-
VERSION: ClassVar[float] =
|
|
18
|
-
DOMAIN: ClassVar[str] = "_".join(list_as_lower_strings(Layer.PULSE_APP, Module.CORE.name))
|
|
17
|
+
VERSION: ClassVar[float] = 4.1
|
|
18
|
+
DOMAIN: ClassVar[str] = "_".join(list_as_lower_strings(Layer.PULSE_APP, Module.CORE.name, Sector.USERCORE.name))
|
|
19
19
|
|
|
20
20
|
# System-managed fields (read-only)
|
|
21
21
|
schema_version: float = Field(
|
|
@@ -23,6 +23,18 @@ class UserProfile(BaseModel):
|
|
|
23
23
|
description="Version of this Class == version of DB Schema",
|
|
24
24
|
frozen=True
|
|
25
25
|
)
|
|
26
|
+
|
|
27
|
+
id : str = Field(
|
|
28
|
+
...,
|
|
29
|
+
description="User ID, propagated from Firebase Auth"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
user_uid: str = Field(
|
|
33
|
+
...,
|
|
34
|
+
description="User UID, propagated from Firebase Auth"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
26
38
|
email: EmailStr = Field(
|
|
27
39
|
...,
|
|
28
40
|
description="Propagated from Firebase Auth",
|
|
@@ -30,8 +42,7 @@ class UserProfile(BaseModel):
|
|
|
30
42
|
)
|
|
31
43
|
organizations_uids: Set[str] = Field(
|
|
32
44
|
default_factory=set,
|
|
33
|
-
description="Depends on Subscription Plan, Regularly Updated"
|
|
34
|
-
frozen=True
|
|
45
|
+
description="Depends on Subscription Plan, Regularly Updated"
|
|
35
46
|
)
|
|
36
47
|
|
|
37
48
|
# Timestamps and audit fields (read-only)
|
|
@@ -43,8 +54,7 @@ class UserProfile(BaseModel):
|
|
|
43
54
|
# System identification (read-only)
|
|
44
55
|
provider_id: str = Field(frozen=True)
|
|
45
56
|
aliases: Optional[Set[str]] = Field(
|
|
46
|
-
default=None
|
|
47
|
-
frozen=True
|
|
57
|
+
default=None
|
|
48
58
|
)
|
|
49
59
|
|
|
50
60
|
# User-editable fields
|
|
@@ -69,4 +79,10 @@ class UserProfile(BaseModel):
|
|
|
69
79
|
default=None,
|
|
70
80
|
pattern=r"^\+?[1-9]\d{1,14}$", # Added 'r' prefix for raw string
|
|
71
81
|
description="E.164 format phone number"
|
|
72
|
-
)
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Audit fields
|
|
85
|
+
creat_date: datetime = Field(default_factory=datetime.now)
|
|
86
|
+
creat_by_user: str = Field(frozen=True)
|
|
87
|
+
updt_date: datetime = Field(default_factory=datetime.now)
|
|
88
|
+
updt_by_user: str = Field(frozen=True)
|
|
@@ -2,6 +2,10 @@ from typing import Optional, Set, ClassVar
|
|
|
2
2
|
from pydantic import BaseModel, Field, EmailStr, ConfigDict
|
|
3
3
|
from datetime import date, datetime
|
|
4
4
|
|
|
5
|
+
# CLASS_ORGIN_DATE: ClassVar[datetime] = datetime(2024, 3, 15, 20, 15)
|
|
6
|
+
# CLASS_REVISION_DATE: ClassVar[datetime] = datetime(2024, 3, 15, 20, 15)
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
class UserProfileUpdate(BaseModel):
|
|
6
10
|
"""
|
|
7
11
|
User Profile Update model for partial updates of user information.
|
|
@@ -12,11 +16,9 @@ class UserProfileUpdate(BaseModel):
|
|
|
12
16
|
# Metadata as class variables
|
|
13
17
|
VERSION: ClassVar[float] = 2.01
|
|
14
18
|
CLASS_ORIGIN_AUTHOR: ClassVar[str] = "Russlan Ramdowar;russlan@ftredge.com"
|
|
15
|
-
|
|
16
|
-
CLASS_REVISION_DATE: ClassVar[datetime] = datetime(2024, 3, 15, 20, 15)
|
|
19
|
+
|
|
17
20
|
|
|
18
21
|
# System fields
|
|
19
|
-
schema_version: Optional[float] = Field(None, description="Version of this Class == version of DB Schema")
|
|
20
22
|
email: Optional[EmailStr] = Field(None, description="Propagated from Firebase Auth")
|
|
21
23
|
organizations_uids: Optional[Set[str]] = Field(None, description="Organization memberships")
|
|
22
24
|
|
|
@@ -37,6 +39,10 @@ class UserProfileUpdate(BaseModel):
|
|
|
37
39
|
last_name: Optional[str] = Field(None, max_length=100)
|
|
38
40
|
mobile: Optional[str] = Field(None, pattern=r"^\+?[1-9]\d{1,14}$")
|
|
39
41
|
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
40
46
|
def model_dump(self, **kwargs):
|
|
41
47
|
kwargs.setdefault('exclude_none', True)
|
|
42
48
|
return super().model_dump(**kwargs)
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
from dateutil.relativedelta import relativedelta
|
|
1
|
+
from datetime import datetime
|
|
3
2
|
from typing import Set, Optional, Dict, List, ClassVar
|
|
4
3
|
from pydantic import BaseModel, Field, ConfigDict
|
|
5
4
|
from .subscription import Subscription
|
|
6
|
-
from ipulse_shared_base_ftredge import Layer, Module, list_as_lower_strings
|
|
5
|
+
from ipulse_shared_base_ftredge import Layer, Module, list_as_lower_strings, Sector
|
|
7
6
|
# ORIGINAL AUTHOR ="Russlan Ramdowar;russlan@ftredge.com"
|
|
8
7
|
# CLASS_ORGIN_DATE=datetime(2024, 2, 12, 20, 5)
|
|
9
8
|
|
|
10
|
-
DEFAULT_IAM_GROUPS={"pulseroot":["full_open_read"]}
|
|
11
|
-
DEFAULT_SUBSCRIPTION_INSIGHT_CREDITS=10
|
|
12
|
-
DEFAULT_EXTRA_INSIGHT_CREDITS=0
|
|
13
|
-
|
|
14
9
|
############################################ !!!!! ALWAYS UPDATE SCHEMA VERSION , IF SCHEMA IS BEING MODIFIED !!! ############################################
|
|
15
10
|
class UserStatus(BaseModel):
|
|
16
11
|
"""
|
|
@@ -19,9 +14,9 @@ class UserStatus(BaseModel):
|
|
|
19
14
|
model_config = ConfigDict(frozen=True, extra="forbid")
|
|
20
15
|
|
|
21
16
|
# Class constants
|
|
22
|
-
VERSION: ClassVar[float] =
|
|
23
|
-
DOMAIN: ClassVar[str] = "_".join(list_as_lower_strings(Layer.PULSE_APP, Module.CORE.name))
|
|
24
|
-
OBJ_REF: ClassVar[str] = "
|
|
17
|
+
VERSION: ClassVar[float] = 4.1
|
|
18
|
+
DOMAIN: ClassVar[str] = "_".join(list_as_lower_strings(Layer.PULSE_APP, Module.CORE.name, Sector.USERCORE.name))
|
|
19
|
+
OBJ_REF: ClassVar[str] = "userstatus"
|
|
25
20
|
|
|
26
21
|
# Default values as class variables
|
|
27
22
|
DEFAULT_IAM_GROUPS: ClassVar[Dict[str, List[str]]] = {"pulseroot": ["full_open_read"]}
|
|
@@ -30,12 +25,23 @@ class UserStatus(BaseModel):
|
|
|
30
25
|
DEFAULT_SUBSCRIPTION_INSIGHT_CREDITS: ClassVar[int] = 10
|
|
31
26
|
DEFAULT_EXTRA_INSIGHT_CREDITS: ClassVar[int] = 0
|
|
32
27
|
|
|
28
|
+
|
|
33
29
|
# System-managed fields
|
|
34
30
|
schema_version: float = Field(
|
|
35
31
|
default=VERSION,
|
|
36
32
|
description="Version of this Class == version of DB Schema"
|
|
37
33
|
)
|
|
38
34
|
|
|
35
|
+
id : str = Field(
|
|
36
|
+
...,
|
|
37
|
+
description="User ID, propagated from Firebase Auth"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
user_uid: str = Field(
|
|
41
|
+
...,
|
|
42
|
+
description="User UID, propagated from Firebase Auth"
|
|
43
|
+
)
|
|
44
|
+
|
|
39
45
|
# IAM and subscription fields
|
|
40
46
|
iam_groups: Dict[str, List[str]] = Field(
|
|
41
47
|
default_factory=lambda: UserStatus.DEFAULT_IAM_GROUPS,
|
|
@@ -65,8 +71,8 @@ class UserStatus(BaseModel):
|
|
|
65
71
|
# Optional fields
|
|
66
72
|
payment_refs_uids: Optional[Set[str]] = None
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
creat_date: datetime
|
|
70
|
-
creat_by_user: str
|
|
71
|
-
updt_date: datetime
|
|
72
|
-
updt_by_user: str
|
|
74
|
+
# Audit fields
|
|
75
|
+
creat_date: datetime = Field(default_factory=datetime.now)
|
|
76
|
+
creat_by_user: str = Field(frozen=True)
|
|
77
|
+
updt_date: datetime = Field(default_factory=datetime.now)
|
|
78
|
+
updt_by_user: str = Field(frozen=True)
|
{ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: ipulse_shared_core_ftredge
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.2.1
|
|
4
4
|
Summary: Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.
|
|
5
5
|
Home-page: https://github.com/TheFutureEdge/ipulse_shared_core
|
|
6
6
|
Author: Russlan Ramdowar
|
{ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/RECORD
RENAMED
|
@@ -6,18 +6,18 @@ ipulse_shared_core_ftredge/dependencies/database.py,sha256=I-5oXrtkcatBCZUxCyaHg
|
|
|
6
6
|
ipulse_shared_core_ftredge/dependencies/token_validation.py,sha256=0j5bXdiJtaEcLvN5y39QJ0Te3h-nnn4bHh_sz3nbCwM,1909
|
|
7
7
|
ipulse_shared_core_ftredge/models/__init__.py,sha256=fM9WUqC-UmmeAkZOBUz7BIJsmZHc3GsqcSDZKt2T97E,282
|
|
8
8
|
ipulse_shared_core_ftredge/models/api_response.py,sha256=gtZAahaYfgKbk_6kEsnIoBjZkI6UBFwhvjusvbOSvfw,1057
|
|
9
|
-
ipulse_shared_core_ftredge/models/organisation.py,sha256=
|
|
9
|
+
ipulse_shared_core_ftredge/models/organisation.py,sha256=3BBeZuOQQIpP8ZtYqNCsLHWqtV37U3PzF2lgiqMKjrU,4208
|
|
10
10
|
ipulse_shared_core_ftredge/models/resource_catalog_item.py,sha256=mEGX8AftzrhEHqFVXjr62CuRnXC1vK4z3bHl_XBJodU,4964
|
|
11
|
-
ipulse_shared_core_ftredge/models/subscription.py,sha256=
|
|
11
|
+
ipulse_shared_core_ftredge/models/subscription.py,sha256=LfQa2iuYDJRoS-vICQEnbMtxKcDA7zUvnq5rvfCQTIk,1747
|
|
12
12
|
ipulse_shared_core_ftredge/models/user_auth.py,sha256=YgCeK0uJ-JOkPavwzogl4wGC3RpA8PVfl-5MPS4Kxhk,432
|
|
13
|
-
ipulse_shared_core_ftredge/models/user_profile.py,sha256
|
|
14
|
-
ipulse_shared_core_ftredge/models/user_profile_update.py,sha256=
|
|
15
|
-
ipulse_shared_core_ftredge/models/user_status.py,sha256=
|
|
13
|
+
ipulse_shared_core_ftredge/models/user_profile.py,sha256=O6EPC6H00Yk-_7jMOH2gLcUTNxbuABv36JOxM7psaY4,2748
|
|
14
|
+
ipulse_shared_core_ftredge/models/user_profile_update.py,sha256=8xOAfHa7cpJRQAvnzAX9t77Fdde-nLdCB3ePUSoYLDY,1651
|
|
15
|
+
ipulse_shared_core_ftredge/models/user_status.py,sha256=DiENlrYUYjNnXHrQjArn-S3M7VByFH64Y4RsQyIktkU,3040
|
|
16
16
|
ipulse_shared_core_ftredge/services/__init__.py,sha256=lhmjDX__QbhDaz8sZAFIUwT4-76BZl2_LY3-MLxONE0,194
|
|
17
17
|
ipulse_shared_core_ftredge/services/base_firestore_service.py,sha256=SHeYxBtM6bewgSxpyjlZ7JxjmW9xPv1qw42NpMsYN1s,2919
|
|
18
18
|
ipulse_shared_core_ftredge/services/exceptions.py,sha256=OIHFxCc9cP_Ki05H8TsPIXbQM7PKEpyfbiTLZTsmx4Y,4216
|
|
19
|
-
ipulse_shared_core_ftredge-5.
|
|
20
|
-
ipulse_shared_core_ftredge-5.
|
|
21
|
-
ipulse_shared_core_ftredge-5.
|
|
22
|
-
ipulse_shared_core_ftredge-5.
|
|
23
|
-
ipulse_shared_core_ftredge-5.
|
|
19
|
+
ipulse_shared_core_ftredge-5.2.1.dist-info/LICENCE,sha256=YBtYAXNqCCOo9Mr2hfkbSPAM9CeAr2j1VZBSwQTrNwE,1060
|
|
20
|
+
ipulse_shared_core_ftredge-5.2.1.dist-info/METADATA,sha256=-iXHOnhkb0sVtu4ogynIzTOU0t7ic8OsuEmUJihC4kg,538
|
|
21
|
+
ipulse_shared_core_ftredge-5.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
22
|
+
ipulse_shared_core_ftredge-5.2.1.dist-info/top_level.txt,sha256=8sgYrptpexkA_6_HyGvho26cVFH9kmtGvaK8tHbsGHk,27
|
|
23
|
+
ipulse_shared_core_ftredge-5.2.1.dist-info/RECORD,,
|
{ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/LICENCE
RENAMED
|
File without changes
|
{ipulse_shared_core_ftredge-5.1.1.dist-info → ipulse_shared_core_ftredge-5.2.1.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|