maleo-identity 0.1.3__py3-none-any.whl → 0.1.5__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 maleo-identity might be problematic. Click here for more details.
- maleo/identity/enums/organization.py +0 -8
- maleo/identity/enums/patient.py +0 -18
- maleo/identity/enums/user.py +0 -13
- maleo/identity/enums/user_profile.py +0 -9
- maleo/identity/schemas/common.py +28 -38
- maleo/identity/schemas/organization.py +4 -29
- maleo/identity/schemas/patient.py +12 -27
- maleo/identity/schemas/user.py +3 -15
- maleo/identity/schemas/user_profile.py +4 -21
- maleo/identity/utils/organization.py +0 -30
- maleo/identity/utils/user.py +0 -30
- {maleo_identity-0.1.3.dist-info → maleo_identity-0.1.5.dist-info}/METADATA +1 -1
- {maleo_identity-0.1.3.dist-info → maleo_identity-0.1.5.dist-info}/RECORD +16 -17
- maleo/identity/dtos.py +0 -303
- {maleo_identity-0.1.3.dist-info → maleo_identity-0.1.5.dist-info}/WHEEL +0 -0
- {maleo_identity-0.1.3.dist-info → maleo_identity-0.1.5.dist-info}/licenses/LICENSE +0 -0
- {maleo_identity-0.1.3.dist-info → maleo_identity-0.1.5.dist-info}/top_level.txt +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
|
maleo/identity/enums/patient.py
CHANGED
|
@@ -2,15 +2,6 @@ from enum import StrEnum
|
|
|
2
2
|
from maleo.types.string import ListOfStrs
|
|
3
3
|
|
|
4
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
5
|
class IdentifierType(StrEnum):
|
|
15
6
|
ID = "id"
|
|
16
7
|
UUID = "uuid"
|
|
@@ -20,12 +11,3 @@ class IdentifierType(StrEnum):
|
|
|
20
11
|
@classmethod
|
|
21
12
|
def choices(cls) -> ListOfStrs:
|
|
22
13
|
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
|
maleo/identity/enums/user.py
CHANGED
|
@@ -20,16 +20,3 @@ class IdentifierType(StrEnum):
|
|
|
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
|
-
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
|
|
@@ -11,12 +11,3 @@ class IdentifierType(StrEnum):
|
|
|
11
11
|
@classmethod
|
|
12
12
|
def choices(cls) -> ListOfStrs:
|
|
13
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
|
maleo/identity/schemas/common.py
CHANGED
|
@@ -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 StandardCreateData(
|
|
63
53
|
RhesusMixin[OptRhesus],
|
|
64
54
|
BloodTypeMixin[OptBloodType],
|
|
65
55
|
GenderMixin[Gender],
|
|
@@ -67,17 +57,22 @@ class CreateData(
|
|
|
67
57
|
PlaceOfBirth[OptStr],
|
|
68
58
|
FullName[str],
|
|
69
59
|
PatientIdentifier,
|
|
60
|
+
):
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class FullCreateData(
|
|
65
|
+
StandardCreateData,
|
|
70
66
|
IntOrganizationId[int],
|
|
71
67
|
):
|
|
72
68
|
pass
|
|
73
69
|
|
|
74
70
|
|
|
75
|
-
class CreateParameter(
|
|
71
|
+
class CreateParameter(FullCreateData):
|
|
76
72
|
pass
|
|
77
73
|
|
|
78
74
|
|
|
79
75
|
class ReadMultipleParameter(
|
|
80
|
-
Expand,
|
|
81
76
|
ReadPaginatedMultipleParameter,
|
|
82
77
|
RhesusesMixin[OptListOfRhesuses],
|
|
83
78
|
BloodTypesMixin[OptListOfBloodTypes],
|
|
@@ -102,7 +97,6 @@ class ReadMultipleParameter(
|
|
|
102
97
|
"page",
|
|
103
98
|
"limit",
|
|
104
99
|
"use_cache",
|
|
105
|
-
"expand",
|
|
106
100
|
}
|
|
107
101
|
|
|
108
102
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -115,9 +109,7 @@ class ReadMultipleParameter(
|
|
|
115
109
|
return params
|
|
116
110
|
|
|
117
111
|
|
|
118
|
-
class ReadSingleParameter(
|
|
119
|
-
Expand, BaseReadSingleParameter[IdentifierType, IdentifierValueType]
|
|
120
|
-
):
|
|
112
|
+
class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
|
|
121
113
|
@overload
|
|
122
114
|
@classmethod
|
|
123
115
|
def new(
|
|
@@ -126,7 +118,6 @@ class ReadSingleParameter(
|
|
|
126
118
|
identifier_value: int,
|
|
127
119
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
128
120
|
use_cache: bool = True,
|
|
129
|
-
expand: OptListOfExpandableFields = None,
|
|
130
121
|
) -> "ReadSingleParameter": ...
|
|
131
122
|
@overload
|
|
132
123
|
@classmethod
|
|
@@ -136,7 +127,6 @@ class ReadSingleParameter(
|
|
|
136
127
|
identifier_value: UUID,
|
|
137
128
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
138
129
|
use_cache: bool = True,
|
|
139
|
-
expand: OptListOfExpandableFields = None,
|
|
140
130
|
) -> "ReadSingleParameter": ...
|
|
141
131
|
@overload
|
|
142
132
|
@classmethod
|
|
@@ -146,7 +136,6 @@ class ReadSingleParameter(
|
|
|
146
136
|
identifier_value: str,
|
|
147
137
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
148
138
|
use_cache: bool = True,
|
|
149
|
-
expand: OptListOfExpandableFields = None,
|
|
150
139
|
) -> "ReadSingleParameter": ...
|
|
151
140
|
@classmethod
|
|
152
141
|
def new(
|
|
@@ -155,19 +144,17 @@ class ReadSingleParameter(
|
|
|
155
144
|
identifier_value: IdentifierValueType,
|
|
156
145
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
157
146
|
use_cache: bool = True,
|
|
158
|
-
expand: OptListOfExpandableFields = None,
|
|
159
147
|
) -> "ReadSingleParameter":
|
|
160
148
|
return cls(
|
|
161
149
|
identifier_type=identifier_type,
|
|
162
150
|
identifier_value=identifier_value,
|
|
163
151
|
statuses=statuses,
|
|
164
152
|
use_cache=use_cache,
|
|
165
|
-
expand=expand,
|
|
166
153
|
)
|
|
167
154
|
|
|
168
155
|
def to_query_params(self) -> StrToAnyDict:
|
|
169
156
|
return self.model_dump(
|
|
170
|
-
mode="json", include={"statuses", "use_cache"
|
|
157
|
+
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
171
158
|
)
|
|
172
159
|
|
|
173
160
|
|
|
@@ -205,7 +192,6 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
205
192
|
|
|
206
193
|
|
|
207
194
|
class UpdateParameter(
|
|
208
|
-
Expand,
|
|
209
195
|
UpdateDataMixin[UpdateDataT],
|
|
210
196
|
IdentifierTypeValue[
|
|
211
197
|
IdentifierType,
|
|
@@ -217,7 +203,6 @@ class UpdateParameter(
|
|
|
217
203
|
|
|
218
204
|
|
|
219
205
|
class StatusUpdateParameter(
|
|
220
|
-
Expand,
|
|
221
206
|
BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
|
|
222
207
|
):
|
|
223
208
|
pass
|
maleo/identity/schemas/user.py
CHANGED
|
@@ -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],
|
|
@@ -80,7 +73,6 @@ class ReadMultipleParameter(
|
|
|
80
73
|
"page",
|
|
81
74
|
"limit",
|
|
82
75
|
"use_cache",
|
|
83
|
-
"expand",
|
|
84
76
|
}
|
|
85
77
|
|
|
86
78
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -93,9 +85,7 @@ class ReadMultipleParameter(
|
|
|
93
85
|
return params
|
|
94
86
|
|
|
95
87
|
|
|
96
|
-
class ReadSingleParameter(
|
|
97
|
-
Expand, BaseReadSingleParameter[IdentifierType, IdentifierValueType]
|
|
98
|
-
):
|
|
88
|
+
class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
|
|
99
89
|
@overload
|
|
100
90
|
@classmethod
|
|
101
91
|
def new(
|
|
@@ -140,7 +130,7 @@ class ReadSingleParameter(
|
|
|
140
130
|
|
|
141
131
|
def to_query_params(self) -> StrToAnyDict:
|
|
142
132
|
return self.model_dump(
|
|
143
|
-
mode="json", include={"statuses", "use_cache"
|
|
133
|
+
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
144
134
|
)
|
|
145
135
|
|
|
146
136
|
|
|
@@ -172,7 +162,6 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
172
162
|
|
|
173
163
|
|
|
174
164
|
class UpdateParameter(
|
|
175
|
-
Expand,
|
|
176
165
|
UpdateDataMixin[UpdateDataT],
|
|
177
166
|
IdentifierTypeValue[
|
|
178
167
|
IdentifierType,
|
|
@@ -184,7 +173,6 @@ class UpdateParameter(
|
|
|
184
173
|
|
|
185
174
|
|
|
186
175
|
class StatusUpdateParameter(
|
|
187
|
-
Expand,
|
|
188
176
|
BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
|
|
189
177
|
):
|
|
190
178
|
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],
|
|
@@ -139,7 +132,6 @@ class ReadMultipleParameter(
|
|
|
139
132
|
"page",
|
|
140
133
|
"limit",
|
|
141
134
|
"use_cache",
|
|
142
|
-
"expand",
|
|
143
135
|
}
|
|
144
136
|
|
|
145
137
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -152,9 +144,7 @@ class ReadMultipleParameter(
|
|
|
152
144
|
return params
|
|
153
145
|
|
|
154
146
|
|
|
155
|
-
class ReadSingleParameter(
|
|
156
|
-
Expand, BaseReadSingleParameter[IdentifierType, IdentifierValueType]
|
|
157
|
-
):
|
|
147
|
+
class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
|
|
158
148
|
@overload
|
|
159
149
|
@classmethod
|
|
160
150
|
def new(
|
|
@@ -163,7 +153,6 @@ class ReadSingleParameter(
|
|
|
163
153
|
identifier_value: int,
|
|
164
154
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
165
155
|
use_cache: bool = True,
|
|
166
|
-
expand: OptListOfExpandableFields = None,
|
|
167
156
|
) -> "ReadSingleParameter": ...
|
|
168
157
|
@overload
|
|
169
158
|
@classmethod
|
|
@@ -173,7 +162,6 @@ class ReadSingleParameter(
|
|
|
173
162
|
identifier_value: UUID,
|
|
174
163
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
175
164
|
use_cache: bool = True,
|
|
176
|
-
expand: OptListOfExpandableFields = None,
|
|
177
165
|
) -> "ReadSingleParameter": ...
|
|
178
166
|
@overload
|
|
179
167
|
@classmethod
|
|
@@ -183,7 +171,6 @@ class ReadSingleParameter(
|
|
|
183
171
|
identifier_value: str,
|
|
184
172
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
185
173
|
use_cache: bool = True,
|
|
186
|
-
expand: OptListOfExpandableFields = None,
|
|
187
174
|
) -> "ReadSingleParameter": ...
|
|
188
175
|
@classmethod
|
|
189
176
|
def new(
|
|
@@ -192,19 +179,17 @@ class ReadSingleParameter(
|
|
|
192
179
|
identifier_value: IdentifierValueType,
|
|
193
180
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
194
181
|
use_cache: bool = True,
|
|
195
|
-
expand: OptListOfExpandableFields = None,
|
|
196
182
|
) -> "ReadSingleParameter":
|
|
197
183
|
return cls(
|
|
198
184
|
identifier_type=identifier_type,
|
|
199
185
|
identifier_value=identifier_value,
|
|
200
186
|
statuses=statuses,
|
|
201
187
|
use_cache=use_cache,
|
|
202
|
-
expand=expand,
|
|
203
188
|
)
|
|
204
189
|
|
|
205
190
|
def to_query_params(self) -> StrToAnyDict:
|
|
206
191
|
return self.model_dump(
|
|
207
|
-
mode="json", include={"statuses", "use_cache"
|
|
192
|
+
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
208
193
|
)
|
|
209
194
|
|
|
210
195
|
|
|
@@ -246,7 +231,6 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
246
231
|
|
|
247
232
|
|
|
248
233
|
class UpdateParameter(
|
|
249
|
-
Expand,
|
|
250
234
|
UpdateDataMixin[UpdateDataT],
|
|
251
235
|
IdentifierTypeValue[
|
|
252
236
|
IdentifierType,
|
|
@@ -258,7 +242,6 @@ class UpdateParameter(
|
|
|
258
242
|
|
|
259
243
|
|
|
260
244
|
class StatusUpdateParameter(
|
|
261
|
-
Expand,
|
|
262
245
|
BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
|
|
263
246
|
):
|
|
264
247
|
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],
|
maleo/identity/utils/user.py
CHANGED
|
@@ -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],
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
maleo/identity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
maleo/identity/dtos.py,sha256=Jsvz9qIi9-ojYLp_zwByahH1_rVZ4znDP_JhFn0HT7g,7648
|
|
3
2
|
maleo/identity/models.py,sha256=aBYbkkd07BzH2zRq3q_D80xMR8DdhCiw1eQ2EYa9ZTQ,10223
|
|
4
3
|
maleo/identity/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
4
|
maleo/identity/constants/api_key.py,sha256=e7CsTodUBgyoX30SJUnYx457WBZeRFyyeaOFGsZ-7mY,264
|
|
@@ -14,14 +13,14 @@ maleo/identity/constants/user_profile.py,sha256=trDI4mNlcbA1_ignknMy07I6H-VqAytl
|
|
|
14
13
|
maleo/identity/constants/user_system_role.py,sha256=_p5FI2X7yBUJuA06ia_vIkDRyfY4WZweQD08G3wCuRw,300
|
|
15
14
|
maleo/identity/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
15
|
maleo/identity/enums/api_key.py,sha256=WST6RsRrvJGeSL5ugVeZNKXReGsh9GEPDxmRy-owiEk,276
|
|
17
|
-
maleo/identity/enums/organization.py,sha256=
|
|
16
|
+
maleo/identity/enums/organization.py,sha256=akxi_BJqRMokQ59K4KMZDkO-yLVC0Q_A7jErOiuixqs,406
|
|
18
17
|
maleo/identity/enums/organization_registration_code.py,sha256=ZkteIpOW6MOLEHBbmDUaRGalTlTWUIRlimz-FohBWiM,282
|
|
19
18
|
maleo/identity/enums/organization_relation.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
20
|
-
maleo/identity/enums/patient.py,sha256=
|
|
21
|
-
maleo/identity/enums/user.py,sha256=
|
|
19
|
+
maleo/identity/enums/patient.py,sha256=rMyUPFApFV9Mf3H-hsvTf4KFbHVkR-GAIluGfdQMpHc,274
|
|
20
|
+
maleo/identity/enums/user.py,sha256=Y81ZPrZa8Of84AwFmPtrFygK_kXuWYxMZXUm2FFISK8,436
|
|
22
21
|
maleo/identity/enums/user_medical_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
23
22
|
maleo/identity/enums/user_organization_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
24
|
-
maleo/identity/enums/user_profile.py,sha256=
|
|
23
|
+
maleo/identity/enums/user_profile.py,sha256=LgX7Ct-MAfx7o0W8MICzpHMfDhi7wpiJfRszn6vr1zc,272
|
|
25
24
|
maleo/identity/enums/user_system_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
26
25
|
maleo/identity/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
26
|
maleo/identity/mixins/api_key.py,sha256=btlTZkJxhLyxj0T50ZBJnSUwiDIJl4Dz7oNl7Ftc9WM,173
|
|
@@ -34,15 +33,15 @@ maleo/identity/mixins/user.py,sha256=UHoMgFJXptE9x9QsR07KG2bgp5OlCNqvYjEtP9S3TIY
|
|
|
34
33
|
maleo/identity/mixins/user_profile.py,sha256=LFHAzGD-3wli6YJGfl9-Sy0gtQHkhgvrZ5EzOfl1vXY,1174
|
|
35
34
|
maleo/identity/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
35
|
maleo/identity/schemas/api_key.py,sha256=UnQfnoEMkFgOfWDKai6wWNyD5QsovyoOov6jN52QPKI,3713
|
|
37
|
-
maleo/identity/schemas/common.py,sha256=
|
|
38
|
-
maleo/identity/schemas/organization.py,sha256=
|
|
36
|
+
maleo/identity/schemas/common.py,sha256=x_cK5SexE-0dzuUpb3F0qTQ9RbX9bTTweioi7-Q3zPU,8249
|
|
37
|
+
maleo/identity/schemas/organization.py,sha256=lyUDA654ydnL8C6tc9GVsE30E_se5TefI2rZPIL8KUk,4817
|
|
39
38
|
maleo/identity/schemas/organization_registration_code.py,sha256=jAP7MGb_28wh1WoBZDl2FSJBxKFRH56YSQvMFQ5_iyo,4731
|
|
40
39
|
maleo/identity/schemas/organization_relation.py,sha256=xEdOuZ6J4r7R4heEagd_UtioYJla73LZs1qloSSEs4I,5067
|
|
41
|
-
maleo/identity/schemas/patient.py,sha256=
|
|
42
|
-
maleo/identity/schemas/user.py,sha256=
|
|
40
|
+
maleo/identity/schemas/patient.py,sha256=CQ3PsW8Xbdm9KpeCnqdkRvgPvDdDmnSPHgYRcaf-zbw,5497
|
|
41
|
+
maleo/identity/schemas/user.py,sha256=a2DH4eOA_SPrCW3fRBnujxSOCmXcq7IU-aSluZt_h5k,5030
|
|
43
42
|
maleo/identity/schemas/user_medical_role.py,sha256=YzYsjMRKIA4CWdfOlGoPqWFl4v2JTj2EBwOWhNtUKSQ,4893
|
|
44
43
|
maleo/identity/schemas/user_organization_role.py,sha256=MW1Ry1HnGrASmP2Mulk3Pfk1_mIOlLTBARerOA0TowI,4983
|
|
45
|
-
maleo/identity/schemas/user_profile.py,sha256=
|
|
44
|
+
maleo/identity/schemas/user_profile.py,sha256=zVDanghQs0iO90BQeCvy_U89jhLtPAyRHkmd8TNvqh4,6101
|
|
46
45
|
maleo/identity/schemas/user_system_role.py,sha256=CRI8KgNpcjJU9EBtEc75-vUmC64J5ZgigFO6IRWuRKM,4665
|
|
47
46
|
maleo/identity/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
47
|
maleo/identity/types/api_key.py,sha256=pjWzyAh1p0DTS6v2ImYv849iF-T0PbEM8qlrwN3c-2o,190
|
|
@@ -56,10 +55,10 @@ maleo/identity/types/user_organization_role.py,sha256=FFgzo2IvblckLwKN-rnOXI9TRp
|
|
|
56
55
|
maleo/identity/types/user_profile.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
57
56
|
maleo/identity/types/user_system_role.py,sha256=6KIDk7kCWBlrloNLfIElflS5N8oBYqPeNRqySD2BQEE,191
|
|
58
57
|
maleo/identity/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
|
-
maleo/identity/utils/organization.py,sha256=
|
|
60
|
-
maleo/identity/utils/user.py,sha256=
|
|
61
|
-
maleo_identity-0.1.
|
|
62
|
-
maleo_identity-0.1.
|
|
63
|
-
maleo_identity-0.1.
|
|
64
|
-
maleo_identity-0.1.
|
|
65
|
-
maleo_identity-0.1.
|
|
58
|
+
maleo/identity/utils/organization.py,sha256=aEegzeoNLUptrScUB5kWrYlJj7dzTZeVXymltE5lWpE,874
|
|
59
|
+
maleo/identity/utils/user.py,sha256=1pyfmAbXkAEOo6WM2KRA_kRnFi0O_A2ZUEqv01wY-cU,794
|
|
60
|
+
maleo_identity-0.1.5.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
61
|
+
maleo_identity-0.1.5.dist-info/METADATA,sha256=gy-ga36xvcsRQn-zoFJCaeJ9Tj9MZP0iJ90yGV5MtOM,3583
|
|
62
|
+
maleo_identity-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
63
|
+
maleo_identity-0.1.5.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
64
|
+
maleo_identity-0.1.5.dist-info/RECORD,,
|
maleo/identity/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|