maleo-identity 0.1.11__py3-none-any.whl → 0.1.27__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.
- maleo/identity/constants/api_key.py +2 -2
- maleo/identity/constants/organization.py +1 -1
- maleo/identity/constants/organization_registration_code.py +2 -2
- maleo/identity/constants/organization_relation.py +2 -2
- maleo/identity/constants/patient.py +1 -1
- maleo/identity/constants/user.py +1 -1
- maleo/identity/constants/user_medical_role.py +2 -2
- maleo/identity/constants/user_organization_role.py +2 -2
- maleo/identity/constants/user_profile.py +1 -1
- maleo/identity/constants/user_system_role.py +6 -2
- maleo/identity/enums/api_key.py +13 -1
- maleo/identity/enums/organization.py +4 -0
- maleo/identity/enums/organization_registration_code.py +4 -0
- maleo/identity/enums/organization_relation.py +11 -1
- maleo/identity/enums/patient.py +18 -2
- maleo/identity/enums/user.py +4 -0
- maleo/identity/enums/user_medical_role.py +11 -1
- maleo/identity/enums/user_organization_role.py +11 -1
- maleo/identity/enums/user_profile.py +18 -0
- maleo/identity/enums/user_system_role.py +24 -1
- maleo/identity/mixins/api_key.py +11 -4
- maleo/identity/mixins/organization.py +3 -1
- maleo/identity/mixins/organization_registration_code.py +40 -4
- maleo/identity/mixins/organization_relation.py +11 -4
- maleo/identity/mixins/patient.py +13 -44
- maleo/identity/mixins/user.py +3 -1
- maleo/identity/mixins/user_medical_role.py +11 -4
- maleo/identity/mixins/user_organization_role.py +11 -4
- maleo/identity/mixins/user_profile.py +26 -3
- maleo/identity/mixins/user_system_role.py +19 -6
- maleo/identity/schemas/api_key.py +21 -4
- maleo/identity/schemas/common.py +39 -25
- maleo/identity/schemas/organization.py +26 -0
- maleo/identity/schemas/organization_registration_code.py +19 -2
- maleo/identity/schemas/organization_relation.py +23 -5
- maleo/identity/schemas/patient.py +56 -31
- maleo/identity/schemas/user.py +23 -0
- maleo/identity/schemas/user_medical_role.py +25 -6
- maleo/identity/schemas/user_organization_role.py +25 -6
- maleo/identity/schemas/user_profile.py +73 -7
- maleo/identity/schemas/user_system_role.py +52 -11
- maleo/identity/types/api_key.py +2 -2
- maleo/identity/types/organization_relation.py +2 -2
- maleo/identity/types/patient.py +1 -1
- maleo/identity/types/user_medical_role.py +2 -2
- maleo/identity/types/user_organization_role.py +2 -2
- maleo/identity/types/user_system_role.py +3 -2
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/METADATA +6 -5
- maleo_identity-0.1.27.dist-info/RECORD +66 -0
- maleo/identity/models.py +0 -337
- maleo_identity-0.1.11.dist-info/RECORD +0 -67
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/WHEEL +0 -0
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/licenses/LICENSE +0 -0
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import Generic, Literal, TypeVar, overload
|
|
2
|
+
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from maleo.enums.identity import (
|
|
5
5
|
OptBloodType,
|
|
@@ -21,7 +21,7 @@ from maleo.schemas.mixins.identity import (
|
|
|
21
21
|
Ids,
|
|
22
22
|
UUIDs,
|
|
23
23
|
IntUserId,
|
|
24
|
-
|
|
24
|
+
IntUserIds,
|
|
25
25
|
BirthDate,
|
|
26
26
|
)
|
|
27
27
|
from maleo.schemas.mixins.sort import convert as convert_sort
|
|
@@ -37,7 +37,7 @@ from maleo.types.dict import StrToAnyDict
|
|
|
37
37
|
from maleo.types.integer import OptListOfInts
|
|
38
38
|
from maleo.types.string import OptStr
|
|
39
39
|
from maleo.types.uuid import OptListOfUUIDs
|
|
40
|
-
from ..enums.user_profile import IdentifierType
|
|
40
|
+
from ..enums.user_profile import IdentifierType, OptListOfExpandableFields
|
|
41
41
|
from ..mixins.common import (
|
|
42
42
|
IdCard,
|
|
43
43
|
FullName,
|
|
@@ -49,12 +49,15 @@ from ..mixins.user_profile import (
|
|
|
49
49
|
MiddleName,
|
|
50
50
|
LastName,
|
|
51
51
|
EndingTitle,
|
|
52
|
+
AvatarMixin,
|
|
53
|
+
Expand,
|
|
52
54
|
UserProfileIdentifier,
|
|
53
55
|
)
|
|
54
56
|
from ..types.user_profile import IdentifierValueType
|
|
55
57
|
|
|
56
58
|
|
|
57
|
-
class
|
|
59
|
+
class StandardCreateData(
|
|
60
|
+
AvatarMixin,
|
|
58
61
|
BloodTypeMixin[OptBloodType],
|
|
59
62
|
GenderMixin[OptGender],
|
|
60
63
|
BirthDate[OptDate],
|
|
@@ -66,32 +69,52 @@ class CreateParameter(
|
|
|
66
69
|
FirstName[str],
|
|
67
70
|
LeadingTitle[OptStr],
|
|
68
71
|
IdCard[OptStr],
|
|
72
|
+
):
|
|
73
|
+
pass
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class FullCreateData(
|
|
77
|
+
StandardCreateData,
|
|
69
78
|
IntUserId[int],
|
|
70
79
|
):
|
|
71
80
|
pass
|
|
72
81
|
|
|
73
82
|
|
|
83
|
+
class CreateParameter(Expand, FullCreateData):
|
|
84
|
+
pass
|
|
85
|
+
|
|
86
|
+
|
|
74
87
|
class ReadMultipleParameter(
|
|
88
|
+
Expand,
|
|
75
89
|
ReadPaginatedMultipleParameter,
|
|
76
90
|
BloodTypesMixin[OptListOfBloodTypes],
|
|
77
91
|
GendersMixin[OptListOfGenders],
|
|
92
|
+
IntUserIds[OptListOfInts],
|
|
78
93
|
UUIDs[OptListOfUUIDs],
|
|
79
94
|
Ids[OptListOfInts],
|
|
80
|
-
IntOrganizationIds[OptListOfInts],
|
|
81
95
|
):
|
|
96
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
97
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
98
|
+
user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
|
|
99
|
+
genders: Annotated[OptListOfGenders, Field(None, description="Genders")] = None
|
|
100
|
+
blood_types: Annotated[
|
|
101
|
+
OptListOfBloodTypes, Field(None, description="Blood Types")
|
|
102
|
+
] = None
|
|
103
|
+
|
|
82
104
|
@property
|
|
83
105
|
def _query_param_fields(self) -> set[str]:
|
|
84
106
|
return {
|
|
85
|
-
"organization_ids",
|
|
86
107
|
"ids",
|
|
87
108
|
"uuids",
|
|
88
109
|
"statuses",
|
|
110
|
+
"user_ids",
|
|
89
111
|
"genders",
|
|
90
112
|
"blood_types",
|
|
91
113
|
"search",
|
|
92
114
|
"page",
|
|
93
115
|
"limit",
|
|
94
116
|
"use_cache",
|
|
117
|
+
"expand",
|
|
95
118
|
}
|
|
96
119
|
|
|
97
120
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -104,7 +127,19 @@ class ReadMultipleParameter(
|
|
|
104
127
|
return params
|
|
105
128
|
|
|
106
129
|
|
|
107
|
-
class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
|
|
130
|
+
class ReadSingleParameter(Expand, BaseReadSingleParameter[UserProfileIdentifier]):
|
|
131
|
+
@classmethod
|
|
132
|
+
def from_identifier(
|
|
133
|
+
cls,
|
|
134
|
+
identifier: UserProfileIdentifier,
|
|
135
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
136
|
+
use_cache: bool = True,
|
|
137
|
+
expand: OptListOfExpandableFields = None,
|
|
138
|
+
) -> "ReadSingleParameter":
|
|
139
|
+
return cls(
|
|
140
|
+
identifier=identifier, statuses=statuses, use_cache=use_cache, expand=expand
|
|
141
|
+
)
|
|
142
|
+
|
|
108
143
|
@overload
|
|
109
144
|
@classmethod
|
|
110
145
|
def new(
|
|
@@ -113,6 +148,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
|
|
|
113
148
|
identifier_value: int,
|
|
114
149
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
115
150
|
use_cache: bool = True,
|
|
151
|
+
expand: OptListOfExpandableFields = None,
|
|
116
152
|
) -> "ReadSingleParameter": ...
|
|
117
153
|
@overload
|
|
118
154
|
@classmethod
|
|
@@ -122,6 +158,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
|
|
|
122
158
|
identifier_value: UUID,
|
|
123
159
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
124
160
|
use_cache: bool = True,
|
|
161
|
+
expand: OptListOfExpandableFields = None,
|
|
125
162
|
) -> "ReadSingleParameter": ...
|
|
126
163
|
@overload
|
|
127
164
|
@classmethod
|
|
@@ -131,6 +168,17 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
|
|
|
131
168
|
identifier_value: str,
|
|
132
169
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
133
170
|
use_cache: bool = True,
|
|
171
|
+
expand: OptListOfExpandableFields = None,
|
|
172
|
+
) -> "ReadSingleParameter": ...
|
|
173
|
+
@overload
|
|
174
|
+
@classmethod
|
|
175
|
+
def new(
|
|
176
|
+
cls,
|
|
177
|
+
identifier_type: IdentifierType,
|
|
178
|
+
identifier_value: IdentifierValueType,
|
|
179
|
+
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
180
|
+
use_cache: bool = True,
|
|
181
|
+
expand: OptListOfExpandableFields = None,
|
|
134
182
|
) -> "ReadSingleParameter": ...
|
|
135
183
|
@classmethod
|
|
136
184
|
def new(
|
|
@@ -139,6 +187,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
|
|
|
139
187
|
identifier_value: IdentifierValueType,
|
|
140
188
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
141
189
|
use_cache: bool = True,
|
|
190
|
+
expand: OptListOfExpandableFields = None,
|
|
142
191
|
) -> "ReadSingleParameter":
|
|
143
192
|
return cls(
|
|
144
193
|
identifier=UserProfileIdentifier(
|
|
@@ -147,6 +196,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
|
|
|
147
196
|
),
|
|
148
197
|
statuses=statuses,
|
|
149
198
|
use_cache=use_cache,
|
|
199
|
+
expand=expand,
|
|
150
200
|
)
|
|
151
201
|
|
|
152
202
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -156,6 +206,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
|
|
|
156
206
|
|
|
157
207
|
|
|
158
208
|
class FullUpdateData(
|
|
209
|
+
AvatarMixin,
|
|
159
210
|
BloodTypeMixin[OptBloodType],
|
|
160
211
|
GenderMixin[OptGender],
|
|
161
212
|
BirthDate[OptDate],
|
|
@@ -171,6 +222,7 @@ class FullUpdateData(
|
|
|
171
222
|
|
|
172
223
|
|
|
173
224
|
class PartialUpdateData(
|
|
225
|
+
AvatarMixin,
|
|
174
226
|
BloodTypeMixin[OptBloodType],
|
|
175
227
|
GenderMixin[OptGender],
|
|
176
228
|
BirthDate[OptDate],
|
|
@@ -193,6 +245,7 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
193
245
|
|
|
194
246
|
|
|
195
247
|
class UpdateParameter(
|
|
248
|
+
Expand,
|
|
196
249
|
UpdateDataMixin[UpdateDataT],
|
|
197
250
|
IdentifierMixin[UserProfileIdentifier],
|
|
198
251
|
Generic[UpdateDataT],
|
|
@@ -204,6 +257,7 @@ class UpdateParameter(
|
|
|
204
257
|
identifier_type: Literal[IdentifierType.ID, IdentifierType.USER_ID],
|
|
205
258
|
identifier_value: int,
|
|
206
259
|
data: UpdateDataT,
|
|
260
|
+
expand: OptListOfExpandableFields = None,
|
|
207
261
|
) -> "UpdateParameter": ...
|
|
208
262
|
@overload
|
|
209
263
|
@classmethod
|
|
@@ -212,6 +266,7 @@ class UpdateParameter(
|
|
|
212
266
|
identifier_type: Literal[IdentifierType.UUID],
|
|
213
267
|
identifier_value: UUID,
|
|
214
268
|
data: UpdateDataT,
|
|
269
|
+
expand: OptListOfExpandableFields = None,
|
|
215
270
|
) -> "UpdateParameter": ...
|
|
216
271
|
@overload
|
|
217
272
|
@classmethod
|
|
@@ -220,6 +275,7 @@ class UpdateParameter(
|
|
|
220
275
|
identifier_type: Literal[IdentifierType.ID_CARD],
|
|
221
276
|
identifier_value: str,
|
|
222
277
|
data: UpdateDataT,
|
|
278
|
+
expand: OptListOfExpandableFields = None,
|
|
223
279
|
) -> "UpdateParameter": ...
|
|
224
280
|
@overload
|
|
225
281
|
@classmethod
|
|
@@ -228,6 +284,7 @@ class UpdateParameter(
|
|
|
228
284
|
identifier_type: IdentifierType,
|
|
229
285
|
identifier_value: IdentifierValueType,
|
|
230
286
|
data: UpdateDataT,
|
|
287
|
+
expand: OptListOfExpandableFields = None,
|
|
231
288
|
) -> "UpdateParameter": ...
|
|
232
289
|
@classmethod
|
|
233
290
|
def new(
|
|
@@ -235,16 +292,19 @@ class UpdateParameter(
|
|
|
235
292
|
identifier_type: IdentifierType,
|
|
236
293
|
identifier_value: IdentifierValueType,
|
|
237
294
|
data: UpdateDataT,
|
|
295
|
+
expand: OptListOfExpandableFields = None,
|
|
238
296
|
) -> "UpdateParameter":
|
|
239
297
|
return cls(
|
|
240
298
|
identifier=UserProfileIdentifier(
|
|
241
299
|
type=identifier_type, value=identifier_value
|
|
242
300
|
),
|
|
243
301
|
data=data,
|
|
302
|
+
expand=expand,
|
|
244
303
|
)
|
|
245
304
|
|
|
246
305
|
|
|
247
306
|
class StatusUpdateParameter(
|
|
307
|
+
Expand,
|
|
248
308
|
BaseStatusUpdateParameter[UserProfileIdentifier],
|
|
249
309
|
):
|
|
250
310
|
@overload
|
|
@@ -254,6 +314,7 @@ class StatusUpdateParameter(
|
|
|
254
314
|
identifier_type: Literal[IdentifierType.ID, IdentifierType.USER_ID],
|
|
255
315
|
identifier_value: int,
|
|
256
316
|
type: ResourceOperationStatusUpdateType,
|
|
317
|
+
expand: OptListOfExpandableFields = None,
|
|
257
318
|
) -> "StatusUpdateParameter": ...
|
|
258
319
|
@overload
|
|
259
320
|
@classmethod
|
|
@@ -262,6 +323,7 @@ class StatusUpdateParameter(
|
|
|
262
323
|
identifier_type: Literal[IdentifierType.UUID],
|
|
263
324
|
identifier_value: UUID,
|
|
264
325
|
type: ResourceOperationStatusUpdateType,
|
|
326
|
+
expand: OptListOfExpandableFields = None,
|
|
265
327
|
) -> "StatusUpdateParameter": ...
|
|
266
328
|
@overload
|
|
267
329
|
@classmethod
|
|
@@ -270,6 +332,7 @@ class StatusUpdateParameter(
|
|
|
270
332
|
identifier_type: Literal[IdentifierType.ID_CARD],
|
|
271
333
|
identifier_value: str,
|
|
272
334
|
type: ResourceOperationStatusUpdateType,
|
|
335
|
+
expand: OptListOfExpandableFields = None,
|
|
273
336
|
) -> "StatusUpdateParameter": ...
|
|
274
337
|
@overload
|
|
275
338
|
@classmethod
|
|
@@ -278,6 +341,7 @@ class StatusUpdateParameter(
|
|
|
278
341
|
identifier_type: IdentifierType,
|
|
279
342
|
identifier_value: IdentifierValueType,
|
|
280
343
|
type: ResourceOperationStatusUpdateType,
|
|
344
|
+
expand: OptListOfExpandableFields = None,
|
|
281
345
|
) -> "StatusUpdateParameter": ...
|
|
282
346
|
@classmethod
|
|
283
347
|
def new(
|
|
@@ -285,12 +349,14 @@ class StatusUpdateParameter(
|
|
|
285
349
|
identifier_type: IdentifierType,
|
|
286
350
|
identifier_value: IdentifierValueType,
|
|
287
351
|
type: ResourceOperationStatusUpdateType,
|
|
352
|
+
expand: OptListOfExpandableFields = None,
|
|
288
353
|
) -> "StatusUpdateParameter":
|
|
289
354
|
return cls(
|
|
290
355
|
identifier=UserProfileIdentifier(
|
|
291
356
|
type=identifier_type, value=identifier_value
|
|
292
357
|
),
|
|
293
358
|
type=type,
|
|
359
|
+
expand=expand,
|
|
294
360
|
)
|
|
295
361
|
|
|
296
362
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import Generic, Literal, TypeVar, overload
|
|
2
|
+
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from maleo.enums.system import (
|
|
5
5
|
SystemRole,
|
|
@@ -31,9 +31,9 @@ from maleo.schemas.parameter import (
|
|
|
31
31
|
from maleo.types.dict import StrToAnyDict
|
|
32
32
|
from maleo.types.integer import OptInt, OptListOfInts
|
|
33
33
|
from maleo.types.uuid import OptListOfUUIDs
|
|
34
|
-
from ..enums.user_system_role import IdentifierType
|
|
35
|
-
from ..mixins.user_system_role import UserSystemRoleIdentifier
|
|
36
|
-
from ..types.user_system_role import
|
|
34
|
+
from ..enums.user_system_role import IdentifierType, OptListOfExpandableFields
|
|
35
|
+
from ..mixins.user_system_role import Expand, UserSystemRoleIdentifier
|
|
36
|
+
from ..types.user_system_role import CompositeIdentifierType, IdentifierValueType
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class StandardCreateData(FullSystemRoleMixin[SystemRole]):
|
|
@@ -47,17 +47,25 @@ class FullCreateData(
|
|
|
47
47
|
pass
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
class CreateParameter(FullCreateData):
|
|
50
|
+
class CreateParameter(Expand, FullCreateData):
|
|
51
51
|
pass
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
class ReadMultipleParameter(
|
|
55
|
+
Expand,
|
|
55
56
|
ReadPaginatedMultipleParameter,
|
|
56
57
|
FullSystemRolesMixin[OptListOfSystemRoles],
|
|
57
58
|
IntUserIds[OptListOfInts],
|
|
58
59
|
UUIDs[OptListOfUUIDs],
|
|
59
60
|
Ids[OptListOfInts],
|
|
60
61
|
):
|
|
62
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
63
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
64
|
+
user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
|
|
65
|
+
system_roles: Annotated[
|
|
66
|
+
OptListOfSystemRoles, Field(None, description="System Roles")
|
|
67
|
+
] = None
|
|
68
|
+
|
|
61
69
|
@property
|
|
62
70
|
def _query_param_fields(self) -> set[str]:
|
|
63
71
|
return {
|
|
@@ -70,6 +78,7 @@ class ReadMultipleParameter(
|
|
|
70
78
|
"page",
|
|
71
79
|
"limit",
|
|
72
80
|
"use_cache",
|
|
81
|
+
"expand",
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -82,7 +91,19 @@ class ReadMultipleParameter(
|
|
|
82
91
|
return params
|
|
83
92
|
|
|
84
93
|
|
|
85
|
-
class ReadSingleParameter(BaseReadSingleParameter[UserSystemRoleIdentifier]):
|
|
94
|
+
class ReadSingleParameter(Expand, BaseReadSingleParameter[UserSystemRoleIdentifier]):
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_identifier(
|
|
97
|
+
cls,
|
|
98
|
+
identifier: UserSystemRoleIdentifier,
|
|
99
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
100
|
+
use_cache: bool = True,
|
|
101
|
+
expand: OptListOfExpandableFields = None,
|
|
102
|
+
) -> "ReadSingleParameter":
|
|
103
|
+
return cls(
|
|
104
|
+
identifier=identifier, statuses=statuses, use_cache=use_cache, expand=expand
|
|
105
|
+
)
|
|
106
|
+
|
|
86
107
|
@overload
|
|
87
108
|
@classmethod
|
|
88
109
|
def new(
|
|
@@ -91,6 +112,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserSystemRoleIdentifier]):
|
|
|
91
112
|
identifier_value: int,
|
|
92
113
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
93
114
|
use_cache: bool = True,
|
|
115
|
+
expand: OptListOfExpandableFields = None,
|
|
94
116
|
) -> "ReadSingleParameter": ...
|
|
95
117
|
@overload
|
|
96
118
|
@classmethod
|
|
@@ -100,15 +122,17 @@ class ReadSingleParameter(BaseReadSingleParameter[UserSystemRoleIdentifier]):
|
|
|
100
122
|
identifier_value: UUID,
|
|
101
123
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
102
124
|
use_cache: bool = True,
|
|
125
|
+
expand: OptListOfExpandableFields = None,
|
|
103
126
|
) -> "ReadSingleParameter": ...
|
|
104
127
|
@overload
|
|
105
128
|
@classmethod
|
|
106
129
|
def new(
|
|
107
130
|
cls,
|
|
108
131
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
109
|
-
identifier_value:
|
|
132
|
+
identifier_value: CompositeIdentifierType,
|
|
110
133
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
111
134
|
use_cache: bool = True,
|
|
135
|
+
expand: OptListOfExpandableFields = None,
|
|
112
136
|
) -> "ReadSingleParameter": ...
|
|
113
137
|
@overload
|
|
114
138
|
@classmethod
|
|
@@ -118,6 +142,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserSystemRoleIdentifier]):
|
|
|
118
142
|
identifier_value: IdentifierValueType,
|
|
119
143
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
120
144
|
use_cache: bool = True,
|
|
145
|
+
expand: OptListOfExpandableFields = None,
|
|
121
146
|
) -> "ReadSingleParameter": ...
|
|
122
147
|
@classmethod
|
|
123
148
|
def new(
|
|
@@ -126,6 +151,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserSystemRoleIdentifier]):
|
|
|
126
151
|
identifier_value: IdentifierValueType,
|
|
127
152
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
128
153
|
use_cache: bool = True,
|
|
154
|
+
expand: OptListOfExpandableFields = None,
|
|
129
155
|
) -> "ReadSingleParameter":
|
|
130
156
|
return cls(
|
|
131
157
|
identifier=UserSystemRoleIdentifier(
|
|
@@ -133,11 +159,12 @@ class ReadSingleParameter(BaseReadSingleParameter[UserSystemRoleIdentifier]):
|
|
|
133
159
|
),
|
|
134
160
|
statuses=statuses,
|
|
135
161
|
use_cache=use_cache,
|
|
162
|
+
expand=expand,
|
|
136
163
|
)
|
|
137
164
|
|
|
138
165
|
def to_query_params(self) -> StrToAnyDict:
|
|
139
166
|
return self.model_dump(
|
|
140
|
-
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
167
|
+
mode="json", include={"statuses", "use_cache", "expand"}, exclude_none=True
|
|
141
168
|
)
|
|
142
169
|
|
|
143
170
|
|
|
@@ -163,6 +190,7 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
163
190
|
|
|
164
191
|
|
|
165
192
|
class UpdateParameter(
|
|
193
|
+
Expand,
|
|
166
194
|
UpdateDataMixin[UpdateDataT],
|
|
167
195
|
IdentifierMixin[UserSystemRoleIdentifier],
|
|
168
196
|
Generic[UpdateDataT],
|
|
@@ -174,6 +202,7 @@ class UpdateParameter(
|
|
|
174
202
|
identifier_type: Literal[IdentifierType.ID],
|
|
175
203
|
identifier_value: int,
|
|
176
204
|
data: UpdateDataT,
|
|
205
|
+
expand: OptListOfExpandableFields = None,
|
|
177
206
|
) -> "UpdateParameter": ...
|
|
178
207
|
@overload
|
|
179
208
|
@classmethod
|
|
@@ -182,14 +211,16 @@ class UpdateParameter(
|
|
|
182
211
|
identifier_type: Literal[IdentifierType.UUID],
|
|
183
212
|
identifier_value: UUID,
|
|
184
213
|
data: UpdateDataT,
|
|
214
|
+
expand: OptListOfExpandableFields = None,
|
|
185
215
|
) -> "UpdateParameter": ...
|
|
186
216
|
@overload
|
|
187
217
|
@classmethod
|
|
188
218
|
def new(
|
|
189
219
|
cls,
|
|
190
220
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
191
|
-
identifier_value:
|
|
221
|
+
identifier_value: CompositeIdentifierType,
|
|
192
222
|
data: UpdateDataT,
|
|
223
|
+
expand: OptListOfExpandableFields = None,
|
|
193
224
|
) -> "UpdateParameter": ...
|
|
194
225
|
@overload
|
|
195
226
|
@classmethod
|
|
@@ -198,6 +229,7 @@ class UpdateParameter(
|
|
|
198
229
|
identifier_type: IdentifierType,
|
|
199
230
|
identifier_value: IdentifierValueType,
|
|
200
231
|
data: UpdateDataT,
|
|
232
|
+
expand: OptListOfExpandableFields = None,
|
|
201
233
|
) -> "UpdateParameter": ...
|
|
202
234
|
@classmethod
|
|
203
235
|
def new(
|
|
@@ -205,16 +237,19 @@ class UpdateParameter(
|
|
|
205
237
|
identifier_type: IdentifierType,
|
|
206
238
|
identifier_value: IdentifierValueType,
|
|
207
239
|
data: UpdateDataT,
|
|
240
|
+
expand: OptListOfExpandableFields = None,
|
|
208
241
|
) -> "UpdateParameter":
|
|
209
242
|
return cls(
|
|
210
243
|
identifier=UserSystemRoleIdentifier(
|
|
211
244
|
type=identifier_type, value=identifier_value
|
|
212
245
|
),
|
|
213
246
|
data=data,
|
|
247
|
+
expand=expand,
|
|
214
248
|
)
|
|
215
249
|
|
|
216
250
|
|
|
217
251
|
class StatusUpdateParameter(
|
|
252
|
+
Expand,
|
|
218
253
|
BaseStatusUpdateParameter[UserSystemRoleIdentifier],
|
|
219
254
|
):
|
|
220
255
|
@overload
|
|
@@ -224,6 +259,7 @@ class StatusUpdateParameter(
|
|
|
224
259
|
identifier_type: Literal[IdentifierType.ID],
|
|
225
260
|
identifier_value: int,
|
|
226
261
|
type: ResourceOperationStatusUpdateType,
|
|
262
|
+
expand: OptListOfExpandableFields = None,
|
|
227
263
|
) -> "StatusUpdateParameter": ...
|
|
228
264
|
@overload
|
|
229
265
|
@classmethod
|
|
@@ -232,14 +268,16 @@ class StatusUpdateParameter(
|
|
|
232
268
|
identifier_type: Literal[IdentifierType.UUID],
|
|
233
269
|
identifier_value: UUID,
|
|
234
270
|
type: ResourceOperationStatusUpdateType,
|
|
271
|
+
expand: OptListOfExpandableFields = None,
|
|
235
272
|
) -> "StatusUpdateParameter": ...
|
|
236
273
|
@overload
|
|
237
274
|
@classmethod
|
|
238
275
|
def new(
|
|
239
276
|
cls,
|
|
240
277
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
241
|
-
identifier_value:
|
|
278
|
+
identifier_value: CompositeIdentifierType,
|
|
242
279
|
type: ResourceOperationStatusUpdateType,
|
|
280
|
+
expand: OptListOfExpandableFields = None,
|
|
243
281
|
) -> "StatusUpdateParameter": ...
|
|
244
282
|
@overload
|
|
245
283
|
@classmethod
|
|
@@ -248,6 +286,7 @@ class StatusUpdateParameter(
|
|
|
248
286
|
identifier_type: IdentifierType,
|
|
249
287
|
identifier_value: IdentifierValueType,
|
|
250
288
|
type: ResourceOperationStatusUpdateType,
|
|
289
|
+
expand: OptListOfExpandableFields = None,
|
|
251
290
|
) -> "StatusUpdateParameter": ...
|
|
252
291
|
@classmethod
|
|
253
292
|
def new(
|
|
@@ -255,12 +294,14 @@ class StatusUpdateParameter(
|
|
|
255
294
|
identifier_type: IdentifierType,
|
|
256
295
|
identifier_value: IdentifierValueType,
|
|
257
296
|
type: ResourceOperationStatusUpdateType,
|
|
297
|
+
expand: OptListOfExpandableFields = None,
|
|
258
298
|
) -> "StatusUpdateParameter":
|
|
259
299
|
return cls(
|
|
260
300
|
identifier=UserSystemRoleIdentifier(
|
|
261
301
|
type=identifier_type, value=identifier_value
|
|
262
302
|
),
|
|
263
303
|
type=type,
|
|
304
|
+
expand=expand,
|
|
264
305
|
)
|
|
265
306
|
|
|
266
307
|
|
|
@@ -280,7 +321,7 @@ class DeleteSingleParameter(BaseDeleteSingleParameter[UserSystemRoleIdentifier])
|
|
|
280
321
|
def new(
|
|
281
322
|
cls,
|
|
282
323
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
283
|
-
identifier_value:
|
|
324
|
+
identifier_value: CompositeIdentifierType,
|
|
284
325
|
) -> "DeleteSingleParameter": ...
|
|
285
326
|
@overload
|
|
286
327
|
@classmethod
|
maleo/identity/types/api_key.py
CHANGED
|
@@ -3,5 +3,5 @@ from uuid import UUID
|
|
|
3
3
|
from maleo.types.integer import OptInt
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
IdentifierValueType = int | UUID | str |
|
|
6
|
+
CompositeIdentifierType = Tuple[int, OptInt]
|
|
7
|
+
IdentifierValueType = int | UUID | str | CompositeIdentifierType
|
|
@@ -3,5 +3,5 @@ from uuid import UUID
|
|
|
3
3
|
from maleo.enums.organization import OrganizationRelation
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
IdentifierValueType = int | UUID |
|
|
6
|
+
CompositeIdentifierType = Tuple[int, int, OrganizationRelation]
|
|
7
|
+
IdentifierValueType = int | UUID | CompositeIdentifierType
|
maleo/identity/types/patient.py
CHANGED
|
@@ -3,5 +3,5 @@ from uuid import UUID
|
|
|
3
3
|
from maleo.enums.medical import MedicalRole
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
IdentifierValueType = int | UUID |
|
|
6
|
+
CompositeIdentifierType = Tuple[int, int, MedicalRole]
|
|
7
|
+
IdentifierValueType = int | UUID | CompositeIdentifierType
|
|
@@ -3,5 +3,5 @@ from uuid import UUID
|
|
|
3
3
|
from maleo.enums.organization import OrganizationRole
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
IdentifierValueType = int | UUID |
|
|
6
|
+
CompositeIdentifierType = Tuple[int, int, OrganizationRole]
|
|
7
|
+
IdentifierValueType = int | UUID | CompositeIdentifierType
|
|
@@ -3,5 +3,6 @@ from uuid import UUID
|
|
|
3
3
|
from maleo.enums.system import SystemRole
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
BasicIdentifierType = int | UUID
|
|
7
|
+
CompositeIdentifierType = Tuple[int, SystemRole]
|
|
8
|
+
IdentifierValueType = BasicIdentifierType | CompositeIdentifierType
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.27
|
|
4
4
|
Summary: MaleoIdentity service package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: Proprietary
|
|
@@ -11,7 +11,7 @@ Requires-Dist: annotated-types>=0.7.0
|
|
|
11
11
|
Requires-Dist: anyio>=4.11.0
|
|
12
12
|
Requires-Dist: bcrypt>=5.0.0
|
|
13
13
|
Requires-Dist: black>=25.9.0
|
|
14
|
-
Requires-Dist: cachetools>=6.2.
|
|
14
|
+
Requires-Dist: cachetools>=6.2.1
|
|
15
15
|
Requires-Dist: certifi>=2025.10.5
|
|
16
16
|
Requires-Dist: cffi>=2.0.0
|
|
17
17
|
Requires-Dist: cfgv>=3.4.0
|
|
@@ -20,7 +20,7 @@ Requires-Dist: click>=8.3.0
|
|
|
20
20
|
Requires-Dist: colorama>=0.4.6
|
|
21
21
|
Requires-Dist: cryptography>=46.0.2
|
|
22
22
|
Requires-Dist: distlib>=0.4.0
|
|
23
|
-
Requires-Dist: fastapi>=0.
|
|
23
|
+
Requires-Dist: fastapi>=0.119.0
|
|
24
24
|
Requires-Dist: filelock>=3.20.0
|
|
25
25
|
Requires-Dist: google-api-core>=2.26.0
|
|
26
26
|
Requires-Dist: google-auth>=2.41.1
|
|
@@ -38,13 +38,14 @@ Requires-Dist: h11>=0.16.0
|
|
|
38
38
|
Requires-Dist: httpcore>=1.0.9
|
|
39
39
|
Requires-Dist: httpx>=0.28.1
|
|
40
40
|
Requires-Dist: identify>=2.6.15
|
|
41
|
-
Requires-Dist: idna>=3.
|
|
41
|
+
Requires-Dist: idna>=3.11
|
|
42
42
|
Requires-Dist: importlib_metadata>=8.7.0
|
|
43
43
|
Requires-Dist: iniconfig>=2.1.0
|
|
44
44
|
Requires-Dist: maleo-crypto>=0.0.50
|
|
45
45
|
Requires-Dist: maleo-enums>=0.0.50
|
|
46
46
|
Requires-Dist: maleo-logging>=0.0.50
|
|
47
|
-
Requires-Dist: maleo-
|
|
47
|
+
Requires-Dist: maleo-metadata>=0.7.50
|
|
48
|
+
Requires-Dist: maleo-schemas>=0.7.50
|
|
48
49
|
Requires-Dist: maleo-types>=0.0.50
|
|
49
50
|
Requires-Dist: maleo-utils>=0.0.50
|
|
50
51
|
Requires-Dist: mypy_extensions>=1.1.0
|