ipulse-shared-core-ftredge 2.56__py3-none-any.whl → 3.1.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/__init__.py +10 -14
- ipulse_shared_core_ftredge/models/__init__.py +0 -1
- ipulse_shared_core_ftredge/models/organisation.py +61 -55
- ipulse_shared_core_ftredge/models/resource_catalog_item.py +97 -171
- ipulse_shared_core_ftredge/models/user_profile.py +3 -3
- ipulse_shared_core_ftredge/utils/__init__.py +3 -0
- ipulse_shared_core_ftredge/utils/utils_common.py +10 -0
- {ipulse_shared_core_ftredge-2.56.dist-info → ipulse_shared_core_ftredge-3.1.1.dist-info}/METADATA +5 -7
- ipulse_shared_core_ftredge-3.1.1.dist-info/RECORD +15 -0
- {ipulse_shared_core_ftredge-2.56.dist-info → ipulse_shared_core_ftredge-3.1.1.dist-info}/WHEEL +1 -1
- ipulse_shared_core_ftredge/enums/__init__.py +0 -28
- ipulse_shared_core_ftredge/enums/enums_common_utils.py +0 -171
- ipulse_shared_core_ftredge/enums/enums_data_eng.py +0 -44
- ipulse_shared_core_ftredge/enums/enums_module_fincore.py +0 -58
- ipulse_shared_core_ftredge/enums/enums_modules.py +0 -33
- ipulse_shared_core_ftredge/models/audit_log_firestore.py +0 -12
- ipulse_shared_core_ftredge/models/pulse_enums.py +0 -196
- ipulse_shared_core_ftredge/tests/__init__.py +0 -0
- ipulse_shared_core_ftredge/tests/test.py +0 -17
- ipulse_shared_core_ftredge/utils_common.py +0 -543
- ipulse_shared_core_ftredge/utils_gcp.py +0 -267
- ipulse_shared_core_ftredge/utils_templates_and_schemas.py +0 -155
- ipulse_shared_core_ftredge-2.56.dist-info/RECORD +0 -25
- {ipulse_shared_core_ftredge-2.56.dist-info → ipulse_shared_core_ftredge-3.1.1.dist-info}/LICENCE +0 -0
- {ipulse_shared_core_ftredge-2.56.dist-info → ipulse_shared_core_ftredge-3.1.1.dist-info}/top_level.txt +0 -0
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
read_csv_from_gcs, read_json_from_gcs,
|
|
5
|
-
write_csv_to_gcs, write_json_to_gcs)
|
|
6
|
-
from .utils_templates_and_schemas import (create_bigquery_schema_from_json,
|
|
7
|
-
check_format_against_schema_template)
|
|
8
|
-
from .utils_common import (ContextLog, Pipelinemon)
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
from .models import ( UserAuth, UserProfile,
|
|
3
|
+
UserStatus, UserProfileUpdate)
|
|
9
4
|
|
|
10
|
-
from .
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
from .utils import (list_as_strings)
|
|
6
|
+
|
|
7
|
+
from .logging import (get_logger,
|
|
8
|
+
log_error,
|
|
9
|
+
log_warning,
|
|
10
|
+
log_info,
|
|
11
|
+
log_debug)
|
|
@@ -1,65 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
# pylint: disable=missing-function-docstring
|
|
3
|
+
# pylint: disable=missing-class-docstring
|
|
4
|
+
# pylint: disable=broad-exception-caught
|
|
5
|
+
# pylint: disable=line-too-long
|
|
6
|
+
# pylint: disable=unused-variable
|
|
7
|
+
# pylint: disable=broad-exception-caught
|
|
8
|
+
# from pydantic import BaseModel, validator, ValidationError, Field
|
|
9
|
+
# from typing import Set, Optional
|
|
10
|
+
# import uuid
|
|
11
|
+
# from datetime import datetime
|
|
12
|
+
# import dateutil.parser
|
|
7
13
|
|
|
8
|
-
CLASS_VERSION= 1.0
|
|
9
|
-
MODULE= "core"
|
|
10
|
-
CLASS_REF="orgn"
|
|
14
|
+
# CLASS_VERSION= 1.0
|
|
15
|
+
# MODULE= "core"
|
|
16
|
+
# CLASS_REF="orgn"
|
|
11
17
|
|
|
12
18
|
|
|
13
|
-
class Organisation(BaseModel):
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
# class Organisation(BaseModel):
|
|
20
|
+
# puid: str = Field(default_factory=f"{datetime.utcnow().strftime('%Y%m%d%H%M')}{uuid.uuid4().hex[:8]}_{MODULE}{CLASS_REF}".lower())
|
|
21
|
+
# name: str
|
|
22
|
+
# creat_date: datetime = Field(default_factory=datetime.utcnow())
|
|
23
|
+
# updt_date: datetime = Field(default_factory=datetime.utcnow())
|
|
24
|
+
# creat_by_user: Optional[str] = None
|
|
25
|
+
# updt_by_user: Optional[str] = None
|
|
26
|
+
# relations: Optional[Set[str]]=None
|
|
27
|
+
# description: Optional[str] = None # Updated to use Optional
|
|
28
|
+
# industries: Optional[Set[str]] = None # Updated to use Optional
|
|
29
|
+
# website: Optional[str] = None # Updated to use Optional
|
|
30
|
+
# org_admin_user_uids: Optional[Set[str]] = None # Updated to use Optional
|
|
31
|
+
# class Config:
|
|
32
|
+
# extra = "forbid"
|
|
27
33
|
|
|
28
34
|
|
|
29
|
-
@validator('relations', pre=True, always=True)
|
|
30
|
-
def validate_relations(cls, relations):
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
# @validator('relations', pre=True, always=True)
|
|
36
|
+
# def validate_relations(cls, relations):
|
|
37
|
+
# if not set(relations).issubset(enums.organisation_relations):
|
|
38
|
+
# raise ValueError("Invalid relation values provided.")
|
|
39
|
+
# return relations
|
|
34
40
|
|
|
35
41
|
|
|
36
|
-
@validator('industries', pre=True, always=True)
|
|
37
|
-
def validate_industries(cls, industries):
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
# @validator('industries', pre=True, always=True)
|
|
43
|
+
# def validate_industries(cls, industries):
|
|
44
|
+
# if industries is not None and not set(industries).issubset(enums.organisation_industries):
|
|
45
|
+
# raise ValueError("Invalid industry values provided.")
|
|
46
|
+
# return industries
|
|
41
47
|
|
|
42
|
-
@validator('creat_date', 'updt_date', pre=True)
|
|
43
|
-
def parse_date(cls, value):
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
# @validator('creat_date', 'updt_date', pre=True)
|
|
49
|
+
# def parse_date(cls, value):
|
|
50
|
+
# if value is None:
|
|
51
|
+
# return value
|
|
52
|
+
# if isinstance(value, datetime):
|
|
53
|
+
# return value
|
|
54
|
+
# try:
|
|
55
|
+
# # Assuming Firestore returns an ISO 8601 string, adjust if necessary
|
|
56
|
+
# print("Putting Updt or Creat date in a valid format in a Validator when creating Organisation object")
|
|
57
|
+
# return dateutil.parser.isoparse(value)
|
|
58
|
+
# except (TypeError, ValueError):
|
|
59
|
+
# raise ValidationError(f"Invalid datetime format inside Organisation: {value}")
|
|
54
60
|
|
|
55
61
|
|
|
56
|
-
### Description, Industries, and Website are optional for Retail Customer and mandatory for Non Retail Customer
|
|
57
|
-
@validator('description', 'industries', 'website', pre=True, always=True)
|
|
58
|
-
def validate_optional_fields(cls, value, values):
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
# ### Description, Industries, and Website are optional for Retail Customer and mandatory for Non Retail Customer
|
|
63
|
+
# @validator('description', 'industries', 'website', pre=True, always=True)
|
|
64
|
+
# def validate_optional_fields(cls, value, values):
|
|
65
|
+
# if values.get('name') == 'Retail Customer' and values.get('relations') == {"retail_customer"} or values.get('relations') == ["retail_customer"]:
|
|
66
|
+
# if value is not None:
|
|
67
|
+
# raise ValueError("For 'Retail Customer' with only 'retail_customer' relations, description, industries, and website should not be provided.")
|
|
68
|
+
# else:
|
|
69
|
+
# if value is None:
|
|
70
|
+
# raise ValueError("For Non Retail Customer, description, industries, and website are mandatory.")
|
|
71
|
+
# return value
|
|
@@ -1,189 +1,115 @@
|
|
|
1
|
-
import uuid
|
|
2
|
-
from datetime import datetime
|
|
3
|
-
from pydantic import BaseModel, validator, ValidationError
|
|
4
|
-
from typing import Dict, Any, Set, Optional
|
|
5
|
-
from . import pulse_enums as enums
|
|
1
|
+
# import uuid
|
|
2
|
+
# from datetime import datetime
|
|
3
|
+
# from pydantic import BaseModel, validator, ValidationError
|
|
4
|
+
# from typing import Dict, Any, Set, Optional
|
|
6
5
|
|
|
7
|
-
import dateutil.parser
|
|
6
|
+
# import dateutil.parser
|
|
8
7
|
|
|
9
|
-
CLASS_VERSION = 1.0
|
|
10
|
-
CLASS_REF = "resdes"
|
|
11
|
-
MODULE = "core"
|
|
8
|
+
# CLASS_VERSION = 1.0
|
|
9
|
+
# CLASS_REF = "resdes"
|
|
10
|
+
# MODULE = "core"
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
# "resr_puid_or_name":"Users",
|
|
15
|
-
# "resr_path":"firestore/Users",
|
|
16
|
-
# "resr_name":"Users",
|
|
17
|
-
# "resr_pulse_module":MODULE,
|
|
18
|
-
# "resr_type":"firestore_collection",
|
|
19
|
-
# "resr_classifications":{ "auth_required_confidential"},
|
|
20
|
-
# "resr_contents":{"user_core_profile"},
|
|
21
|
-
# "resr_original_or_processed":"original_source",
|
|
22
|
-
# "resr_origin":"internal",
|
|
23
|
-
# "resr_origin_organisations_uids":{"20231220futureedgegroup_coreorgn"},
|
|
24
|
-
# }
|
|
12
|
+
# class ResourceCatalogItem(BaseModel):
|
|
25
13
|
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
# "resr_creat_date":datetime(2023, 12, 23),
|
|
58
|
-
# "resr_creat_by_user":"Russlan Ramdowar;russlan@ftredge.com",
|
|
59
|
-
# "metadata_updt_date":datetime(2023, 12, 23),
|
|
60
|
-
# "metadata_updt_by_user":"Russlan Ramdowar;russlan@ftredge.com"}
|
|
61
|
-
|
|
62
|
-
# metadata={"resr_classification":"auth_required_confidential",
|
|
63
|
-
# "resr_readable_by": ["owner", "selected_by_admin"],
|
|
64
|
-
# "resr_updatable_by": ["admin"],
|
|
65
|
-
# "resr_original_or_processed" : "original_source",
|
|
66
|
-
# "resr_origin":"internal",
|
|
67
|
-
# "resr_origin_organisation_uids":["20231220futureedgegroup_coreorgn"],
|
|
68
|
-
# "resr_origin_description":"Original User field",
|
|
69
|
-
# "resr_creat_date":datetime(2023, 12, 23),
|
|
70
|
-
# "resr_creat_by_user":"Russlan Ramdowar",
|
|
71
|
-
# "metadata_updt_date":datetime(2023, 12, 23),
|
|
72
|
-
# "metadata_updt_by_user":"Russlan Ramdowar"}
|
|
73
|
-
|
|
74
|
-
# metadata={"resr_classification":"auth_required_confidential",
|
|
75
|
-
# "resr_readable_by": ["owner", "selected_by_admin"],
|
|
76
|
-
# "resr_updatable_by": ["selected_by_admin"],
|
|
77
|
-
# "resr_original_or_processed" : "original_source",
|
|
78
|
-
# "resr_origin":"internal",
|
|
79
|
-
# "resr_origin_organisation_uids":["20231220futureedgegroup_coreorgn"],
|
|
80
|
-
# "resr_origin_description":"Original User field",
|
|
81
|
-
# "resr_creat_date":datetime(2023, 12, 23),
|
|
82
|
-
# "resr_creat_by_user":"Russlan Ramdowar",
|
|
83
|
-
# "metadata_updt_date":datetime(2023, 12, 23),
|
|
84
|
-
# "metadata_updt_by_user":"Russlan Ramdowar"}
|
|
85
|
-
|
|
86
|
-
class ResourceCatalogItem(BaseModel):
|
|
87
|
-
|
|
88
|
-
resr_puid_or_name: str #Ex: username
|
|
89
|
-
resr_path: str #Ex: ipulse-401013/cloud/firesotre/Users/{user_uid}/username
|
|
90
|
-
resr_name: str #Ex: username
|
|
91
|
-
resr_pulse_module: str #Ex: core
|
|
92
|
-
resr_type: str
|
|
93
|
-
resr_classifications: Set[str]
|
|
94
|
-
resr_contents:Set[str]
|
|
95
|
-
resr_original_or_processed: str
|
|
96
|
-
resr_origin: str
|
|
97
|
-
resr_origin_organisations_uids: Set[str]
|
|
98
|
-
resr_origin_description: str
|
|
99
|
-
resr_licences_types: Set[str]
|
|
100
|
-
resr_description_details: str
|
|
101
|
-
resr_updtbl_by_non_staff: bool
|
|
102
|
-
resr_creat_by_user_uid: str
|
|
103
|
-
resr_creat_date: datetime
|
|
104
|
-
class_version:float = CLASS_VERSION
|
|
105
|
-
resr_columns_count: int
|
|
106
|
-
resr_columns: Optional[Dict[Any, Any]] = None #OPTIONAL
|
|
107
|
-
resr_structure_version: Optional[str]=None # OPTIONAL
|
|
108
|
-
resr_structure_updt_date: Optional[str]=None #OPTIONAL
|
|
109
|
-
resr_structure_updt_by_user_uid: Optional[str]=None # OPTIONAL
|
|
110
|
-
resr_tags: Optional[Dict[Any, Any]] = None #OPTIONAL
|
|
111
|
-
resr_content_updt_date: Optional[str]=None #OPTIONAL
|
|
112
|
-
resr_content_updt_by_user_uid: Optional[str]=None # OPTIONAL
|
|
113
|
-
puid: Optional[str] = None #TO BE SETUP BY Validator
|
|
114
|
-
metadata_version: Optional[float] = None #TO BE SETUP BY Validator
|
|
115
|
-
metadata_creat_date: Optional[datetime] = None #TO BE SETUP BY Management Service
|
|
116
|
-
metadata_creat_by: Optional[str] = None #TO BE SETUP BY Management Service
|
|
117
|
-
metadata_updt_date: Optional[datetime] = None #TO BE SETUP BY Management Service
|
|
118
|
-
metadata_updt_by: Optional[str] = None #TO BE SETUP BY Management Service
|
|
14
|
+
# resr_puid_or_name: str #Ex: username
|
|
15
|
+
# resr_path: str #Ex: ipulse-401013/cloud/firesotre/Users/{user_uid}/username
|
|
16
|
+
# resr_name: str #Ex: username
|
|
17
|
+
# resr_pulse_module: str #Ex: core
|
|
18
|
+
# resr_type: str
|
|
19
|
+
# resr_classifications: Set[str]
|
|
20
|
+
# resr_contents:Set[str]
|
|
21
|
+
# resr_original_or_processed: str
|
|
22
|
+
# resr_origin: str
|
|
23
|
+
# resr_origin_organisations_uids: Set[str]
|
|
24
|
+
# resr_origin_description: str
|
|
25
|
+
# resr_licences_types: Set[str]
|
|
26
|
+
# resr_description_details: str
|
|
27
|
+
# resr_updtbl_by_non_staff: bool
|
|
28
|
+
# resr_creat_by_user_uid: str
|
|
29
|
+
# resr_creat_date: datetime
|
|
30
|
+
# class_version:float = CLASS_VERSION
|
|
31
|
+
# resr_columns_count: int
|
|
32
|
+
# resr_columns: Optional[Dict[Any, Any]] = None #OPTIONAL
|
|
33
|
+
# resr_structure_version: Optional[str]=None # OPTIONAL
|
|
34
|
+
# resr_structure_updt_date: Optional[str]=None #OPTIONAL
|
|
35
|
+
# resr_structure_updt_by_user_uid: Optional[str]=None # OPTIONAL
|
|
36
|
+
# resr_tags: Optional[Dict[Any, Any]] = None #OPTIONAL
|
|
37
|
+
# resr_content_updt_date: Optional[str]=None #OPTIONAL
|
|
38
|
+
# resr_content_updt_by_user_uid: Optional[str]=None # OPTIONAL
|
|
39
|
+
# puid: Optional[str] = None #TO BE SETUP BY Validator
|
|
40
|
+
# metadata_version: Optional[float] = None #TO BE SETUP BY Validator
|
|
41
|
+
# metadata_creat_date: Optional[datetime] = None #TO BE SETUP BY Management Service
|
|
42
|
+
# metadata_creat_by: Optional[str] = None #TO BE SETUP BY Management Service
|
|
43
|
+
# metadata_updt_date: Optional[datetime] = None #TO BE SETUP BY Management Service
|
|
44
|
+
# metadata_updt_by: Optional[str] = None #TO BE SETUP BY Management Service
|
|
119
45
|
|
|
120
|
-
@validator('puid', pre=True, always=True)
|
|
121
|
-
def set_puid(cls, puid, values):
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
46
|
+
# @validator('puid', pre=True, always=True)
|
|
47
|
+
# def set_puid(cls, puid, values):
|
|
48
|
+
# if puid is None:
|
|
49
|
+
# return f"{datetime.utcnow().strftime('%Y%m%d%H%M')}{uuid.uuid4().hex[:8]}_{MODULE}{CLASS_REF}".lower()
|
|
50
|
+
# return puid
|
|
125
51
|
|
|
126
|
-
@validator('metadata_version', pre=True, always=True)
|
|
127
|
-
def set_metadata_version(cls, metadata_version, values):
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
52
|
+
# @validator('metadata_version', pre=True, always=True)
|
|
53
|
+
# def set_metadata_version(cls, metadata_version, values):
|
|
54
|
+
# if metadata_version is None:
|
|
55
|
+
# return 1.0
|
|
56
|
+
# else:
|
|
57
|
+
# return metadata_version + 0.1
|
|
132
58
|
|
|
133
59
|
|
|
134
|
-
@validator('resr_pulse_module', pre=True, always=True)
|
|
135
|
-
def validate_resr_pulse_module(cls, resr_pulse_modules):
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
60
|
+
# @validator('resr_pulse_module', pre=True, always=True)
|
|
61
|
+
# def validate_resr_pulse_module(cls, resr_pulse_modules):
|
|
62
|
+
# if resr_pulse_modules not in enums.pulse_modules:
|
|
63
|
+
# raise ValueError("Invalid pulse_modules values provided.")
|
|
64
|
+
# return resr_pulse_modules
|
|
139
65
|
|
|
140
|
-
@validator('resr_type', pre=True, always=True)
|
|
141
|
-
def validate_resr_type(cls, resr_type):
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
66
|
+
# @validator('resr_type', pre=True, always=True)
|
|
67
|
+
# def validate_resr_type(cls, resr_type):
|
|
68
|
+
# if resr_type not in enums.resource_types:
|
|
69
|
+
# raise ValueError("Invalid resource_types value provided.")
|
|
70
|
+
# return resr_type
|
|
145
71
|
|
|
146
|
-
@validator('resr_classifications', pre=True, always=True)
|
|
147
|
-
def validate_resr_classifications(cls, resr_classifications):
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
72
|
+
# @validator('resr_classifications', pre=True, always=True)
|
|
73
|
+
# def validate_resr_classifications(cls, resr_classifications):
|
|
74
|
+
# if not resr_classifications.issubset(enums.resource_classifications):
|
|
75
|
+
# raise ValueError("Invalid resr_classifications values provided.")
|
|
76
|
+
# return resr_classifications
|
|
151
77
|
|
|
152
|
-
@validator('resr_contents', pre=True, always=True)
|
|
153
|
-
def validate_resr_contents(cls, resr_contents):
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
78
|
+
# @validator('resr_contents', pre=True, always=True)
|
|
79
|
+
# def validate_resr_contents(cls, resr_contents):
|
|
80
|
+
# if not resr_contents.issubset(enums.resource_contents):
|
|
81
|
+
# raise ValueError("Invalid resr_contents values provided.")
|
|
82
|
+
# return resr_contents
|
|
157
83
|
|
|
158
|
-
@validator('resr_original_or_processed', pre=True, always=True)
|
|
159
|
-
def validate_resr_original_or_processed(cls, resr_original_or_processed):
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
84
|
+
# @validator('resr_original_or_processed', pre=True, always=True)
|
|
85
|
+
# def validate_resr_original_or_processed(cls, resr_original_or_processed):
|
|
86
|
+
# if resr_original_or_processed not in enums.resource_original_or_processed:
|
|
87
|
+
# raise ValueError("Invalid resr_original_or_processed value provided.")
|
|
88
|
+
# return resr_original_or_processed
|
|
163
89
|
|
|
164
|
-
@validator('resr_origin', pre=True, always=True)
|
|
165
|
-
def validate_resr_origin(cls, resr_origin):
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
90
|
+
# @validator('resr_origin', pre=True, always=True)
|
|
91
|
+
# def validate_resr_origin(cls, resr_origin):
|
|
92
|
+
# if resr_origin not in enums.resource_origins:
|
|
93
|
+
# raise ValueError("Invalid resource_origins value provided.")
|
|
94
|
+
# return resr_origin
|
|
169
95
|
|
|
170
96
|
|
|
171
|
-
@validator('metadata_creat_date', 'metadata_updt_date', pre=True)
|
|
172
|
-
def parse_date(cls, value):
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
97
|
+
# @validator('metadata_creat_date', 'metadata_updt_date', pre=True)
|
|
98
|
+
# def parse_date(cls, value):
|
|
99
|
+
# if value is None:
|
|
100
|
+
# return value
|
|
101
|
+
# if isinstance(value, datetime):
|
|
102
|
+
# return value
|
|
103
|
+
# try:
|
|
104
|
+
# # Assuming Firestore returns an ISO 8601 string, adjust if necessary
|
|
105
|
+
# return dateutil.parser.isoparse(value)
|
|
106
|
+
# except (TypeError, ValueError):
|
|
107
|
+
# raise ValidationError(f"Invalid datetime format inside Resource Description: {value}")
|
|
182
108
|
|
|
183
109
|
|
|
184
110
|
|
|
185
|
-
@validator('metadata_updt_date', 'metadata_updt_date', pre=True, always=True)
|
|
186
|
-
def set_default_updt_date(cls, date, values):
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
111
|
+
# @validator('metadata_updt_date', 'metadata_updt_date', pre=True, always=True)
|
|
112
|
+
# def set_default_updt_date(cls, date, values):
|
|
113
|
+
# if date is None:
|
|
114
|
+
# return datetime.utcnow().isoformat()
|
|
115
|
+
# return date
|
|
@@ -33,9 +33,9 @@ class UserProfile(BaseModel):
|
|
|
33
33
|
provider_id: str #User can Read only
|
|
34
34
|
|
|
35
35
|
username: Optional[str] = None #User can Read and Edit
|
|
36
|
-
dob: Optional[date] = None #User can Read and Edit
|
|
37
|
-
first_name: Optional[str] = None #User can Read and Edit
|
|
38
|
-
last_name: Optional[str] = None #User can Read and Edit
|
|
36
|
+
dob: Optional[date] = None #User can Read and Edit
|
|
37
|
+
first_name: Optional[str] = None #User can Read and Edit
|
|
38
|
+
last_name: Optional[str] = None #User can Read and Edit
|
|
39
39
|
mobile: Optional[str] = None #User can Read and Edit
|
|
40
40
|
class Config:
|
|
41
41
|
extra = "forbid"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
# pylint: disable=missing-function-docstring
|
|
3
|
+
# pylint: disable=logging-fstring-interpolation
|
|
4
|
+
# pylint: disable=line-too-long
|
|
5
|
+
# pylint: disable=missing-class-docstring
|
|
6
|
+
# pylint: disable=broad-exception-caught
|
|
7
|
+
|
|
8
|
+
def list_as_strings(*enums):
|
|
9
|
+
"""Converts a list of Enum members to their string values."""
|
|
10
|
+
return [str(enum) for enum in enums]
|
{ipulse_shared_core_ftredge-2.56.dist-info → ipulse_shared_core_ftredge-3.1.1.dist-info}/METADATA
RENAMED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ipulse_shared_core_ftredge
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.1.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
|
|
7
7
|
License-File: LICENCE
|
|
8
|
-
Requires-Dist: pydantic[email]
|
|
9
|
-
Requires-Dist: python-dateutil
|
|
10
|
-
Requires-Dist: pytest
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist: google-cloud-error-reporting ~=1.11.0
|
|
13
|
-
Requires-Dist: google-cloud-bigquery ~=3.24.0
|
|
8
|
+
Requires-Dist: pydantic[email]~=2.5
|
|
9
|
+
Requires-Dist: python-dateutil~=2.8
|
|
10
|
+
Requires-Dist: pytest~=7.1
|
|
11
|
+
Requires-Dist: ipulse-shared-base-ftredge>=2.2.2
|
|
14
12
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ipulse_shared_core_ftredge/__init__.py,sha256=hf0BHemiYQq2MUEskvJOAadp7wa02cOjLoWuhyGosmQ,345
|
|
2
|
+
ipulse_shared_core_ftredge/models/__init__.py,sha256=MeGH2ZBxkrwldUiWyUaI_TMyfq78tuSwRkN_mEfKD8U,161
|
|
3
|
+
ipulse_shared_core_ftredge/models/organisation.py,sha256=22esRGYuJmKN3papkgozleEmDNJrVwUgIzKp7annvWs,3280
|
|
4
|
+
ipulse_shared_core_ftredge/models/resource_catalog_item.py,sha256=mEGX8AftzrhEHqFVXjr62CuRnXC1vK4z3bHl_XBJodU,4964
|
|
5
|
+
ipulse_shared_core_ftredge/models/user_auth.py,sha256=35HNN7ZW4ZELCqaJrAtoSsVLFAZ1KL2S_VmuzbcEMm4,119
|
|
6
|
+
ipulse_shared_core_ftredge/models/user_profile.py,sha256=D3BB9D6XEv7IVZgsURgf0hWmUZW5rms3uiBXS0ZGLeE,1927
|
|
7
|
+
ipulse_shared_core_ftredge/models/user_profile_update.py,sha256=oKK0XsQDKkgDvjFPhX2XlqEqlKLBQ4AkvPHXEuZbFMY,1712
|
|
8
|
+
ipulse_shared_core_ftredge/models/user_status.py,sha256=8TyRd8tBK9_xb0MPKbI5pn9-lX7ovKbeiuWYYPtIOiw,3202
|
|
9
|
+
ipulse_shared_core_ftredge/utils/__init__.py,sha256=Yziq9yAHlOeXTa4LuBWSxZqBMBMfq0XBc0XtcS7lFfw,88
|
|
10
|
+
ipulse_shared_core_ftredge/utils/utils_common.py,sha256=bxpRcd_uI2LyqbgyNquLarqOwXFnFxA-pDAn0JKRlqs,388
|
|
11
|
+
ipulse_shared_core_ftredge-3.1.1.dist-info/LICENCE,sha256=YBtYAXNqCCOo9Mr2hfkbSPAM9CeAr2j1VZBSwQTrNwE,1060
|
|
12
|
+
ipulse_shared_core_ftredge-3.1.1.dist-info/METADATA,sha256=uey1h-BPb2LoF2rN0zQHjrel8Myb0cYkbt8U6QATTTs,464
|
|
13
|
+
ipulse_shared_core_ftredge-3.1.1.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
14
|
+
ipulse_shared_core_ftredge-3.1.1.dist-info/top_level.txt,sha256=8sgYrptpexkA_6_HyGvho26cVFH9kmtGvaK8tHbsGHk,27
|
|
15
|
+
ipulse_shared_core_ftredge-3.1.1.dist-info/RECORD,,
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# pylint: disable=missing-module-docstring
|
|
3
|
-
# pylint: disable=missing-function-docstring
|
|
4
|
-
# pylint: disable=missing-class-docstring
|
|
5
|
-
|
|
6
|
-
from .enums_common_utils import (LogLevel,
|
|
7
|
-
SystemsImpacted,
|
|
8
|
-
TargetLogs,
|
|
9
|
-
Unit,
|
|
10
|
-
Frequency)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
from .enums_modules import(Module,
|
|
14
|
-
SubModule,
|
|
15
|
-
BaseDataCategory)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
from .enums_module_fincore import (FinCoreCategory,
|
|
19
|
-
FincCoreSubCategory,
|
|
20
|
-
FinCoreRecordsCategory,
|
|
21
|
-
ExchangeOrPublisher)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
from .enums_data_eng import (SourcingTriggerType,
|
|
26
|
-
SourcingPipelineType,
|
|
27
|
-
DWEvent,
|
|
28
|
-
DWEventTriggerType)
|