maleo-identity 0.1.24__py3-none-any.whl → 0.1.31__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.
@@ -1,4 +1,5 @@
1
1
  from maleo.schemas.resource import Resource, ResourceIdentifier
2
+ from maleo.types.string import SeqOfStrs
2
3
 
3
4
 
4
5
  USER_PROFILE_RESOURCE = Resource(
@@ -9,3 +10,17 @@ USER_PROFILE_RESOURCE = Resource(
9
10
  ],
10
11
  details=None,
11
12
  )
13
+
14
+
15
+ VALID_EXTENSIONS: SeqOfStrs = (
16
+ ".jpeg",
17
+ ".jpg",
18
+ ".png",
19
+ )
20
+
21
+
22
+ VALID_MIME_TYPES: SeqOfStrs = (
23
+ "image/jpeg",
24
+ "image/jpg",
25
+ "image/png",
26
+ )
@@ -20,3 +20,16 @@ class IdentifierType(StrEnum):
20
20
  elif self is IdentifierType.COMPOSITE:
21
21
  return ("source_id", "target_id", "relation")
22
22
  raise ValueError(f"Unknown column(s) for identifier type: {self}")
23
+
24
+
25
+ class ExpandableField(StrEnum):
26
+ ORGANIZATION_TYPE = "organization_type"
27
+
28
+ @classmethod
29
+ def choices(cls) -> ListOfStrs:
30
+ return [e.value for e in cls]
31
+
32
+
33
+ OptExpandableField = ExpandableField | None
34
+ ListOfExpandableFields = list[ExpandableField]
35
+ OptListOfExpandableFields = ListOfExpandableFields | None
@@ -15,3 +15,17 @@ class IdentifierType(StrEnum):
15
15
  @property
16
16
  def column(self) -> str:
17
17
  return self.value
18
+
19
+
20
+ class ExpandableField(StrEnum):
21
+ GENDER = "gender"
22
+ BLOOD_TYPE = "blood_type"
23
+
24
+ @classmethod
25
+ def choices(cls) -> ListOfStrs:
26
+ return [e.value for e in cls]
27
+
28
+
29
+ OptExpandableField = ExpandableField | None
30
+ ListOfExpandableFields = list[ExpandableField]
31
+ OptListOfExpandableFields = ListOfExpandableFields | None
@@ -41,7 +41,9 @@ class CompositeAPIKeyIdentifier(
41
41
  Literal[IdentifierType.COMPOSITE],
42
42
  Field(IdentifierType.COMPOSITE, description="Identifier's type"),
43
43
  ] = IdentifierType.COMPOSITE
44
- value: Annotated[CompositeIdentifierType, Field(..., description="Identifier's value")]
44
+ value: Annotated[
45
+ CompositeIdentifierType, Field(..., description="Identifier's value")
46
+ ]
45
47
 
46
48
 
47
49
  AnyAPIKeyIdentifier = (
@@ -6,7 +6,7 @@ from maleo.types.any import ManyAny
6
6
  from maleo.types.boolean import OptBoolT
7
7
  from maleo.types.misc import OptListOfAnyOrStrToAnyDict
8
8
  from maleo.types.string import ManyStrs
9
- from ..enums.organization_relation import IdentifierType
9
+ from ..enums.organization_relation import IdentifierType, OptListOfExpandableFields
10
10
  from ..types.organization_relation import CompositeIdentifierType, IdentifierValueType
11
11
 
12
12
 
@@ -18,6 +18,12 @@ class Meta(BaseModel):
18
18
  meta: Annotated[OptListOfAnyOrStrToAnyDict, Field(None, description="Meta")] = None
19
19
 
20
20
 
21
+ class Expand(BaseModel):
22
+ expand: Annotated[
23
+ OptListOfExpandableFields, Field(None, description="Expanded field(s)")
24
+ ] = None
25
+
26
+
21
27
  class OrganizationRelationIdentifier(Identifier[IdentifierType, IdentifierValueType]):
22
28
  @property
23
29
  def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
@@ -49,7 +55,9 @@ class CompositeOrganizationRelationIdentifier(
49
55
  Literal[IdentifierType.COMPOSITE],
50
56
  Field(IdentifierType.COMPOSITE, description="Identifier's type"),
51
57
  ] = IdentifierType.COMPOSITE
52
- value: Annotated[CompositeIdentifierType, Field(..., description="Identifier's value")]
58
+ value: Annotated[
59
+ CompositeIdentifierType, Field(..., description="Identifier's value")
60
+ ]
53
61
 
54
62
 
55
63
  AnyOrganizationRelationIdentifier = (
@@ -37,7 +37,9 @@ class CompositeUserMedicalRoleIdentifier(
37
37
  Literal[IdentifierType.COMPOSITE],
38
38
  Field(IdentifierType.COMPOSITE, description="Identifier's type"),
39
39
  ] = IdentifierType.COMPOSITE
40
- value: Annotated[CompositeIdentifierType, Field(..., description="Identifier's value")]
40
+ value: Annotated[
41
+ CompositeIdentifierType, Field(..., description="Identifier's value")
42
+ ]
41
43
 
42
44
 
43
45
  AnyUserMedicalRoleIdentifier = (
@@ -39,7 +39,9 @@ class CompositeUserOrganizationRoleIdentifier(
39
39
  Literal[IdentifierType.COMPOSITE],
40
40
  Field(IdentifierType.COMPOSITE, description="Identifier's type"),
41
41
  ] = IdentifierType.COMPOSITE
42
- value: Annotated[CompositeIdentifierType, Field(..., description="Identifier's value")]
42
+ value: Annotated[
43
+ CompositeIdentifierType, Field(..., description="Identifier's value")
44
+ ]
43
45
 
44
46
 
45
47
  AnyUserOrganizationRoleIdentifier = (
@@ -3,7 +3,7 @@ from typing import Annotated, Generic, Literal, TypeGuard
3
3
  from uuid import UUID
4
4
  from maleo.schemas.mixins.identity import Identifier
5
5
  from maleo.types.string import OptStrT
6
- from ..enums.user_profile import IdentifierType
6
+ from ..enums.user_profile import IdentifierType, OptListOfExpandableFields
7
7
  from ..types.user_profile import IdentifierValueType
8
8
 
9
9
 
@@ -37,6 +37,19 @@ class EndingTitle(BaseModel, Generic[OptStrT]):
37
37
  ]
38
38
 
39
39
 
40
+ class Avatar(BaseModel):
41
+ content: Annotated[bytes, Field(..., description="Avatar's content")]
42
+ content_type: Annotated[str, Field(..., description="Avatar's content type")]
43
+ filename: Annotated[str, Field(..., description="Avatar's filename")]
44
+
45
+
46
+ OptAvatar = Avatar | None
47
+
48
+
49
+ class AvatarMixin(BaseModel):
50
+ avatar: Annotated[OptAvatar, Field(None, description="Avatar")]
51
+
52
+
40
53
  class AvatarName(BaseModel, Generic[OptStrT]):
41
54
  avatar_name: Annotated[OptStrT, Field(..., description="User's Avatar Name")]
42
55
 
@@ -45,6 +58,12 @@ class AvatarUrl(BaseModel, Generic[OptStrT]):
45
58
  avatar_url: Annotated[OptStrT, Field(..., description="User's Avatar URL")]
46
59
 
47
60
 
61
+ class Expand(BaseModel):
62
+ expand: Annotated[
63
+ OptListOfExpandableFields, Field(None, description="Expanded field(s)")
64
+ ] = None
65
+
66
+
48
67
  class UserProfileIdentifier(Identifier[IdentifierType, IdentifierValueType]):
49
68
  @property
50
69
  def column_and_value(self) -> tuple[str, IdentifierValueType]:
@@ -43,7 +43,9 @@ class CompositeUserSystemRoleIdentifier(
43
43
  Literal[IdentifierType.COMPOSITE],
44
44
  Field(IdentifierType.COMPOSITE, description="Identifier's type"),
45
45
  ] = IdentifierType.COMPOSITE
46
- value: Annotated[CompositeIdentifierType, Field(..., description="Identifier's value")]
46
+ value: Annotated[
47
+ CompositeIdentifierType, Field(..., description="Identifier's value")
48
+ ]
47
49
 
48
50
 
49
51
  AnyUserSystemRoleIdentifier = (
@@ -191,6 +191,18 @@ class OrganizationSchemaMixin(BaseModel, Generic[AnyOrganizationSchemaT]):
191
191
  ]
192
192
 
193
193
 
194
+ class OrganizationRelationSchema(
195
+ Meta,
196
+ IsBidirectional[bool],
197
+ TargetOrganizationSchemaMixin,
198
+ SourceOrganizationSchemaMixin,
199
+ SimpleDataStatusMixin[DataStatusEnum],
200
+ LifecycleTimestamp,
201
+ DataIdentifier,
202
+ ):
203
+ pass
204
+
205
+
194
206
  class UserMedicalRoleSchema(
195
207
  FullMedicalRoleMixin[MedicalRoleKeyOrStandardSchema],
196
208
  IntOrganizationId[int],
@@ -246,7 +258,7 @@ class UserProfileSchema(
246
258
  LifecycleTimestamp,
247
259
  DataIdentifier,
248
260
  ):
249
- pass
261
+ avatar_url: Annotated[OptStr, Field(None, description="Avatar URL")]
250
262
 
251
263
 
252
264
  OptUserProfileSchema = UserProfileSchema | None
@@ -33,16 +33,18 @@ from maleo.types.boolean import OptBool
33
33
  from maleo.types.dict import StrToAnyDict
34
34
  from maleo.types.integer import OptListOfInts
35
35
  from maleo.types.uuid import OptListOfUUIDs
36
- from ..enums.organization_relation import IdentifierType
36
+ from ..enums.organization_relation import IdentifierType, OptListOfExpandableFields
37
37
  from ..mixins.organization_relation import (
38
38
  IsBidirectional,
39
39
  Meta,
40
40
  OrganizationRelationIdentifier,
41
+ Expand,
41
42
  )
42
43
  from ..types.organization_relation import CompositeIdentifierType, IdentifierValueType
43
44
 
44
45
 
45
46
  class CreateParameter(
47
+ Expand,
46
48
  Meta,
47
49
  IsBidirectional[bool],
48
50
  SimpleOrganizationRelationMixin[OrganizationRelation],
@@ -55,8 +57,10 @@ class CreateParameter(
55
57
 
56
58
 
57
59
  class ReadMultipleParameter(
60
+ Expand,
58
61
  ReadPaginatedMultipleParameter,
59
62
  SimpleOrganizationRelationsMixin[OptListOfOrganizationRelations],
63
+ IsBidirectional[OptBool],
60
64
  IntTargetIds[OptListOfInts],
61
65
  IntSourceIds[OptListOfInts],
62
66
  UUIDs[OptListOfUUIDs],
@@ -66,6 +70,9 @@ class ReadMultipleParameter(
66
70
  uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
67
71
  source_ids: Annotated[OptListOfInts, Field(None, description="Source's IDs")] = None
68
72
  target_ids: Annotated[OptListOfInts, Field(None, description="Target's IDs")] = None
73
+ is_bidirectional: Annotated[
74
+ OptBool, Field(None, description="Whether is bidirectional")
75
+ ] = None
69
76
  relations: Annotated[
70
77
  OptListOfOrganizationRelations,
71
78
  Field(None, description="Organization Relations"),
@@ -79,11 +86,13 @@ class ReadMultipleParameter(
79
86
  "statuses",
80
87
  "source_ids",
81
88
  "target_ids",
89
+ "is_bidirectional",
82
90
  "relations",
83
91
  "search",
84
92
  "page",
85
93
  "limit",
86
94
  "use_cache",
95
+ "expand",
87
96
  }
88
97
 
89
98
  def to_query_params(self) -> StrToAnyDict:
@@ -96,15 +105,20 @@ class ReadMultipleParameter(
96
105
  return params
97
106
 
98
107
 
99
- class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier]):
108
+ class ReadSingleParameter(
109
+ Expand, BaseReadSingleParameter[OrganizationRelationIdentifier]
110
+ ):
100
111
  @classmethod
101
112
  def from_identifier(
102
113
  cls,
103
114
  identifier: OrganizationRelationIdentifier,
104
115
  statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
105
116
  use_cache: bool = True,
117
+ expand: OptListOfExpandableFields = None,
106
118
  ) -> "ReadSingleParameter":
107
- return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
119
+ return cls(
120
+ identifier=identifier, statuses=statuses, use_cache=use_cache, expand=expand
121
+ )
108
122
 
109
123
  @overload
110
124
  @classmethod
@@ -114,6 +128,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier
114
128
  identifier_value: int,
115
129
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
116
130
  use_cache: bool = True,
131
+ expand: OptListOfExpandableFields = None,
117
132
  ) -> "ReadSingleParameter": ...
118
133
  @overload
119
134
  @classmethod
@@ -123,6 +138,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier
123
138
  identifier_value: UUID,
124
139
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
125
140
  use_cache: bool = True,
141
+ expand: OptListOfExpandableFields = None,
126
142
  ) -> "ReadSingleParameter": ...
127
143
  @overload
128
144
  @classmethod
@@ -132,6 +148,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier
132
148
  identifier_value: CompositeIdentifierType,
133
149
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
134
150
  use_cache: bool = True,
151
+ expand: OptListOfExpandableFields = None,
135
152
  ) -> "ReadSingleParameter": ...
136
153
  @overload
137
154
  @classmethod
@@ -141,6 +158,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier
141
158
  identifier_value: IdentifierValueType,
142
159
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
143
160
  use_cache: bool = True,
161
+ expand: OptListOfExpandableFields = None,
144
162
  ) -> "ReadSingleParameter": ...
145
163
  @classmethod
146
164
  def new(
@@ -149,6 +167,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier
149
167
  identifier_value: IdentifierValueType,
150
168
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
151
169
  use_cache: bool = True,
170
+ expand: OptListOfExpandableFields = None,
152
171
  ) -> "ReadSingleParameter":
153
172
  return cls(
154
173
  identifier=OrganizationRelationIdentifier(
@@ -156,11 +175,12 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier
156
175
  ),
157
176
  statuses=statuses,
158
177
  use_cache=use_cache,
178
+ expand=expand,
159
179
  )
160
180
 
161
181
  def to_query_params(self) -> StrToAnyDict:
162
182
  return self.model_dump(
163
- mode="json", include={"statuses", "use_cache"}, exclude_none=True
183
+ mode="json", include={"statuses", "use_cache", "expand"}, exclude_none=True
164
184
  )
165
185
 
166
186
 
@@ -180,6 +200,7 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
180
200
 
181
201
 
182
202
  class UpdateParameter(
203
+ Expand,
183
204
  UpdateDataMixin[UpdateDataT],
184
205
  IdentifierMixin[OrganizationRelationIdentifier],
185
206
  Generic[UpdateDataT],
@@ -191,6 +212,7 @@ class UpdateParameter(
191
212
  identifier_type: Literal[IdentifierType.ID],
192
213
  identifier_value: int,
193
214
  data: UpdateDataT,
215
+ expand: OptListOfExpandableFields = None,
194
216
  ) -> "UpdateParameter": ...
195
217
  @overload
196
218
  @classmethod
@@ -199,6 +221,7 @@ class UpdateParameter(
199
221
  identifier_type: Literal[IdentifierType.UUID],
200
222
  identifier_value: UUID,
201
223
  data: UpdateDataT,
224
+ expand: OptListOfExpandableFields = None,
202
225
  ) -> "UpdateParameter": ...
203
226
  @overload
204
227
  @classmethod
@@ -207,6 +230,7 @@ class UpdateParameter(
207
230
  identifier_type: Literal[IdentifierType.COMPOSITE],
208
231
  identifier_value: CompositeIdentifierType,
209
232
  data: UpdateDataT,
233
+ expand: OptListOfExpandableFields = None,
210
234
  ) -> "UpdateParameter": ...
211
235
  @overload
212
236
  @classmethod
@@ -215,6 +239,7 @@ class UpdateParameter(
215
239
  identifier_type: IdentifierType,
216
240
  identifier_value: IdentifierValueType,
217
241
  data: UpdateDataT,
242
+ expand: OptListOfExpandableFields = None,
218
243
  ) -> "UpdateParameter": ...
219
244
  @classmethod
220
245
  def new(
@@ -222,16 +247,19 @@ class UpdateParameter(
222
247
  identifier_type: IdentifierType,
223
248
  identifier_value: IdentifierValueType,
224
249
  data: UpdateDataT,
250
+ expand: OptListOfExpandableFields = None,
225
251
  ) -> "UpdateParameter":
226
252
  return cls(
227
253
  identifier=OrganizationRelationIdentifier(
228
254
  type=identifier_type, value=identifier_value
229
255
  ),
230
256
  data=data,
257
+ expand=expand,
231
258
  )
232
259
 
233
260
 
234
261
  class StatusUpdateParameter(
262
+ Expand,
235
263
  BaseStatusUpdateParameter[OrganizationRelationIdentifier],
236
264
  ):
237
265
  @overload
@@ -241,6 +269,7 @@ class StatusUpdateParameter(
241
269
  identifier_type: Literal[IdentifierType.ID],
242
270
  identifier_value: int,
243
271
  type: ResourceOperationStatusUpdateType,
272
+ expand: OptListOfExpandableFields = None,
244
273
  ) -> "StatusUpdateParameter": ...
245
274
  @overload
246
275
  @classmethod
@@ -249,6 +278,7 @@ class StatusUpdateParameter(
249
278
  identifier_type: Literal[IdentifierType.UUID],
250
279
  identifier_value: UUID,
251
280
  type: ResourceOperationStatusUpdateType,
281
+ expand: OptListOfExpandableFields = None,
252
282
  ) -> "StatusUpdateParameter": ...
253
283
  @overload
254
284
  @classmethod
@@ -257,6 +287,7 @@ class StatusUpdateParameter(
257
287
  identifier_type: Literal[IdentifierType.COMPOSITE],
258
288
  identifier_value: CompositeIdentifierType,
259
289
  type: ResourceOperationStatusUpdateType,
290
+ expand: OptListOfExpandableFields = None,
260
291
  ) -> "StatusUpdateParameter": ...
261
292
  @overload
262
293
  @classmethod
@@ -265,6 +296,7 @@ class StatusUpdateParameter(
265
296
  identifier_type: IdentifierType,
266
297
  identifier_value: IdentifierValueType,
267
298
  type: ResourceOperationStatusUpdateType,
299
+ expand: OptListOfExpandableFields = None,
268
300
  ) -> "StatusUpdateParameter": ...
269
301
  @classmethod
270
302
  def new(
@@ -272,12 +304,14 @@ class StatusUpdateParameter(
272
304
  identifier_type: IdentifierType,
273
305
  identifier_value: IdentifierValueType,
274
306
  type: ResourceOperationStatusUpdateType,
307
+ expand: OptListOfExpandableFields = None,
275
308
  ) -> "StatusUpdateParameter":
276
309
  return cls(
277
310
  identifier=OrganizationRelationIdentifier(
278
311
  type=identifier_type, value=identifier_value
279
312
  ),
280
313
  type=type,
314
+ expand=expand,
281
315
  )
282
316
 
283
317
 
@@ -22,7 +22,6 @@ from maleo.schemas.mixins.identity import (
22
22
  UUIDs,
23
23
  IntUserId,
24
24
  IntUserIds,
25
- IntOrganizationIds,
26
25
  BirthDate,
27
26
  )
28
27
  from maleo.schemas.mixins.sort import convert as convert_sort
@@ -38,10 +37,9 @@ from maleo.types.dict import StrToAnyDict
38
37
  from maleo.types.integer import OptListOfInts
39
38
  from maleo.types.string import OptStr
40
39
  from maleo.types.uuid import OptListOfUUIDs
41
- from ..enums.user_profile import IdentifierType
40
+ from ..enums.user_profile import IdentifierType, OptListOfExpandableFields
42
41
  from ..mixins.common import (
43
42
  IdCard,
44
- FullName,
45
43
  BirthPlace,
46
44
  )
47
45
  from ..mixins.user_profile import (
@@ -50,17 +48,20 @@ from ..mixins.user_profile import (
50
48
  MiddleName,
51
49
  LastName,
52
50
  EndingTitle,
51
+ AvatarMixin,
52
+ Expand,
53
53
  UserProfileIdentifier,
54
54
  )
55
55
  from ..types.user_profile import IdentifierValueType
56
56
 
57
57
 
58
58
  class CreateParameter(
59
+ Expand,
60
+ AvatarMixin,
59
61
  BloodTypeMixin[OptBloodType],
60
62
  GenderMixin[OptGender],
61
63
  BirthDate[OptDate],
62
64
  BirthPlace[OptStr],
63
- FullName[str],
64
65
  EndingTitle[OptStr],
65
66
  LastName[str],
66
67
  MiddleName[OptStr],
@@ -73,20 +74,17 @@ class CreateParameter(
73
74
 
74
75
 
75
76
  class ReadMultipleParameter(
77
+ Expand,
76
78
  ReadPaginatedMultipleParameter,
77
79
  BloodTypesMixin[OptListOfBloodTypes],
78
80
  GendersMixin[OptListOfGenders],
81
+ IntUserIds[OptListOfInts],
79
82
  UUIDs[OptListOfUUIDs],
80
83
  Ids[OptListOfInts],
81
- IntOrganizationIds[OptListOfInts],
82
- IntUserIds[OptListOfInts],
83
84
  ):
84
- user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
85
- organization_ids: Annotated[
86
- OptListOfInts, Field(None, description="Organization's IDs")
87
- ] = None
88
85
  ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
89
86
  uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
87
+ user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
90
88
  genders: Annotated[OptListOfGenders, Field(None, description="Genders")] = None
91
89
  blood_types: Annotated[
92
90
  OptListOfBloodTypes, Field(None, description="Blood Types")
@@ -95,17 +93,17 @@ class ReadMultipleParameter(
95
93
  @property
96
94
  def _query_param_fields(self) -> set[str]:
97
95
  return {
98
- "user_ids",
99
- "organization_ids",
100
96
  "ids",
101
97
  "uuids",
102
98
  "statuses",
99
+ "user_ids",
103
100
  "genders",
104
101
  "blood_types",
105
102
  "search",
106
103
  "page",
107
104
  "limit",
108
105
  "use_cache",
106
+ "expand",
109
107
  }
110
108
 
111
109
  def to_query_params(self) -> StrToAnyDict:
@@ -118,15 +116,18 @@ class ReadMultipleParameter(
118
116
  return params
119
117
 
120
118
 
121
- class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
119
+ class ReadSingleParameter(Expand, BaseReadSingleParameter[UserProfileIdentifier]):
122
120
  @classmethod
123
121
  def from_identifier(
124
122
  cls,
125
123
  identifier: UserProfileIdentifier,
126
124
  statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
127
125
  use_cache: bool = True,
126
+ expand: OptListOfExpandableFields = None,
128
127
  ) -> "ReadSingleParameter":
129
- return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
128
+ return cls(
129
+ identifier=identifier, statuses=statuses, use_cache=use_cache, expand=expand
130
+ )
130
131
 
131
132
  @overload
132
133
  @classmethod
@@ -136,6 +137,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
136
137
  identifier_value: int,
137
138
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
138
139
  use_cache: bool = True,
140
+ expand: OptListOfExpandableFields = None,
139
141
  ) -> "ReadSingleParameter": ...
140
142
  @overload
141
143
  @classmethod
@@ -145,6 +147,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
145
147
  identifier_value: UUID,
146
148
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
147
149
  use_cache: bool = True,
150
+ expand: OptListOfExpandableFields = None,
148
151
  ) -> "ReadSingleParameter": ...
149
152
  @overload
150
153
  @classmethod
@@ -154,6 +157,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
154
157
  identifier_value: str,
155
158
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
156
159
  use_cache: bool = True,
160
+ expand: OptListOfExpandableFields = None,
157
161
  ) -> "ReadSingleParameter": ...
158
162
  @overload
159
163
  @classmethod
@@ -163,6 +167,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
163
167
  identifier_value: IdentifierValueType,
164
168
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
165
169
  use_cache: bool = True,
170
+ expand: OptListOfExpandableFields = None,
166
171
  ) -> "ReadSingleParameter": ...
167
172
  @classmethod
168
173
  def new(
@@ -171,6 +176,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
171
176
  identifier_value: IdentifierValueType,
172
177
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
173
178
  use_cache: bool = True,
179
+ expand: OptListOfExpandableFields = None,
174
180
  ) -> "ReadSingleParameter":
175
181
  return cls(
176
182
  identifier=UserProfileIdentifier(
@@ -179,15 +185,17 @@ class ReadSingleParameter(BaseReadSingleParameter[UserProfileIdentifier]):
179
185
  ),
180
186
  statuses=statuses,
181
187
  use_cache=use_cache,
188
+ expand=expand,
182
189
  )
183
190
 
184
191
  def to_query_params(self) -> StrToAnyDict:
185
192
  return self.model_dump(
186
- mode="json", include={"statuses", "use_cache"}, exclude_none=True
193
+ mode="json", include={"statuses", "use_cache", "expand"}, exclude_none=True
187
194
  )
188
195
 
189
196
 
190
197
  class FullUpdateData(
198
+ AvatarMixin,
191
199
  BloodTypeMixin[OptBloodType],
192
200
  GenderMixin[OptGender],
193
201
  BirthDate[OptDate],
@@ -203,6 +211,7 @@ class FullUpdateData(
203
211
 
204
212
 
205
213
  class PartialUpdateData(
214
+ AvatarMixin,
206
215
  BloodTypeMixin[OptBloodType],
207
216
  GenderMixin[OptGender],
208
217
  BirthDate[OptDate],
@@ -225,6 +234,7 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
225
234
 
226
235
 
227
236
  class UpdateParameter(
237
+ Expand,
228
238
  UpdateDataMixin[UpdateDataT],
229
239
  IdentifierMixin[UserProfileIdentifier],
230
240
  Generic[UpdateDataT],
@@ -236,6 +246,7 @@ class UpdateParameter(
236
246
  identifier_type: Literal[IdentifierType.ID, IdentifierType.USER_ID],
237
247
  identifier_value: int,
238
248
  data: UpdateDataT,
249
+ expand: OptListOfExpandableFields = None,
239
250
  ) -> "UpdateParameter": ...
240
251
  @overload
241
252
  @classmethod
@@ -244,6 +255,7 @@ class UpdateParameter(
244
255
  identifier_type: Literal[IdentifierType.UUID],
245
256
  identifier_value: UUID,
246
257
  data: UpdateDataT,
258
+ expand: OptListOfExpandableFields = None,
247
259
  ) -> "UpdateParameter": ...
248
260
  @overload
249
261
  @classmethod
@@ -252,6 +264,7 @@ class UpdateParameter(
252
264
  identifier_type: Literal[IdentifierType.ID_CARD],
253
265
  identifier_value: str,
254
266
  data: UpdateDataT,
267
+ expand: OptListOfExpandableFields = None,
255
268
  ) -> "UpdateParameter": ...
256
269
  @overload
257
270
  @classmethod
@@ -260,6 +273,7 @@ class UpdateParameter(
260
273
  identifier_type: IdentifierType,
261
274
  identifier_value: IdentifierValueType,
262
275
  data: UpdateDataT,
276
+ expand: OptListOfExpandableFields = None,
263
277
  ) -> "UpdateParameter": ...
264
278
  @classmethod
265
279
  def new(
@@ -267,16 +281,19 @@ class UpdateParameter(
267
281
  identifier_type: IdentifierType,
268
282
  identifier_value: IdentifierValueType,
269
283
  data: UpdateDataT,
284
+ expand: OptListOfExpandableFields = None,
270
285
  ) -> "UpdateParameter":
271
286
  return cls(
272
287
  identifier=UserProfileIdentifier(
273
288
  type=identifier_type, value=identifier_value
274
289
  ),
275
290
  data=data,
291
+ expand=expand,
276
292
  )
277
293
 
278
294
 
279
295
  class StatusUpdateParameter(
296
+ Expand,
280
297
  BaseStatusUpdateParameter[UserProfileIdentifier],
281
298
  ):
282
299
  @overload
@@ -286,6 +303,7 @@ class StatusUpdateParameter(
286
303
  identifier_type: Literal[IdentifierType.ID, IdentifierType.USER_ID],
287
304
  identifier_value: int,
288
305
  type: ResourceOperationStatusUpdateType,
306
+ expand: OptListOfExpandableFields = None,
289
307
  ) -> "StatusUpdateParameter": ...
290
308
  @overload
291
309
  @classmethod
@@ -294,6 +312,7 @@ class StatusUpdateParameter(
294
312
  identifier_type: Literal[IdentifierType.UUID],
295
313
  identifier_value: UUID,
296
314
  type: ResourceOperationStatusUpdateType,
315
+ expand: OptListOfExpandableFields = None,
297
316
  ) -> "StatusUpdateParameter": ...
298
317
  @overload
299
318
  @classmethod
@@ -302,6 +321,7 @@ class StatusUpdateParameter(
302
321
  identifier_type: Literal[IdentifierType.ID_CARD],
303
322
  identifier_value: str,
304
323
  type: ResourceOperationStatusUpdateType,
324
+ expand: OptListOfExpandableFields = None,
305
325
  ) -> "StatusUpdateParameter": ...
306
326
  @overload
307
327
  @classmethod
@@ -310,6 +330,7 @@ class StatusUpdateParameter(
310
330
  identifier_type: IdentifierType,
311
331
  identifier_value: IdentifierValueType,
312
332
  type: ResourceOperationStatusUpdateType,
333
+ expand: OptListOfExpandableFields = None,
313
334
  ) -> "StatusUpdateParameter": ...
314
335
  @classmethod
315
336
  def new(
@@ -317,12 +338,14 @@ class StatusUpdateParameter(
317
338
  identifier_type: IdentifierType,
318
339
  identifier_value: IdentifierValueType,
319
340
  type: ResourceOperationStatusUpdateType,
341
+ expand: OptListOfExpandableFields = None,
320
342
  ) -> "StatusUpdateParameter":
321
343
  return cls(
322
344
  identifier=UserProfileIdentifier(
323
345
  type=identifier_type, value=identifier_value
324
346
  ),
325
347
  type=type,
348
+ expand=expand,
326
349
  )
327
350
 
328
351
 
@@ -2,6 +2,6 @@ from typing import Tuple
2
2
  from uuid import UUID
3
3
  from maleo.enums.organization import OrganizationRelation
4
4
 
5
-
5
+ BasicIdentifierType = int | UUID
6
6
  CompositeIdentifierType = Tuple[int, int, OrganizationRelation]
7
- IdentifierValueType = int | UUID | CompositeIdentifierType
7
+ IdentifierValueType = BasicIdentifierType | CompositeIdentifierType
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-identity
3
- Version: 0.1.24
3
+ Version: 0.1.31
4
4
  Summary: MaleoIdentity service package
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: Proprietary
@@ -8,48 +8,48 @@ maleo/identity/constants/patient.py,sha256=F_OP2yp67L34ygbvPV7GLhezWW7RV7KE7OZsO
8
8
  maleo/identity/constants/user.py,sha256=lIwXkUzbE6WtHc8RdHSmVa4BAVlLHtdUj2-l0TVY7EY,189
9
9
  maleo/identity/constants/user_medical_role.py,sha256=jxPDawhnauLBoWqJ1SW4p6nUkPASIJVYrHPcdTo_7qI,302
10
10
  maleo/identity/constants/user_organization_role.py,sha256=g7JTYhv6jih0QoF4-HrQmNf4DS3dnIVONTcQZgOONjI,322
11
- maleo/identity/constants/user_profile.py,sha256=qNox8XB8gQlVj2rnsTU8j59gLgLRINRQN0rcyVuEQAw,257
11
+ maleo/identity/constants/user_profile.py,sha256=uPy2ptpH7EVTEyrx6WNIW8SwGJe71RK8YU24mMPNENg,459
12
12
  maleo/identity/constants/user_system_role.py,sha256=zc44fMwguNkErmHQ2P7I-L_KU__7PpX8ihdAyVKUx-Y,400
13
13
  maleo/identity/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  maleo/identity/enums/api_key.py,sha256=twpkiI21x52roagXHJjq4vhMLv9WPGhWFtPM55LSZ-w,721
15
15
  maleo/identity/enums/organization.py,sha256=y9sLqKPx9iC2402MKY8GTZ0_WWNRJT5_rVQkG_CCgso,476
16
16
  maleo/identity/enums/organization_registration_code.py,sha256=Cz7ZIo2a1lTXko9rJLQerNP90qMvrvV7gSAKkGup418,352
17
- maleo/identity/enums/organization_relation.py,sha256=-GxBCzUi-PFrICnHqray2PtFZb6LoG7NluDmyjljOa8,628
17
+ maleo/identity/enums/organization_relation.py,sha256=dENAiIZ2mSrAuCj2Vk3kcmBCBlLlGxiLTT-FoVPdHVU,949
18
18
  maleo/identity/enums/patient.py,sha256=gonmheVM5S99Wtddha7uJI4FzVOl9V0l1-ov1a-Kcqc,623
19
19
  maleo/identity/enums/user.py,sha256=Vv_5fHov_cPxKCcaxVeNNJgZL_wa2uewtr7w4smiVVU,506
20
20
  maleo/identity/enums/user_medical_role.py,sha256=KvPDu66wIh_sqvx0dyW38aTlCt5e_kRDcJ05Rk0rOd4,636
21
21
  maleo/identity/enums/user_organization_role.py,sha256=bV07sZYttbJPfefkp7u9Bkc4V1e3xsyhtErtpkXb-Xg,641
22
- maleo/identity/enums/user_profile.py,sha256=xYf5FNso2vjORZDSgLqwT5kb3P_1GtMZsR3utoAEgT8,342
22
+ maleo/identity/enums/user_profile.py,sha256=WvlEnYqKxlImEgYARl-NvEkz3Zm-HLvHCbsXxoePjTI,671
23
23
  maleo/identity/enums/user_system_role.py,sha256=zINGAt5D1nZ95ddvLXrFZaO_2k15S5gc4S9jF8sZ72s,925
24
24
  maleo/identity/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- maleo/identity/mixins/api_key.py,sha256=T5N-YKdDRrCQNaouZ3-FygzryzGmv9pDINq7sA60fys,2369
25
+ maleo/identity/mixins/api_key.py,sha256=T-MupQfKe5ru_kO-AQ3JZ11aqK92lFOgsIUy2cJWoo8,2383
26
26
  maleo/identity/mixins/common.py,sha256=diWtUiPMI_ypHtDrmI5y8IArxCdomo9Gt6X69iFhyuw,905
27
27
  maleo/identity/mixins/organization.py,sha256=P_GW483KCK4_ds9Jm82RVXEszwGgSzq1PHQk0ykgghk,2556
28
28
  maleo/identity/mixins/organization_registration_code.py,sha256=t_OHVoJobjYyfOVwAw_I3nebIFgG-AodApmIhDCVYmM,4693
29
- maleo/identity/mixins/organization_relation.py,sha256=tkpJcQ5lhG5mwPa8ZJ9mYzYXaGKTFmVx34dsR7pG5PQ,2867
29
+ maleo/identity/mixins/organization_relation.py,sha256=EGelkrwNo4qod-HbEESkefJ4qvBe6dqnHOLs7x1ElB4,3051
30
30
  maleo/identity/mixins/patient.py,sha256=unDmyazC5tyIsoXtAjMyWjAOOoxgMXa2DYfg6vZbLGI,2193
31
31
  maleo/identity/mixins/user.py,sha256=ShTtmt5mTSrJwbffnFePP7IXC08j2q1BKsAmV32YEiM,3537
32
- maleo/identity/mixins/user_medical_role.py,sha256=hdvJtQA9A2xA6LlDhdHMECdETCPtG5gJvmVquzRcAm4,2407
33
- maleo/identity/mixins/user_organization_role.py,sha256=3K7eZxRjEYhRTVvGGKYM8WQHpW0mFQO2x-_qqEDjrPc,2498
34
- maleo/identity/mixins/user_profile.py,sha256=fxKCS5N7fGEgOLWPeNry25nKsXDUrI9TB2nNbWb6Iyw,3813
35
- maleo/identity/mixins/user_system_role.py,sha256=Vi39Au-IT4y7tQ-dfsnv9FFTqhY2rCny91ohPai552Y,2571
32
+ maleo/identity/mixins/user_medical_role.py,sha256=DHdh3-JMysspWUM2A7Yx-OFcUz-KxwGHvgLDQuRXv08,2421
33
+ maleo/identity/mixins/user_organization_role.py,sha256=rU4Ci0iVqG4QFVRZM8PmCTgvDg5PqS2Ea-DSENYgj6Y,2512
34
+ maleo/identity/mixins/user_profile.py,sha256=Bnc4JRrUfFbVYi7kqFZkh_ke1CoJehN3n5Ob8pDAE8g,4368
35
+ maleo/identity/mixins/user_system_role.py,sha256=7L0C-sFCMzjUZYk2ZJZ6FLXJwvMO66KaYWODW1oFXAE,2585
36
36
  maleo/identity/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  maleo/identity/schemas/api_key.py,sha256=_JWrUwrRCqxTrcan-eKMegNVU1T46gERNcr8pNK_Y-U,5376
38
- maleo/identity/schemas/common.py,sha256=ijaLA6LQU8q0uw5qve0ksvuZMV6MKGv_CxbmofBiCh0,9046
38
+ maleo/identity/schemas/common.py,sha256=ihLXhdRsPj1CvKZCla2sKdtatMklLKvJjH3u_QCVr7Q,9352
39
39
  maleo/identity/schemas/organization.py,sha256=0oVnuvB-E55AZ2h-PFoprY9wyyKi-xPLErXJW6yrBn8,9302
40
40
  maleo/identity/schemas/organization_registration_code.py,sha256=6LzKsIXt5DNQv1605dRsv2DmaonDLN36jgHyi9xxY-k,9192
41
- maleo/identity/schemas/organization_relation.py,sha256=9HGZypuhpK9egCHVDS1nh_lm5D0osxYM_4KmEEV8sHI,9487
41
+ maleo/identity/schemas/organization_relation.py,sha256=gjMPoSOgF9liNMDjqI4VDbASHh8N2MQWxEb_BwX-ksg,10715
42
42
  maleo/identity/schemas/patient.py,sha256=qhycLtZfEDL8FWdT5GSe63so_9fdRXW_vAPNU0-kNi8,10222
43
43
  maleo/identity/schemas/user.py,sha256=y2X_2QckxrO2qWPYbn5RIMsK4MYgJU1V3huKTX3C7ds,9390
44
44
  maleo/identity/schemas/user_medical_role.py,sha256=zZdsRmty2InIthAvEgrXDWu7uv7Ez5dQ0XX86-JSE4E,9303
45
45
  maleo/identity/schemas/user_organization_role.py,sha256=r_9zEjL7tmDzSdsflf80qez2DgbGNEoueHCmM9wWOZo,9475
46
- maleo/identity/schemas/user_profile.py,sha256=9EgQ7Gi1kFAvgUrCsJ3I4SzZTRNJCUrX1Hkyp1t6Bgo,10165
46
+ maleo/identity/schemas/user_profile.py,sha256=SqPYTMegEjMkxof5I9ezW2EJFBNO0sEDkJnCHxZX0rE,11035
47
47
  maleo/identity/schemas/user_system_role.py,sha256=89vucqAxQjjfe0CFd6Z76008de5JxnZb56Zi1GU-Y-A,10095
48
48
  maleo/identity/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  maleo/identity/types/api_key.py,sha256=dJ4dnw9xYwedJVmSlQhGJrDFlY91T7-2EibP5FI_-rM,198
50
50
  maleo/identity/types/organization.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
51
51
  maleo/identity/types/organization_registration_code.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
52
- maleo/identity/types/organization_relation.py,sha256=slyRLcaT1gatzXCufzawAspwM18KeuCBTND0c3tLzQc,230
52
+ maleo/identity/types/organization_relation.py,sha256=PhBG7Ti8H5kDNDUBsRBoAU3TW8z575FZ3eZjFuz5jl0,271
53
53
  maleo/identity/types/patient.py,sha256=DJ-l-Ft2atX2oMzExo381PTSgdpVCtqBVSxZlmF_pCA,57
54
54
  maleo/identity/types/user.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
55
55
  maleo/identity/types/user_medical_role.py,sha256=xQohfQyK1D6ngjUUiJYfA5pMJaFYi7_nNmeuNvgMlMg,207
@@ -59,8 +59,8 @@ maleo/identity/types/user_system_role.py,sha256=9kNZ56HOMCdiT7fsT9uB2w0p8iQyfclY
59
59
  maleo/identity/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  maleo/identity/utils/organization.py,sha256=aEegzeoNLUptrScUB5kWrYlJj7dzTZeVXymltE5lWpE,874
61
61
  maleo/identity/utils/user.py,sha256=1pyfmAbXkAEOo6WM2KRA_kRnFi0O_A2ZUEqv01wY-cU,794
62
- maleo_identity-0.1.24.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
63
- maleo_identity-0.1.24.dist-info/METADATA,sha256=gsxFKe8h5zSZQ5UiwzW1NQ0yzNOmTusluJkHnaR-p7E,3584
64
- maleo_identity-0.1.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
- maleo_identity-0.1.24.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
66
- maleo_identity-0.1.24.dist-info/RECORD,,
62
+ maleo_identity-0.1.31.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
63
+ maleo_identity-0.1.31.dist-info/METADATA,sha256=YyfKzAYa0fZOxztM48EgzA0nIc3_4Tgc2NLYJ8PqZvg,3584
64
+ maleo_identity-0.1.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
+ maleo_identity-0.1.31.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
66
+ maleo_identity-0.1.31.dist-info/RECORD,,