maleo-identity 0.1.3__tar.gz → 0.1.4__tar.gz
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 maleo-identity might be problematic. Click here for more details.
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/PKG-INFO +1 -1
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/maleo_identity.egg-info/PKG-INFO +1 -1
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/maleo_identity.egg-info/SOURCES.txt +0 -1
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/pyproject.toml +1 -1
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/organization.py +0 -8
- maleo_identity-0.1.4/src/enums/patient.py +13 -0
- maleo_identity-0.1.3/src/enums/patient.py → maleo_identity-0.1.4/src/enums/user.py +2 -11
- maleo_identity-0.1.4/src/enums/user_profile.py +13 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/common.py +28 -38
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/organization.py +4 -29
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/patient.py +5 -29
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/user.py +3 -14
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/user_profile.py +4 -20
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/utils/organization.py +0 -30
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/utils/user.py +0 -30
- maleo_identity-0.1.3/src/dtos.py +0 -303
- maleo_identity-0.1.3/src/enums/user.py +0 -35
- maleo_identity-0.1.3/src/enums/user_profile.py +0 -22
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/LICENSE +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/README.md +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/maleo_identity.egg-info/dependency_links.txt +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/maleo_identity.egg-info/requires.txt +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/maleo_identity.egg-info/top_level.txt +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/setup.cfg +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/__init__.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/__init__.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/api_key.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/organization.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/organization_registration_code.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/organization_relation.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/patient.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/user.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/user_medical_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/user_organization_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/user_profile.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/user_system_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/__init__.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/api_key.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/organization_registration_code.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/organization_relation.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/user_medical_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/user_organization_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/enums/user_system_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/__init__.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/api_key.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/common.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/organization.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/organization_registration_code.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/organization_relation.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/patient.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/user.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/mixins/user_profile.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/models.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/__init__.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/api_key.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/organization_registration_code.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/organization_relation.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/user_medical_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/user_organization_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/schemas/user_system_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/__init__.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/api_key.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/organization.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/organization_registration_code.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/organization_relation.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/patient.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/user.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/user_medical_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/user_organization_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/user_profile.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/types/user_system_role.py +0 -0
- {maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/utils/__init__.py +0 -0
|
@@ -19,11 +19,3 @@ class IdentifierType(StrEnum):
|
|
|
19
19
|
@classmethod
|
|
20
20
|
def choices(cls) -> ListOfStrs:
|
|
21
21
|
return [e.value for e in cls]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class ExpandableField(StrEnum):
|
|
25
|
-
ORGANIZATION_TYPE = "organization_type"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
ListOfExpandableFields = list[ExpandableField]
|
|
29
|
-
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from maleo.types.string import ListOfStrs
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class IdentifierType(StrEnum):
|
|
6
|
+
ID = "id"
|
|
7
|
+
UUID = "uuid"
|
|
8
|
+
ID_CARD = "id_card"
|
|
9
|
+
PASSPORT = "passport"
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
13
|
+
return [e.value for e in cls]
|
|
@@ -14,18 +14,9 @@ class Granularity(StrEnum):
|
|
|
14
14
|
class IdentifierType(StrEnum):
|
|
15
15
|
ID = "id"
|
|
16
16
|
UUID = "uuid"
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
USERNAME = "username"
|
|
18
|
+
EMAIL = "email"
|
|
19
19
|
|
|
20
20
|
@classmethod
|
|
21
21
|
def choices(cls) -> ListOfStrs:
|
|
22
22
|
return [e.value for e in cls]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class ExpandableField(StrEnum):
|
|
26
|
-
GENDER = "gender"
|
|
27
|
-
BLOOD_TYPE = "blood_type"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ListOfExpandableFields = list[ExpandableField]
|
|
31
|
-
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from maleo.types.string import ListOfStrs
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class IdentifierType(StrEnum):
|
|
6
|
+
ID = "id"
|
|
7
|
+
UUID = "uuid"
|
|
8
|
+
USER_ID = "user_id"
|
|
9
|
+
ID_CARD = "id_card"
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
13
|
+
return [e.value for e in cls]
|
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
from datetime import date
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from typing import Annotated, Generic, TypeVar, Type
|
|
4
|
-
from maleo.enums.identity import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
OptKeyOrStandardSchema as OptKeyOrStandardBloodTypeSchema,
|
|
13
|
-
)
|
|
14
|
-
from maleo.metadata.schemas.gender import (
|
|
15
|
-
FullGenderMixin,
|
|
16
|
-
KeyOrStandardSchema as KeyOrStandardGenderSchema,
|
|
17
|
-
OptKeyOrStandardSchema as OptKeyOrStandardGenderSchema,
|
|
18
|
-
)
|
|
19
|
-
from maleo.metadata.schemas.medical_role import (
|
|
20
|
-
FullMedicalRoleMixin,
|
|
21
|
-
KeyOrStandardSchema as KeyOrStandardMedicalRoleSchema,
|
|
4
|
+
from maleo.enums.identity import (
|
|
5
|
+
OptBloodType,
|
|
6
|
+
BloodTypeMixin,
|
|
7
|
+
OptRhesus,
|
|
8
|
+
RhesusMixin,
|
|
9
|
+
Gender,
|
|
10
|
+
OptGender,
|
|
11
|
+
GenderMixin,
|
|
22
12
|
)
|
|
23
|
-
from maleo.
|
|
13
|
+
from maleo.enums.medical import MedicalRole, FullMedicalRoleMixin
|
|
14
|
+
from maleo.enums.organization import (
|
|
15
|
+
OrganizationRole,
|
|
16
|
+
FullOrganizationRoleMixin,
|
|
17
|
+
OrganizationType,
|
|
24
18
|
FullOrganizationTypeMixin,
|
|
25
|
-
KeyOrStandardSchema as KeyOrStandardOrganizationTypeSchema,
|
|
26
|
-
)
|
|
27
|
-
from maleo.metadata.schemas.system_role import (
|
|
28
|
-
FullSystemRoleMixin,
|
|
29
|
-
KeyOrStandardSchema as KeyOrStandardSystemRoleSchema,
|
|
30
|
-
)
|
|
31
|
-
from maleo.metadata.schemas.user_type import (
|
|
32
|
-
FullUserTypeMixin,
|
|
33
|
-
KeyOrStandardSchema as KeyOrStandardUserTypeSchema,
|
|
34
19
|
)
|
|
20
|
+
from maleo.enums.status import DataStatus as DataStatusEnum, SimpleDataStatusMixin
|
|
21
|
+
from maleo.enums.system import SystemRole, FullSystemRoleMixin
|
|
22
|
+
from maleo.enums.user import UserType, FullUserTypeMixin
|
|
35
23
|
from maleo.schemas.mixins.identity import (
|
|
36
24
|
DataIdentifier,
|
|
37
25
|
IntOrganizationId,
|
|
@@ -55,6 +43,7 @@ from ..mixins.user_profile import (
|
|
|
55
43
|
MiddleName,
|
|
56
44
|
LastName,
|
|
57
45
|
EndingTitle,
|
|
46
|
+
AvatarName,
|
|
58
47
|
AvatarUrl,
|
|
59
48
|
)
|
|
60
49
|
from ..mixins.user import Username, Email, Phone
|
|
@@ -73,8 +62,8 @@ class APIKeySchema(
|
|
|
73
62
|
|
|
74
63
|
class PatientSchema(
|
|
75
64
|
RhesusMixin[OptRhesus],
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
BloodTypeMixin[OptBloodType],
|
|
66
|
+
GenderMixin[Gender],
|
|
78
67
|
DateOfBirth[date],
|
|
79
68
|
PlaceOfBirth[OptStr],
|
|
80
69
|
FullName[str],
|
|
@@ -111,7 +100,7 @@ class OrganizationRegistrationCodeSchemaMixin(BaseModel):
|
|
|
111
100
|
class StandardOrganizationSchema(
|
|
112
101
|
OrganizationName[str],
|
|
113
102
|
OrganizationKey[str],
|
|
114
|
-
FullOrganizationTypeMixin[
|
|
103
|
+
FullOrganizationTypeMixin[OrganizationType],
|
|
115
104
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
116
105
|
LifecycleTimestamp,
|
|
117
106
|
DataIdentifier,
|
|
@@ -190,7 +179,7 @@ class OrganizationSchemaMixin(BaseModel, Generic[AnyOrganizationSchemaT]):
|
|
|
190
179
|
|
|
191
180
|
|
|
192
181
|
class UserMedicalRoleSchema(
|
|
193
|
-
FullMedicalRoleMixin[
|
|
182
|
+
FullMedicalRoleMixin[MedicalRole],
|
|
194
183
|
IntOrganizationId[int],
|
|
195
184
|
IntUserId[int],
|
|
196
185
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
@@ -208,7 +197,7 @@ class UserMedicalRolesSchemaMixin(BaseModel):
|
|
|
208
197
|
|
|
209
198
|
|
|
210
199
|
class UserOrganizationRoleSchema(
|
|
211
|
-
FullOrganizationRoleMixin[
|
|
200
|
+
FullOrganizationRoleMixin[OrganizationRole],
|
|
212
201
|
IntOrganizationId[int],
|
|
213
202
|
IntUserId[int],
|
|
214
203
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
@@ -226,9 +215,10 @@ class UserOrganizationRolesSchemaMixin(BaseModel):
|
|
|
226
215
|
|
|
227
216
|
|
|
228
217
|
class UserProfileSchema(
|
|
229
|
-
AvatarUrl[
|
|
230
|
-
|
|
231
|
-
|
|
218
|
+
AvatarUrl[OptStr],
|
|
219
|
+
AvatarName[str],
|
|
220
|
+
BloodTypeMixin[OptBloodType],
|
|
221
|
+
GenderMixin[OptGender],
|
|
232
222
|
BirthDate[OptDate],
|
|
233
223
|
BirthPlace[OptStr],
|
|
234
224
|
FullName[str],
|
|
@@ -256,7 +246,7 @@ class UserProfileSchemaMixin(BaseModel):
|
|
|
256
246
|
|
|
257
247
|
|
|
258
248
|
class UserSystemRoleSchema(
|
|
259
|
-
FullSystemRoleMixin[
|
|
249
|
+
FullSystemRoleMixin[SystemRole],
|
|
260
250
|
IntUserId[int],
|
|
261
251
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
262
252
|
LifecycleTimestamp,
|
|
@@ -281,7 +271,7 @@ class StandardUserSchema(
|
|
|
281
271
|
Phone[str],
|
|
282
272
|
Email[str],
|
|
283
273
|
Username[str],
|
|
284
|
-
FullUserTypeMixin[
|
|
274
|
+
FullUserTypeMixin[UserType],
|
|
285
275
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
286
276
|
LifecycleTimestamp,
|
|
287
277
|
DataIdentifier,
|
|
@@ -32,38 +32,23 @@ from maleo.types.dict import StrToAnyDict
|
|
|
32
32
|
from maleo.types.integer import OptInt, OptListOfInts
|
|
33
33
|
from maleo.types.string import OptStr, OptListOfStrs
|
|
34
34
|
from maleo.types.uuid import OptListOfUUIDs
|
|
35
|
-
from ..enums.organization import IdentifierType
|
|
35
|
+
from ..enums.organization import IdentifierType
|
|
36
36
|
from ..mixins.organization import Key, Name
|
|
37
37
|
from ..types.organization import IdentifierValueType
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
class Expand(BaseModel):
|
|
41
|
-
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
42
|
-
None
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class CreateQuery(Expand):
|
|
47
|
-
pass
|
|
48
|
-
|
|
49
|
-
|
|
50
40
|
class InsertData(Name[str], Key[str], FullOrganizationTypeMixin[OrganizationType]):
|
|
51
41
|
pass
|
|
52
42
|
|
|
53
43
|
|
|
54
|
-
class
|
|
44
|
+
class CreateParameter(InsertData):
|
|
55
45
|
related_to: Annotated[OptInt, Field(None, description="Related to", ge=1)] = None
|
|
56
46
|
relation: Annotated[
|
|
57
47
|
OptOrganizationRelation, Field(None, description="Relation")
|
|
58
48
|
] = None
|
|
59
49
|
|
|
60
50
|
|
|
61
|
-
class CreateParameter(CreateQuery, CreateData):
|
|
62
|
-
pass
|
|
63
|
-
|
|
64
|
-
|
|
65
51
|
class ReadMultipleParameter(
|
|
66
|
-
Expand,
|
|
67
52
|
ReadPaginatedMultipleParameter,
|
|
68
53
|
Names[OptListOfStrs],
|
|
69
54
|
Keys[OptListOfStrs],
|
|
@@ -84,7 +69,6 @@ class ReadMultipleParameter(
|
|
|
84
69
|
"page",
|
|
85
70
|
"limit",
|
|
86
71
|
"use_cache",
|
|
87
|
-
"expand",
|
|
88
72
|
}
|
|
89
73
|
|
|
90
74
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -97,9 +81,7 @@ class ReadMultipleParameter(
|
|
|
97
81
|
return params
|
|
98
82
|
|
|
99
83
|
|
|
100
|
-
class ReadSingleParameter(
|
|
101
|
-
Expand, BaseReadSingleParameter[IdentifierType, IdentifierValueType]
|
|
102
|
-
):
|
|
84
|
+
class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
|
|
103
85
|
@overload
|
|
104
86
|
@classmethod
|
|
105
87
|
def new(
|
|
@@ -108,7 +90,6 @@ class ReadSingleParameter(
|
|
|
108
90
|
identifier_value: int,
|
|
109
91
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
110
92
|
use_cache: bool = True,
|
|
111
|
-
expand: OptListOfExpandableFields = None,
|
|
112
93
|
) -> "ReadSingleParameter": ...
|
|
113
94
|
@overload
|
|
114
95
|
@classmethod
|
|
@@ -118,7 +99,6 @@ class ReadSingleParameter(
|
|
|
118
99
|
identifier_value: UUID,
|
|
119
100
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
120
101
|
use_cache: bool = True,
|
|
121
|
-
expand: OptListOfExpandableFields = None,
|
|
122
102
|
) -> "ReadSingleParameter": ...
|
|
123
103
|
@overload
|
|
124
104
|
@classmethod
|
|
@@ -128,7 +108,6 @@ class ReadSingleParameter(
|
|
|
128
108
|
identifier_value: str,
|
|
129
109
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
130
110
|
use_cache: bool = True,
|
|
131
|
-
expand: OptListOfExpandableFields = None,
|
|
132
111
|
) -> "ReadSingleParameter": ...
|
|
133
112
|
@classmethod
|
|
134
113
|
def new(
|
|
@@ -137,19 +116,17 @@ class ReadSingleParameter(
|
|
|
137
116
|
identifier_value: IdentifierValueType,
|
|
138
117
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
139
118
|
use_cache: bool = True,
|
|
140
|
-
expand: OptListOfExpandableFields = None,
|
|
141
119
|
) -> "ReadSingleParameter":
|
|
142
120
|
return cls(
|
|
143
121
|
identifier_type=identifier_type,
|
|
144
122
|
identifier_value=identifier_value,
|
|
145
123
|
statuses=statuses,
|
|
146
124
|
use_cache=use_cache,
|
|
147
|
-
expand=expand,
|
|
148
125
|
)
|
|
149
126
|
|
|
150
127
|
def to_query_params(self) -> StrToAnyDict:
|
|
151
128
|
return self.model_dump(
|
|
152
|
-
mode="json", include={"statuses", "use_cache"
|
|
129
|
+
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
153
130
|
)
|
|
154
131
|
|
|
155
132
|
|
|
@@ -171,7 +148,6 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
171
148
|
|
|
172
149
|
|
|
173
150
|
class UpdateParameter(
|
|
174
|
-
Expand,
|
|
175
151
|
UpdateDataMixin[UpdateDataT],
|
|
176
152
|
IdentifierTypeValue[
|
|
177
153
|
IdentifierType,
|
|
@@ -183,7 +159,6 @@ class UpdateParameter(
|
|
|
183
159
|
|
|
184
160
|
|
|
185
161
|
class StatusUpdateParameter(
|
|
186
|
-
Expand,
|
|
187
162
|
BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
|
|
188
163
|
):
|
|
189
164
|
pass
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import date
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Generic, Literal, TypeVar, overload
|
|
4
4
|
from uuid import UUID
|
|
5
5
|
from maleo.enums.identity import (
|
|
6
6
|
OptBloodType,
|
|
@@ -43,23 +43,13 @@ from maleo.types.dict import StrToAnyDict
|
|
|
43
43
|
from maleo.types.integer import OptListOfInts
|
|
44
44
|
from maleo.types.string import OptStr, OptListOfStrs
|
|
45
45
|
from maleo.types.uuid import OptListOfUUIDs
|
|
46
|
-
from ..enums.patient import IdentifierType
|
|
46
|
+
from ..enums.patient import IdentifierType
|
|
47
47
|
from ..mixins.common import IdCard, FullName, PlaceOfBirth
|
|
48
48
|
from ..mixins.patient import PatientIdentifier
|
|
49
49
|
from ..types.patient import IdentifierValueType
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
class
|
|
53
|
-
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
54
|
-
None
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class CreateQuery(Expand):
|
|
59
|
-
pass
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class CreateData(
|
|
52
|
+
class CreateParameter(
|
|
63
53
|
RhesusMixin[OptRhesus],
|
|
64
54
|
BloodTypeMixin[OptBloodType],
|
|
65
55
|
GenderMixin[Gender],
|
|
@@ -72,12 +62,7 @@ class CreateData(
|
|
|
72
62
|
pass
|
|
73
63
|
|
|
74
64
|
|
|
75
|
-
class CreateParameter(CreateQuery, CreateData):
|
|
76
|
-
pass
|
|
77
|
-
|
|
78
|
-
|
|
79
65
|
class ReadMultipleParameter(
|
|
80
|
-
Expand,
|
|
81
66
|
ReadPaginatedMultipleParameter,
|
|
82
67
|
RhesusesMixin[OptListOfRhesuses],
|
|
83
68
|
BloodTypesMixin[OptListOfBloodTypes],
|
|
@@ -115,9 +100,7 @@ class ReadMultipleParameter(
|
|
|
115
100
|
return params
|
|
116
101
|
|
|
117
102
|
|
|
118
|
-
class ReadSingleParameter(
|
|
119
|
-
Expand, BaseReadSingleParameter[IdentifierType, IdentifierValueType]
|
|
120
|
-
):
|
|
103
|
+
class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
|
|
121
104
|
@overload
|
|
122
105
|
@classmethod
|
|
123
106
|
def new(
|
|
@@ -126,7 +109,6 @@ class ReadSingleParameter(
|
|
|
126
109
|
identifier_value: int,
|
|
127
110
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
128
111
|
use_cache: bool = True,
|
|
129
|
-
expand: OptListOfExpandableFields = None,
|
|
130
112
|
) -> "ReadSingleParameter": ...
|
|
131
113
|
@overload
|
|
132
114
|
@classmethod
|
|
@@ -136,7 +118,6 @@ class ReadSingleParameter(
|
|
|
136
118
|
identifier_value: UUID,
|
|
137
119
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
138
120
|
use_cache: bool = True,
|
|
139
|
-
expand: OptListOfExpandableFields = None,
|
|
140
121
|
) -> "ReadSingleParameter": ...
|
|
141
122
|
@overload
|
|
142
123
|
@classmethod
|
|
@@ -146,7 +127,6 @@ class ReadSingleParameter(
|
|
|
146
127
|
identifier_value: str,
|
|
147
128
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
148
129
|
use_cache: bool = True,
|
|
149
|
-
expand: OptListOfExpandableFields = None,
|
|
150
130
|
) -> "ReadSingleParameter": ...
|
|
151
131
|
@classmethod
|
|
152
132
|
def new(
|
|
@@ -155,19 +135,17 @@ class ReadSingleParameter(
|
|
|
155
135
|
identifier_value: IdentifierValueType,
|
|
156
136
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
157
137
|
use_cache: bool = True,
|
|
158
|
-
expand: OptListOfExpandableFields = None,
|
|
159
138
|
) -> "ReadSingleParameter":
|
|
160
139
|
return cls(
|
|
161
140
|
identifier_type=identifier_type,
|
|
162
141
|
identifier_value=identifier_value,
|
|
163
142
|
statuses=statuses,
|
|
164
143
|
use_cache=use_cache,
|
|
165
|
-
expand=expand,
|
|
166
144
|
)
|
|
167
145
|
|
|
168
146
|
def to_query_params(self) -> StrToAnyDict:
|
|
169
147
|
return self.model_dump(
|
|
170
|
-
mode="json", include={"statuses", "use_cache"
|
|
148
|
+
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
171
149
|
)
|
|
172
150
|
|
|
173
151
|
|
|
@@ -205,7 +183,6 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
205
183
|
|
|
206
184
|
|
|
207
185
|
class UpdateParameter(
|
|
208
|
-
Expand,
|
|
209
186
|
UpdateDataMixin[UpdateDataT],
|
|
210
187
|
IdentifierTypeValue[
|
|
211
188
|
IdentifierType,
|
|
@@ -217,7 +194,6 @@ class UpdateParameter(
|
|
|
217
194
|
|
|
218
195
|
|
|
219
196
|
class StatusUpdateParameter(
|
|
220
|
-
Expand,
|
|
221
197
|
BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
|
|
222
198
|
):
|
|
223
199
|
pass
|
|
@@ -30,7 +30,7 @@ from maleo.types.dict import StrToAnyDict
|
|
|
30
30
|
from maleo.types.integer import OptListOfInts
|
|
31
31
|
from maleo.types.string import OptStr, OptListOfStrs
|
|
32
32
|
from maleo.types.uuid import OptListOfUUIDs
|
|
33
|
-
from ..enums.user import IdentifierType
|
|
33
|
+
from ..enums.user import IdentifierType
|
|
34
34
|
from ..mixins.user import (
|
|
35
35
|
Username,
|
|
36
36
|
Usernames,
|
|
@@ -42,12 +42,6 @@ from ..mixins.user import (
|
|
|
42
42
|
from ..types.user import IdentifierValueType
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
class Expand(BaseModel):
|
|
46
|
-
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
47
|
-
None
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
45
|
class CreateParameter(
|
|
52
46
|
Phone[str], Email[str], Username[str], FullUserTypeMixin[UserType]
|
|
53
47
|
):
|
|
@@ -55,7 +49,6 @@ class CreateParameter(
|
|
|
55
49
|
|
|
56
50
|
|
|
57
51
|
class ReadMultipleParameter(
|
|
58
|
-
Expand,
|
|
59
52
|
ReadPaginatedMultipleParameter,
|
|
60
53
|
Phones[OptListOfStrs],
|
|
61
54
|
Emails[OptListOfStrs],
|
|
@@ -93,9 +86,7 @@ class ReadMultipleParameter(
|
|
|
93
86
|
return params
|
|
94
87
|
|
|
95
88
|
|
|
96
|
-
class ReadSingleParameter(
|
|
97
|
-
Expand, BaseReadSingleParameter[IdentifierType, IdentifierValueType]
|
|
98
|
-
):
|
|
89
|
+
class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
|
|
99
90
|
@overload
|
|
100
91
|
@classmethod
|
|
101
92
|
def new(
|
|
@@ -140,7 +131,7 @@ class ReadSingleParameter(
|
|
|
140
131
|
|
|
141
132
|
def to_query_params(self) -> StrToAnyDict:
|
|
142
133
|
return self.model_dump(
|
|
143
|
-
mode="json", include={"statuses", "use_cache"
|
|
134
|
+
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
144
135
|
)
|
|
145
136
|
|
|
146
137
|
|
|
@@ -172,7 +163,6 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
172
163
|
|
|
173
164
|
|
|
174
165
|
class UpdateParameter(
|
|
175
|
-
Expand,
|
|
176
166
|
UpdateDataMixin[UpdateDataT],
|
|
177
167
|
IdentifierTypeValue[
|
|
178
168
|
IdentifierType,
|
|
@@ -184,7 +174,6 @@ class UpdateParameter(
|
|
|
184
174
|
|
|
185
175
|
|
|
186
176
|
class StatusUpdateParameter(
|
|
187
|
-
Expand,
|
|
188
177
|
BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
|
|
189
178
|
):
|
|
190
179
|
pass
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from maleo.enums.identity import (
|
|
5
5
|
OptBloodType,
|
|
@@ -36,7 +36,7 @@ from maleo.types.dict import StrToAnyDict
|
|
|
36
36
|
from maleo.types.integer import OptListOfInts
|
|
37
37
|
from maleo.types.string import OptStr
|
|
38
38
|
from maleo.types.uuid import OptListOfUUIDs
|
|
39
|
-
from ..enums.user_profile import IdentifierType
|
|
39
|
+
from ..enums.user_profile import IdentifierType
|
|
40
40
|
from ..mixins.common import (
|
|
41
41
|
IdCard,
|
|
42
42
|
FullName,
|
|
@@ -53,12 +53,6 @@ from ..mixins.user_profile import (
|
|
|
53
53
|
from ..types.user_profile import IdentifierValueType
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
class Expand(BaseModel):
|
|
57
|
-
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
58
|
-
None
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
|
|
62
56
|
class CoreCreateData(
|
|
63
57
|
BloodTypeMixin[OptBloodType],
|
|
64
58
|
GenderMixin[OptGender],
|
|
@@ -118,7 +112,6 @@ class CreateParameter(
|
|
|
118
112
|
|
|
119
113
|
|
|
120
114
|
class ReadMultipleParameter(
|
|
121
|
-
Expand,
|
|
122
115
|
ReadPaginatedMultipleParameter,
|
|
123
116
|
BloodTypesMixin[OptListOfBloodTypes],
|
|
124
117
|
GendersMixin[OptListOfGenders],
|
|
@@ -152,9 +145,7 @@ class ReadMultipleParameter(
|
|
|
152
145
|
return params
|
|
153
146
|
|
|
154
147
|
|
|
155
|
-
class ReadSingleParameter(
|
|
156
|
-
Expand, BaseReadSingleParameter[IdentifierType, IdentifierValueType]
|
|
157
|
-
):
|
|
148
|
+
class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
|
|
158
149
|
@overload
|
|
159
150
|
@classmethod
|
|
160
151
|
def new(
|
|
@@ -163,7 +154,6 @@ class ReadSingleParameter(
|
|
|
163
154
|
identifier_value: int,
|
|
164
155
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
165
156
|
use_cache: bool = True,
|
|
166
|
-
expand: OptListOfExpandableFields = None,
|
|
167
157
|
) -> "ReadSingleParameter": ...
|
|
168
158
|
@overload
|
|
169
159
|
@classmethod
|
|
@@ -173,7 +163,6 @@ class ReadSingleParameter(
|
|
|
173
163
|
identifier_value: UUID,
|
|
174
164
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
175
165
|
use_cache: bool = True,
|
|
176
|
-
expand: OptListOfExpandableFields = None,
|
|
177
166
|
) -> "ReadSingleParameter": ...
|
|
178
167
|
@overload
|
|
179
168
|
@classmethod
|
|
@@ -183,7 +172,6 @@ class ReadSingleParameter(
|
|
|
183
172
|
identifier_value: str,
|
|
184
173
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
185
174
|
use_cache: bool = True,
|
|
186
|
-
expand: OptListOfExpandableFields = None,
|
|
187
175
|
) -> "ReadSingleParameter": ...
|
|
188
176
|
@classmethod
|
|
189
177
|
def new(
|
|
@@ -192,19 +180,17 @@ class ReadSingleParameter(
|
|
|
192
180
|
identifier_value: IdentifierValueType,
|
|
193
181
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
194
182
|
use_cache: bool = True,
|
|
195
|
-
expand: OptListOfExpandableFields = None,
|
|
196
183
|
) -> "ReadSingleParameter":
|
|
197
184
|
return cls(
|
|
198
185
|
identifier_type=identifier_type,
|
|
199
186
|
identifier_value=identifier_value,
|
|
200
187
|
statuses=statuses,
|
|
201
188
|
use_cache=use_cache,
|
|
202
|
-
expand=expand,
|
|
203
189
|
)
|
|
204
190
|
|
|
205
191
|
def to_query_params(self) -> StrToAnyDict:
|
|
206
192
|
return self.model_dump(
|
|
207
|
-
mode="json", include={"statuses", "use_cache"
|
|
193
|
+
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
208
194
|
)
|
|
209
195
|
|
|
210
196
|
|
|
@@ -246,7 +232,6 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
246
232
|
|
|
247
233
|
|
|
248
234
|
class UpdateParameter(
|
|
249
|
-
Expand,
|
|
250
235
|
UpdateDataMixin[UpdateDataT],
|
|
251
236
|
IdentifierTypeValue[
|
|
252
237
|
IdentifierType,
|
|
@@ -258,7 +243,6 @@ class UpdateParameter(
|
|
|
258
243
|
|
|
259
244
|
|
|
260
245
|
class StatusUpdateParameter(
|
|
261
|
-
Expand,
|
|
262
246
|
BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
|
|
263
247
|
):
|
|
264
248
|
pass
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
from typing import Literal, Type, overload
|
|
2
|
-
from ..dtos import (
|
|
3
|
-
StandardOrganizationDTO,
|
|
4
|
-
FullOrganizationDTO,
|
|
5
|
-
AnyOrganizationDTOType,
|
|
6
|
-
)
|
|
7
2
|
from ..schemas.common import (
|
|
8
3
|
StandardOrganizationSchema,
|
|
9
4
|
FullOrganizationSchema,
|
|
@@ -12,31 +7,6 @@ from ..schemas.common import (
|
|
|
12
7
|
from ..enums.organization import Granularity
|
|
13
8
|
|
|
14
9
|
|
|
15
|
-
@overload
|
|
16
|
-
def get_dto_model(
|
|
17
|
-
granularity: Literal[Granularity.STANDARD],
|
|
18
|
-
/,
|
|
19
|
-
) -> Type[StandardOrganizationDTO]: ...
|
|
20
|
-
@overload
|
|
21
|
-
def get_dto_model(
|
|
22
|
-
granularity: Literal[Granularity.FULL],
|
|
23
|
-
/,
|
|
24
|
-
) -> Type[FullOrganizationDTO]: ...
|
|
25
|
-
@overload
|
|
26
|
-
def get_dto_model(
|
|
27
|
-
granularity: Granularity = Granularity.STANDARD,
|
|
28
|
-
/,
|
|
29
|
-
) -> AnyOrganizationDTOType: ...
|
|
30
|
-
def get_dto_model(
|
|
31
|
-
granularity: Granularity = Granularity.STANDARD,
|
|
32
|
-
/,
|
|
33
|
-
) -> AnyOrganizationDTOType:
|
|
34
|
-
if granularity is Granularity.STANDARD:
|
|
35
|
-
return StandardOrganizationDTO
|
|
36
|
-
elif granularity is Granularity.FULL:
|
|
37
|
-
return FullOrganizationDTO
|
|
38
|
-
|
|
39
|
-
|
|
40
10
|
@overload
|
|
41
11
|
def get_schema_model(
|
|
42
12
|
granularity: Literal[Granularity.STANDARD],
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
from typing import Literal, Type, overload
|
|
2
|
-
from ..dtos import (
|
|
3
|
-
StandardUserDTO,
|
|
4
|
-
FullUserDTO,
|
|
5
|
-
AnyUserDTOType,
|
|
6
|
-
)
|
|
7
2
|
from ..schemas.common import (
|
|
8
3
|
StandardUserSchema,
|
|
9
4
|
FullUserSchema,
|
|
@@ -12,31 +7,6 @@ from ..schemas.common import (
|
|
|
12
7
|
from ..enums.user import Granularity
|
|
13
8
|
|
|
14
9
|
|
|
15
|
-
@overload
|
|
16
|
-
def get_dto_model(
|
|
17
|
-
granularity: Literal[Granularity.STANDARD],
|
|
18
|
-
/,
|
|
19
|
-
) -> Type[StandardUserDTO]: ...
|
|
20
|
-
@overload
|
|
21
|
-
def get_dto_model(
|
|
22
|
-
granularity: Literal[Granularity.FULL],
|
|
23
|
-
/,
|
|
24
|
-
) -> Type[FullUserDTO]: ...
|
|
25
|
-
@overload
|
|
26
|
-
def get_dto_model(
|
|
27
|
-
granularity: Granularity = Granularity.STANDARD,
|
|
28
|
-
/,
|
|
29
|
-
) -> AnyUserDTOType: ...
|
|
30
|
-
def get_dto_model(
|
|
31
|
-
granularity: Granularity = Granularity.STANDARD,
|
|
32
|
-
/,
|
|
33
|
-
) -> AnyUserDTOType:
|
|
34
|
-
if granularity is Granularity.STANDARD:
|
|
35
|
-
return StandardUserDTO
|
|
36
|
-
elif granularity is Granularity.FULL:
|
|
37
|
-
return FullUserDTO
|
|
38
|
-
|
|
39
|
-
|
|
40
10
|
@overload
|
|
41
11
|
def get_schema_model(
|
|
42
12
|
granularity: Literal[Granularity.STANDARD],
|
maleo_identity-0.1.3/src/dtos.py
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
from datetime import date
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
3
|
-
from typing import Annotated, Generic, TypeVar, Type
|
|
4
|
-
from maleo.enums.identity import (
|
|
5
|
-
OptBloodType,
|
|
6
|
-
BloodTypeMixin,
|
|
7
|
-
OptRhesus,
|
|
8
|
-
RhesusMixin,
|
|
9
|
-
Gender,
|
|
10
|
-
OptGender,
|
|
11
|
-
GenderMixin,
|
|
12
|
-
)
|
|
13
|
-
from maleo.enums.medical import MedicalRole, FullMedicalRoleMixin
|
|
14
|
-
from maleo.enums.organization import (
|
|
15
|
-
OrganizationRole,
|
|
16
|
-
FullOrganizationRoleMixin,
|
|
17
|
-
OrganizationType,
|
|
18
|
-
FullOrganizationTypeMixin,
|
|
19
|
-
)
|
|
20
|
-
from maleo.enums.status import DataStatus as DataStatusEnum, SimpleDataStatusMixin
|
|
21
|
-
from maleo.enums.system import SystemRole, FullSystemRoleMixin
|
|
22
|
-
from maleo.enums.user import UserType, FullUserTypeMixin
|
|
23
|
-
from maleo.schemas.mixins.identity import (
|
|
24
|
-
DataIdentifier,
|
|
25
|
-
IntOrganizationId,
|
|
26
|
-
IntUserId,
|
|
27
|
-
BirthDate,
|
|
28
|
-
DateOfBirth,
|
|
29
|
-
)
|
|
30
|
-
from maleo.schemas.mixins.timestamp import LifecycleTimestamp
|
|
31
|
-
from maleo.types.datetime import OptDate
|
|
32
|
-
from maleo.types.string import OptStr
|
|
33
|
-
from .mixins.common import IdCard, FullName, BirthPlace, PlaceOfBirth
|
|
34
|
-
from .mixins.organization_registration_code import Code, MaxUses, CurrentUses
|
|
35
|
-
from .mixins.organization_relation import IsBidirectional, Meta
|
|
36
|
-
from .mixins.organization import Key as OrganizationKey, Name as OrganizationName
|
|
37
|
-
from .mixins.patient import PatientIdentifier
|
|
38
|
-
from .mixins.user_profile import (
|
|
39
|
-
LeadingTitle,
|
|
40
|
-
FirstName,
|
|
41
|
-
MiddleName,
|
|
42
|
-
LastName,
|
|
43
|
-
EndingTitle,
|
|
44
|
-
AvatarName,
|
|
45
|
-
)
|
|
46
|
-
from .mixins.user import Username, Email, Phone
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class PatientDTO(
|
|
50
|
-
RhesusMixin[OptRhesus],
|
|
51
|
-
BloodTypeMixin[OptBloodType],
|
|
52
|
-
GenderMixin[Gender],
|
|
53
|
-
DateOfBirth[date],
|
|
54
|
-
PlaceOfBirth[OptStr],
|
|
55
|
-
FullName[str],
|
|
56
|
-
PatientIdentifier,
|
|
57
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
58
|
-
LifecycleTimestamp,
|
|
59
|
-
DataIdentifier,
|
|
60
|
-
):
|
|
61
|
-
pass
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class OrganizationRegistrationCodeDTO(
|
|
65
|
-
CurrentUses,
|
|
66
|
-
MaxUses[int],
|
|
67
|
-
Code[str],
|
|
68
|
-
IntOrganizationId[int],
|
|
69
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
70
|
-
LifecycleTimestamp,
|
|
71
|
-
DataIdentifier,
|
|
72
|
-
):
|
|
73
|
-
pass
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
OptOrganizationRegistrationCodeDTO = OrganizationRegistrationCodeDTO | None
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class OrganizationRegistrationCodeDTOMixin(BaseModel):
|
|
80
|
-
registration_code: Annotated[
|
|
81
|
-
OptOrganizationRegistrationCodeDTO,
|
|
82
|
-
Field(None, description="Organization's registration code"),
|
|
83
|
-
] = None
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
class StandardOrganizationDTO(
|
|
87
|
-
OrganizationName[str],
|
|
88
|
-
OrganizationKey[str],
|
|
89
|
-
FullOrganizationTypeMixin[OrganizationType],
|
|
90
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
91
|
-
LifecycleTimestamp,
|
|
92
|
-
DataIdentifier,
|
|
93
|
-
):
|
|
94
|
-
pass
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class SourceOrganizationDTOMixin(BaseModel):
|
|
98
|
-
source: Annotated[
|
|
99
|
-
StandardOrganizationDTO, Field(..., description="Source organization")
|
|
100
|
-
]
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class SourceOrganizationRelationDTO(
|
|
104
|
-
Meta,
|
|
105
|
-
IsBidirectional[bool],
|
|
106
|
-
SourceOrganizationDTOMixin,
|
|
107
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
108
|
-
LifecycleTimestamp,
|
|
109
|
-
DataIdentifier,
|
|
110
|
-
):
|
|
111
|
-
pass
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class SourceOrganizationRelationsDTOMixin(BaseModel):
|
|
115
|
-
sources: Annotated[
|
|
116
|
-
list[SourceOrganizationRelationDTO],
|
|
117
|
-
Field(list[SourceOrganizationRelationDTO](), description="Sources"),
|
|
118
|
-
] = list[SourceOrganizationRelationDTO]()
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
class TargetOrganizationDTOMixin(BaseModel):
|
|
122
|
-
target: Annotated[
|
|
123
|
-
StandardOrganizationDTO, Field(..., description="Target organization")
|
|
124
|
-
]
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
class TargetOrganizationRelationDTO(
|
|
128
|
-
Meta,
|
|
129
|
-
IsBidirectional[bool],
|
|
130
|
-
TargetOrganizationDTOMixin,
|
|
131
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
132
|
-
LifecycleTimestamp,
|
|
133
|
-
DataIdentifier,
|
|
134
|
-
):
|
|
135
|
-
pass
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
class TargetOrganizationRelationsDTOMixin(BaseModel):
|
|
139
|
-
targets: Annotated[
|
|
140
|
-
list[TargetOrganizationRelationDTO],
|
|
141
|
-
Field(list[TargetOrganizationRelationDTO](), description="Targets"),
|
|
142
|
-
] = list[TargetOrganizationRelationDTO]()
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
class FullOrganizationDTO(
|
|
146
|
-
TargetOrganizationRelationsDTOMixin,
|
|
147
|
-
SourceOrganizationRelationsDTOMixin,
|
|
148
|
-
OrganizationRegistrationCodeDTOMixin,
|
|
149
|
-
StandardOrganizationDTO,
|
|
150
|
-
):
|
|
151
|
-
pass
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
AnyOrganizationDTOType = Type[StandardOrganizationDTO] | Type[FullOrganizationDTO]
|
|
155
|
-
AnyOrganizationDTO = StandardOrganizationDTO | FullOrganizationDTO
|
|
156
|
-
AnyOrganizationDTOT = TypeVar("AnyOrganizationDTOT", bound=AnyOrganizationDTO)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
class OrganizationDTOMixin(BaseModel, Generic[AnyOrganizationDTOT]):
|
|
160
|
-
organization: Annotated[AnyOrganizationDTOT, Field(..., description="Organization")]
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
class UserMedicalRoleDTO(
|
|
164
|
-
FullMedicalRoleMixin[MedicalRole],
|
|
165
|
-
IntOrganizationId[int],
|
|
166
|
-
IntUserId[int],
|
|
167
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
168
|
-
LifecycleTimestamp,
|
|
169
|
-
DataIdentifier,
|
|
170
|
-
):
|
|
171
|
-
pass
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
class UserMedicalRolesDTOMixin(BaseModel):
|
|
175
|
-
medical_roles: Annotated[
|
|
176
|
-
list[UserMedicalRoleDTO],
|
|
177
|
-
Field(list[UserMedicalRoleDTO](), description="Medical roles"),
|
|
178
|
-
] = list[UserMedicalRoleDTO]()
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
class UserOrganizationRoleDTO(
|
|
182
|
-
FullOrganizationRoleMixin[OrganizationRole],
|
|
183
|
-
IntOrganizationId[int],
|
|
184
|
-
IntUserId[int],
|
|
185
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
186
|
-
LifecycleTimestamp,
|
|
187
|
-
DataIdentifier,
|
|
188
|
-
):
|
|
189
|
-
pass
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
class UserOrganizationRolesDTOMixin(BaseModel):
|
|
193
|
-
organization_roles: Annotated[
|
|
194
|
-
list[UserOrganizationRoleDTO],
|
|
195
|
-
Field(list[UserOrganizationRoleDTO](), description="Organization roles"),
|
|
196
|
-
] = list[UserOrganizationRoleDTO]()
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
class UserProfileDTO(
|
|
200
|
-
AvatarName[str],
|
|
201
|
-
BloodTypeMixin[OptBloodType],
|
|
202
|
-
GenderMixin[OptGender],
|
|
203
|
-
BirthDate[OptDate],
|
|
204
|
-
BirthPlace[OptStr],
|
|
205
|
-
FullName[str],
|
|
206
|
-
EndingTitle[OptStr],
|
|
207
|
-
LastName[str],
|
|
208
|
-
MiddleName[OptStr],
|
|
209
|
-
FirstName[str],
|
|
210
|
-
LeadingTitle[OptStr],
|
|
211
|
-
IdCard[OptStr],
|
|
212
|
-
IntUserId[int],
|
|
213
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
214
|
-
LifecycleTimestamp,
|
|
215
|
-
DataIdentifier,
|
|
216
|
-
):
|
|
217
|
-
pass
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
OptUserProfileDTO = UserProfileDTO | None
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
class UserProfileDTOMixin(BaseModel):
|
|
224
|
-
profile: Annotated[OptUserProfileDTO, Field(None, description="User's Profile")] = (
|
|
225
|
-
None
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
class UserSystemRoleDTO(
|
|
230
|
-
FullSystemRoleMixin[SystemRole],
|
|
231
|
-
IntUserId[int],
|
|
232
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
233
|
-
LifecycleTimestamp,
|
|
234
|
-
DataIdentifier,
|
|
235
|
-
):
|
|
236
|
-
pass
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
class UserSystemRolesDTOMixin(BaseModel):
|
|
240
|
-
system_roles: Annotated[
|
|
241
|
-
list[UserSystemRoleDTO],
|
|
242
|
-
Field(
|
|
243
|
-
list[UserSystemRoleDTO](),
|
|
244
|
-
description="User's system roles",
|
|
245
|
-
min_length=1,
|
|
246
|
-
),
|
|
247
|
-
] = list[UserSystemRoleDTO]()
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
class StandardUserDTO(
|
|
251
|
-
UserProfileDTOMixin,
|
|
252
|
-
Phone[str],
|
|
253
|
-
Email[str],
|
|
254
|
-
Username[str],
|
|
255
|
-
FullUserTypeMixin[UserType],
|
|
256
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
257
|
-
LifecycleTimestamp,
|
|
258
|
-
DataIdentifier,
|
|
259
|
-
):
|
|
260
|
-
pass
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
class UserOrganizationDTO(
|
|
264
|
-
UserMedicalRolesDTOMixin,
|
|
265
|
-
UserOrganizationRolesDTOMixin,
|
|
266
|
-
OrganizationDTOMixin[StandardOrganizationDTO],
|
|
267
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
268
|
-
LifecycleTimestamp,
|
|
269
|
-
DataIdentifier,
|
|
270
|
-
):
|
|
271
|
-
pass
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
class UserOrganizationsDTOMixin(BaseModel):
|
|
275
|
-
organizations: Annotated[
|
|
276
|
-
list[UserOrganizationDTO],
|
|
277
|
-
Field(list[UserOrganizationDTO](), description="Organizations"),
|
|
278
|
-
] = list[UserOrganizationDTO]()
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
class FullUserDTO(UserOrganizationsDTOMixin, StandardUserDTO):
|
|
282
|
-
pass
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
AnyUserDTOType = Type[StandardUserDTO] | Type[FullUserDTO]
|
|
286
|
-
AnyUserDTO = StandardUserDTO | FullUserDTO
|
|
287
|
-
AnyUserDTOT = TypeVar("AnyUserDTOT", bound=AnyUserDTO)
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
class UserDTOMixin(BaseModel, Generic[AnyUserDTOT]):
|
|
291
|
-
user: Annotated[AnyUserDTOT, Field(..., description="User")]
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
class UserAndOrganizationDTO(
|
|
295
|
-
UserMedicalRolesDTOMixin,
|
|
296
|
-
UserOrganizationRolesDTOMixin,
|
|
297
|
-
OrganizationDTOMixin[StandardOrganizationDTO],
|
|
298
|
-
UserDTOMixin[StandardUserDTO],
|
|
299
|
-
SimpleDataStatusMixin[DataStatusEnum],
|
|
300
|
-
LifecycleTimestamp,
|
|
301
|
-
DataIdentifier,
|
|
302
|
-
):
|
|
303
|
-
pass
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from enum import StrEnum
|
|
2
|
-
from maleo.types.string import ListOfStrs
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Granularity(StrEnum):
|
|
6
|
-
STANDARD = "standard"
|
|
7
|
-
FULL = "full"
|
|
8
|
-
|
|
9
|
-
@classmethod
|
|
10
|
-
def choices(cls) -> ListOfStrs:
|
|
11
|
-
return [e.value for e in cls]
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class IdentifierType(StrEnum):
|
|
15
|
-
ID = "id"
|
|
16
|
-
UUID = "uuid"
|
|
17
|
-
USERNAME = "username"
|
|
18
|
-
EMAIL = "email"
|
|
19
|
-
|
|
20
|
-
@classmethod
|
|
21
|
-
def choices(cls) -> ListOfStrs:
|
|
22
|
-
return [e.value for e in cls]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class ExpandableField(StrEnum):
|
|
26
|
-
USER_TYPE = "user_type"
|
|
27
|
-
GENDER = "gender"
|
|
28
|
-
BLOOD_TYPE = "blood_type"
|
|
29
|
-
SYSTEM_ROLE = "system_role"
|
|
30
|
-
MEDICAL_ROLE = "medical_role"
|
|
31
|
-
ORGANIZATION_ROLE = "organization_role"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ListOfExpandableFields = list[ExpandableField]
|
|
35
|
-
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from enum import StrEnum
|
|
2
|
-
from maleo.types.string import ListOfStrs
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class IdentifierType(StrEnum):
|
|
6
|
-
ID = "id"
|
|
7
|
-
UUID = "uuid"
|
|
8
|
-
USER_ID = "user_id"
|
|
9
|
-
ID_CARD = "id_card"
|
|
10
|
-
|
|
11
|
-
@classmethod
|
|
12
|
-
def choices(cls) -> ListOfStrs:
|
|
13
|
-
return [e.value for e in cls]
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class ExpandableField(StrEnum):
|
|
17
|
-
GENDER = "gender"
|
|
18
|
-
BLOOD_TYPE = "blood_type"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ListOfExpandableFields = list[ExpandableField]
|
|
22
|
-
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.1.3 → maleo_identity-0.1.4}/src/constants/organization_registration_code.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|