maleo-identity 0.1.27__py3-none-any.whl → 0.1.59__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.
Files changed (65) hide show
  1. maleo/identity/constants/api_key.py +1 -1
  2. maleo/identity/constants/organization.py +1 -1
  3. maleo/identity/constants/organization_registration_code.py +1 -1
  4. maleo/identity/constants/organization_relation.py +1 -1
  5. maleo/identity/constants/patient.py +1 -1
  6. maleo/identity/constants/user.py +1 -1
  7. maleo/identity/constants/user_medical_role.py +1 -1
  8. maleo/identity/constants/user_organization.py +13 -0
  9. maleo/identity/constants/user_organization_role.py +1 -1
  10. maleo/identity/constants/user_profile.py +16 -1
  11. maleo/identity/constants/user_system_role.py +2 -2
  12. maleo/identity/enums/api_key.py +1 -1
  13. maleo/identity/enums/organization.py +14 -10
  14. maleo/identity/enums/organization_registration_code.py +1 -1
  15. maleo/identity/enums/organization_relation.py +14 -1
  16. maleo/identity/enums/patient.py +1 -1
  17. maleo/identity/enums/user.py +16 -1
  18. maleo/identity/enums/user_medical_role.py +14 -1
  19. maleo/identity/enums/user_organization.py +40 -0
  20. maleo/identity/enums/user_organization_role.py +14 -1
  21. maleo/identity/enums/user_profile.py +1 -1
  22. maleo/identity/enums/user_system_role.py +1 -1
  23. maleo/identity/mixins/api_key.py +19 -3
  24. maleo/identity/mixins/common.py +2 -2
  25. maleo/identity/mixins/organization.py +10 -4
  26. maleo/identity/mixins/organization_registration_code.py +4 -4
  27. maleo/identity/mixins/organization_relation.py +12 -6
  28. maleo/identity/mixins/patient.py +2 -2
  29. maleo/identity/mixins/user.py +9 -3
  30. maleo/identity/mixins/user_medical_role.py +11 -5
  31. maleo/identity/mixins/user_organization.py +76 -0
  32. maleo/identity/mixins/user_organization_role.py +11 -5
  33. maleo/identity/mixins/user_profile.py +3 -5
  34. maleo/identity/mixins/user_system_role.py +3 -3
  35. maleo/identity/schemas/api_key.py +22 -8
  36. maleo/identity/schemas/common.py +33 -77
  37. maleo/identity/schemas/organization.py +59 -25
  38. maleo/identity/schemas/organization_registration_code.py +11 -11
  39. maleo/identity/schemas/organization_relation.py +81 -21
  40. maleo/identity/schemas/patient.py +12 -12
  41. maleo/identity/schemas/user.py +104 -22
  42. maleo/identity/schemas/user_medical_role.py +66 -16
  43. maleo/identity/schemas/user_organization.py +334 -0
  44. maleo/identity/schemas/user_organization_role.py +68 -16
  45. maleo/identity/schemas/user_profile.py +15 -26
  46. maleo/identity/schemas/user_system_role.py +10 -10
  47. maleo/identity/types/api_key.py +3 -2
  48. maleo/identity/types/organization.py +1 -1
  49. maleo/identity/types/organization_registration_code.py +1 -1
  50. maleo/identity/types/organization_relation.py +3 -3
  51. maleo/identity/types/user.py +1 -1
  52. maleo/identity/types/user_medical_role.py +3 -2
  53. maleo/identity/types/user_organization.py +7 -0
  54. maleo/identity/types/user_organization_role.py +3 -2
  55. maleo/identity/types/user_profile.py +1 -1
  56. maleo/identity/types/user_system_role.py +1 -1
  57. {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/METADATA +10 -9
  58. maleo_identity-0.1.59.dist-info/RECORD +68 -0
  59. maleo/identity/utils/__init__.py +0 -0
  60. maleo/identity/utils/organization.py +0 -32
  61. maleo/identity/utils/user.py +0 -32
  62. maleo_identity-0.1.27.dist-info/RECORD +0 -66
  63. {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/WHEEL +0 -0
  64. {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/licenses/LICENSE +0 -0
  65. {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
1
  from pydantic import Field
2
2
  from typing import Annotated, Literal, overload
3
3
  from uuid import UUID
4
- from maleo.enums.status import (
4
+ from nexo.enums.status import (
5
5
  ListOfDataStatuses,
6
6
  FULL_DATA_STATUSES,
7
7
  )
8
- from maleo.schemas.mixins.filter import convert as convert_filter
9
- from maleo.schemas.mixins.identity import (
8
+ from nexo.schemas.mixins.filter import convert as convert_filter
9
+ from nexo.schemas.mixins.identity import (
10
10
  Ids,
11
11
  UUIDs,
12
12
  IntUserId,
@@ -14,15 +14,15 @@ from maleo.schemas.mixins.identity import (
14
14
  IntOrganizationId,
15
15
  IntOrganizationIds,
16
16
  )
17
- from maleo.schemas.mixins.sort import convert as convert_sort
18
- from maleo.schemas.parameter import (
17
+ from nexo.schemas.mixins.sort import convert as convert_sort
18
+ from nexo.schemas.parameter import (
19
19
  ReadSingleParameter as BaseReadSingleParameter,
20
20
  ReadPaginatedMultipleParameter,
21
21
  DeleteSingleParameter as BaseDeleteSingleParameter,
22
22
  )
23
- from maleo.types.dict import StrToAnyDict
24
- from maleo.types.integer import OptInt, OptListOfInts
25
- from maleo.types.uuid import OptListOfUUIDs
23
+ from nexo.types.dict import StrToAnyDict
24
+ from nexo.types.integer import OptInt, OptListOfInts
25
+ from nexo.types.uuid import OptListOfUUIDs
26
26
  from ..enums.api_key import IdentifierType
27
27
  from ..mixins.api_key import APIKeyIdentifier
28
28
  from ..types.api_key import CompositeIdentifierType, IdentifierValueType
@@ -103,6 +103,15 @@ class ReadSingleParameter(BaseReadSingleParameter[APIKeyIdentifier]):
103
103
  ) -> "ReadSingleParameter": ...
104
104
  @overload
105
105
  @classmethod
106
+ def new(
107
+ cls,
108
+ identifier_type: Literal[IdentifierType.API_KEY],
109
+ identifier_value: str,
110
+ statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
111
+ use_cache: bool = True,
112
+ ) -> "ReadSingleParameter": ...
113
+ @overload
114
+ @classmethod
106
115
  def new(
107
116
  cls,
108
117
  identifier_type: Literal[IdentifierType.COMPOSITE],
@@ -152,6 +161,11 @@ class DeleteSingleParameter(BaseDeleteSingleParameter[APIKeyIdentifier]):
152
161
  ) -> "DeleteSingleParameter": ...
153
162
  @overload
154
163
  @classmethod
164
+ def new(
165
+ cls, identifier_type: Literal[IdentifierType.API_KEY], identifier_value: str
166
+ ) -> "DeleteSingleParameter": ...
167
+ @overload
168
+ @classmethod
155
169
  def new(
156
170
  cls,
157
171
  identifier_type: Literal[IdentifierType.COMPOSITE],
@@ -1,8 +1,12 @@
1
1
  from datetime import date
2
2
  from pydantic import BaseModel, Field
3
- from typing import Annotated, Generic, TypeVar, Type
4
- from maleo.enums.identity import OptRhesus, RhesusMixin
5
- from maleo.enums.status import DataStatus as DataStatusEnum, SimpleDataStatusMixin
3
+ from typing import Annotated
4
+ from nexo.enums.identity import OptRhesus, RhesusMixin
5
+ from nexo.enums.organization import (
6
+ OrganizationRelation,
7
+ SimpleOrganizationRelationMixin,
8
+ )
9
+ from nexo.enums.status import DataStatus as DataStatusEnum, SimpleDataStatusMixin
6
10
  from maleo.metadata.schemas.blood_type import (
7
11
  OptKeyOrStandardSchema as BloodTypeOptKeyOrStandardSchema,
8
12
  FullBloodTypeMixin,
@@ -32,17 +36,16 @@ from maleo.metadata.schemas.user_type import (
32
36
  KeyOrStandardSchema as UserTypeKeyOrStandardSchema,
33
37
  FullUserTypeMixin,
34
38
  )
35
- from maleo.schemas.mixins.identity import (
39
+ from nexo.schemas.mixins.identity import (
36
40
  DataIdentifier,
37
41
  IntOrganizationId,
38
42
  IntUserId,
39
43
  BirthDate,
40
44
  DateOfBirth,
41
45
  )
42
- from maleo.schemas.mixins.timestamp import LifecycleTimestamp
43
- from maleo.types.datetime import OptDate
44
- from maleo.types.integer import OptInt
45
- from maleo.types.string import OptStr
46
+ from nexo.types.datetime import OptDate
47
+ from nexo.types.integer import OptInt
48
+ from nexo.types.string import OptStr
46
49
  from ..mixins.common import IdCard, FullName, BirthPlace, PlaceOfBirth
47
50
  from ..mixins.api_key import APIKey
48
51
  from ..mixins.organization_registration_code import Code, CurrentUses
@@ -66,7 +69,6 @@ class APIKeySchema(
66
69
  IntOrganizationId[OptInt],
67
70
  IntUserId[int],
68
71
  SimpleDataStatusMixin[DataStatusEnum],
69
- LifecycleTimestamp,
70
72
  DataIdentifier,
71
73
  ):
72
74
  pass
@@ -83,7 +85,6 @@ class PatientSchema(
83
85
  IntOrganizationId[int],
84
86
  IntUserId[int],
85
87
  SimpleDataStatusMixin[DataStatusEnum],
86
- LifecycleTimestamp,
87
88
  DataIdentifier,
88
89
  ):
89
90
  pass
@@ -94,7 +95,6 @@ class OrganizationRegistrationCodeSchema(
94
95
  Code[str],
95
96
  IntOrganizationId[int],
96
97
  SimpleDataStatusMixin[DataStatusEnum],
97
- LifecycleTimestamp,
98
98
  DataIdentifier,
99
99
  ):
100
100
  pass
@@ -110,29 +110,30 @@ class OrganizationRegistrationCodeSchemaMixin(BaseModel):
110
110
  ] = None
111
111
 
112
112
 
113
- class StandardOrganizationSchema(
113
+ class OrganizationSchema(
114
114
  OrganizationName[str],
115
115
  OrganizationKey[str],
116
116
  FullOrganizationTypeMixin[OrganizationTypeKeyOrStandardSchema],
117
117
  SimpleDataStatusMixin[DataStatusEnum],
118
- LifecycleTimestamp,
119
118
  DataIdentifier,
120
119
  ):
121
120
  pass
122
121
 
123
122
 
123
+ class OrganizationSchemaMixin(BaseModel):
124
+ organization: Annotated[OrganizationSchema, Field(..., description="Organization")]
125
+
126
+
124
127
  class SourceOrganizationSchemaMixin(BaseModel):
125
- source: Annotated[
126
- StandardOrganizationSchema, Field(..., description="Source organization")
127
- ]
128
+ source: Annotated[OrganizationSchema, Field(..., description="Source organization")]
128
129
 
129
130
 
130
131
  class SourceOrganizationRelationSchema(
131
132
  Meta,
132
133
  IsBidirectional[bool],
134
+ SimpleOrganizationRelationMixin[OrganizationRelation],
133
135
  SourceOrganizationSchemaMixin,
134
136
  SimpleDataStatusMixin[DataStatusEnum],
135
- LifecycleTimestamp,
136
137
  DataIdentifier,
137
138
  ):
138
139
  pass
@@ -146,17 +147,15 @@ class SourceOrganizationRelationsSchemaMixin(BaseModel):
146
147
 
147
148
 
148
149
  class TargetOrganizationSchemaMixin(BaseModel):
149
- target: Annotated[
150
- StandardOrganizationSchema, Field(..., description="Target organization")
151
- ]
150
+ target: Annotated[OrganizationSchema, Field(..., description="Target organization")]
152
151
 
153
152
 
154
153
  class TargetOrganizationRelationSchema(
155
154
  Meta,
156
155
  IsBidirectional[bool],
156
+ SimpleOrganizationRelationMixin[OrganizationRelation],
157
157
  TargetOrganizationSchemaMixin,
158
158
  SimpleDataStatusMixin[DataStatusEnum],
159
- LifecycleTimestamp,
160
159
  DataIdentifier,
161
160
  ):
162
161
  pass
@@ -169,34 +168,23 @@ class TargetOrganizationRelationsSchemaMixin(BaseModel):
169
168
  ] = list[TargetOrganizationRelationSchema]()
170
169
 
171
170
 
172
- class FullOrganizationSchema(
173
- TargetOrganizationRelationsSchemaMixin,
174
- SourceOrganizationRelationsSchemaMixin,
175
- OrganizationRegistrationCodeSchemaMixin,
176
- StandardOrganizationSchema,
171
+ class OrganizationRelationSchema(
172
+ Meta,
173
+ IsBidirectional[bool],
174
+ SimpleOrganizationRelationMixin[OrganizationRelation],
175
+ TargetOrganizationSchemaMixin,
176
+ SourceOrganizationSchemaMixin,
177
+ SimpleDataStatusMixin[DataStatusEnum],
178
+ DataIdentifier,
177
179
  ):
178
180
  pass
179
181
 
180
182
 
181
- AnyOrganizationSchemaType = (
182
- Type[StandardOrganizationSchema] | Type[FullOrganizationSchema]
183
- )
184
- AnyOrganizationSchema = StandardOrganizationSchema | FullOrganizationSchema
185
- AnyOrganizationSchemaT = TypeVar("AnyOrganizationSchemaT", bound=AnyOrganizationSchema)
186
-
187
-
188
- class OrganizationSchemaMixin(BaseModel, Generic[AnyOrganizationSchemaT]):
189
- organization: Annotated[
190
- AnyOrganizationSchemaT, Field(..., description="Organization")
191
- ]
192
-
193
-
194
183
  class UserMedicalRoleSchema(
195
184
  FullMedicalRoleMixin[MedicalRoleKeyOrStandardSchema],
196
185
  IntOrganizationId[int],
197
186
  IntUserId[int],
198
187
  SimpleDataStatusMixin[DataStatusEnum],
199
- LifecycleTimestamp,
200
188
  DataIdentifier,
201
189
  ):
202
190
  pass
@@ -214,7 +202,6 @@ class UserOrganizationRoleSchema(
214
202
  IntOrganizationId[int],
215
203
  IntUserId[int],
216
204
  SimpleDataStatusMixin[DataStatusEnum],
217
- LifecycleTimestamp,
218
205
  DataIdentifier,
219
206
  ):
220
207
  pass
@@ -243,7 +230,6 @@ class UserProfileSchema(
243
230
  IdCard[OptStr],
244
231
  IntUserId[int],
245
232
  SimpleDataStatusMixin[DataStatusEnum],
246
- LifecycleTimestamp,
247
233
  DataIdentifier,
248
234
  ):
249
235
  avatar_url: Annotated[OptStr, Field(None, description="Avatar URL")]
@@ -262,7 +248,6 @@ class UserSystemRoleSchema(
262
248
  FullSystemRoleMixin[SystemRoleKeyOrStandardSchema],
263
249
  IntUserId[int],
264
250
  SimpleDataStatusMixin[DataStatusEnum],
265
- LifecycleTimestamp,
266
251
  DataIdentifier,
267
252
  ):
268
253
  pass
@@ -279,57 +264,28 @@ class UserSystemRolesSchemaMixin(BaseModel):
279
264
  ] = list[UserSystemRoleSchema]()
280
265
 
281
266
 
282
- class StandardUserSchema(
267
+ class UserSchema(
283
268
  UserProfileSchemaMixin,
284
269
  Phone[str],
285
270
  Email[str],
286
271
  Username[str],
287
272
  FullUserTypeMixin[UserTypeKeyOrStandardSchema],
288
273
  SimpleDataStatusMixin[DataStatusEnum],
289
- LifecycleTimestamp,
290
274
  DataIdentifier,
291
275
  ):
292
276
  pass
293
277
 
294
278
 
295
- class UserOrganizationSchema(
296
- UserMedicalRolesSchemaMixin,
297
- UserOrganizationRolesSchemaMixin,
298
- OrganizationSchemaMixin[StandardOrganizationSchema],
299
- SimpleDataStatusMixin[DataStatusEnum],
300
- LifecycleTimestamp,
301
- DataIdentifier,
302
- ):
303
- pass
304
-
305
-
306
- class UserOrganizationsSchemaMixin(BaseModel):
307
- organizations: Annotated[
308
- list[UserOrganizationSchema],
309
- Field(list[UserOrganizationSchema](), description="Organizations"),
310
- ] = list[UserOrganizationSchema]()
311
-
312
-
313
- class FullUserSchema(UserSystemRolesSchemaMixin, StandardUserSchema):
314
- pass
315
-
316
-
317
- AnyUserSchemaType = Type[StandardUserSchema] | Type[FullUserSchema]
318
- AnyUserSchema = StandardUserSchema | FullUserSchema
319
- AnyUserSchemaT = TypeVar("AnyUserSchemaT", bound=AnyUserSchema)
320
-
321
-
322
- class UserSchemaMixin(BaseModel, Generic[AnyUserSchemaT]):
323
- user: Annotated[AnyUserSchemaT, Field(..., description="User")]
279
+ class UserSchemaMixin(BaseModel):
280
+ user: Annotated[UserSchema, Field(..., description="User")]
324
281
 
325
282
 
326
283
  class UserAndOrganizationSchema(
327
284
  UserMedicalRolesSchemaMixin,
328
285
  UserOrganizationRolesSchemaMixin,
329
- OrganizationSchemaMixin[StandardOrganizationSchema],
330
- UserSchemaMixin[StandardUserSchema],
286
+ OrganizationSchemaMixin,
287
+ UserSchemaMixin,
331
288
  SimpleDataStatusMixin[DataStatusEnum],
332
- LifecycleTimestamp,
333
289
  DataIdentifier,
334
290
  ):
335
291
  pass
@@ -1,55 +1,67 @@
1
- from pydantic import BaseModel, Field
2
- from typing import Annotated, Generic, Literal, TypeVar, overload
1
+ from pydantic import BaseModel, Field, model_validator
2
+ from typing import Annotated, Generic, Literal, Self, TypeVar, overload
3
3
  from uuid import UUID
4
- from maleo.enums.organization import (
4
+ from nexo.enums.organization import (
5
5
  OptOrganizationRelation,
6
6
  OrganizationType,
7
- OptOrganizationType,
8
7
  FullOrganizationTypeMixin,
9
8
  OptListOfOrganizationTypes,
10
9
  FullOrganizationTypesMixin,
11
10
  )
12
- from maleo.enums.status import (
11
+ from nexo.enums.status import (
13
12
  ListOfDataStatuses,
14
13
  FULL_DATA_STATUSES,
15
14
  )
16
- from maleo.schemas.mixins.filter import convert as convert_filter
17
- from maleo.schemas.mixins.identity import (
15
+ from nexo.schemas.mixins.filter import convert as convert_filter
16
+ from nexo.schemas.mixins.identity import (
18
17
  IdentifierMixin,
19
18
  Ids,
20
19
  UUIDs,
21
20
  Keys,
22
21
  Names,
23
22
  )
24
- from maleo.schemas.mixins.sort import convert as convert_sort
25
- from maleo.schemas.operation.enums import ResourceOperationStatusUpdateType
26
- from maleo.schemas.parameter import (
23
+ from nexo.schemas.mixins.sort import convert as convert_sort
24
+ from nexo.schemas.operation.enums import ResourceOperationStatusUpdateType
25
+ from nexo.schemas.parameter import (
27
26
  ReadSingleParameter as BaseReadSingleParameter,
28
27
  ReadPaginatedMultipleParameter,
29
28
  StatusUpdateParameter as BaseStatusUpdateParameter,
30
29
  DeleteSingleParameter as BaseDeleteSingleParameter,
31
30
  )
32
- from maleo.types.dict import StrToAnyDict
33
- from maleo.types.integer import OptInt, OptListOfInts
34
- from maleo.types.string import OptStr, OptListOfStrs
35
- from maleo.types.uuid import OptListOfUUIDs
36
- from ..enums.organization import IdentifierType
37
- from ..mixins.organization import Key, Name, OrganizationIdentifier
31
+ from nexo.types.dict import StrToAnyDict
32
+ from nexo.types.integer import OptInt, OptListOfInts
33
+ from nexo.types.string import OptStr, OptListOfStrs
34
+ from nexo.types.uuid import OptListOfUUIDs
35
+ from ..enums.organization import IdentifierType, OptListOfExpandableFields
36
+ from ..mixins.organization import Key, Name, Expand, OrganizationIdentifier
38
37
  from ..types.organization import IdentifierValueType
39
38
 
40
39
 
41
- class InsertData(Name[str], Key[str], FullOrganizationTypeMixin[OrganizationType]):
40
+ class CreateData(Name[str], Key[str], FullOrganizationTypeMixin[OrganizationType]):
42
41
  pass
43
42
 
44
43
 
45
- class CreateParameter(InsertData):
44
+ class CreateParameterDump(CreateData):
46
45
  related_to: Annotated[OptInt, Field(None, description="Related to", ge=1)] = None
47
46
  relation: Annotated[
48
47
  OptOrganizationRelation, Field(None, description="Relation")
49
48
  ] = None
50
49
 
50
+ @model_validator(mode="after")
51
+ def validate_relation(self) -> Self:
52
+ if (self.related_to is None) != (self.relation is None):
53
+ raise ValueError(
54
+ "Field 'related_to' and 'relation' must be both None or Not None"
55
+ )
56
+ return self
57
+
58
+
59
+ class CreateParameter(Expand, CreateData):
60
+ pass
61
+
51
62
 
52
63
  class ReadMultipleParameter(
64
+ Expand,
53
65
  ReadPaginatedMultipleParameter,
54
66
  Names[OptListOfStrs],
55
67
  Keys[OptListOfStrs],
@@ -78,6 +90,7 @@ class ReadMultipleParameter(
78
90
  "page",
79
91
  "limit",
80
92
  "use_cache",
93
+ "expand",
81
94
  }
82
95
 
83
96
  def to_query_params(self) -> StrToAnyDict:
@@ -90,15 +103,18 @@ class ReadMultipleParameter(
90
103
  return params
91
104
 
92
105
 
93
- class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
106
+ class ReadSingleParameter(Expand, BaseReadSingleParameter[OrganizationIdentifier]):
94
107
  @classmethod
95
108
  def from_identifier(
96
109
  cls,
97
110
  identifier: OrganizationIdentifier,
98
111
  statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
99
112
  use_cache: bool = True,
113
+ expand: OptListOfExpandableFields = None,
100
114
  ) -> "ReadSingleParameter":
101
- return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
115
+ return cls(
116
+ identifier=identifier, statuses=statuses, use_cache=use_cache, expand=expand
117
+ )
102
118
 
103
119
  @overload
104
120
  @classmethod
@@ -108,6 +124,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
108
124
  identifier_value: int,
109
125
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
110
126
  use_cache: bool = True,
127
+ expand: OptListOfExpandableFields = None,
111
128
  ) -> "ReadSingleParameter": ...
112
129
  @overload
113
130
  @classmethod
@@ -117,6 +134,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
117
134
  identifier_value: UUID,
118
135
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
119
136
  use_cache: bool = True,
137
+ expand: OptListOfExpandableFields = None,
120
138
  ) -> "ReadSingleParameter": ...
121
139
  @overload
122
140
  @classmethod
@@ -126,6 +144,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
126
144
  identifier_value: str,
127
145
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
128
146
  use_cache: bool = True,
147
+ expand: OptListOfExpandableFields = None,
129
148
  ) -> "ReadSingleParameter": ...
130
149
  @overload
131
150
  @classmethod
@@ -135,6 +154,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
135
154
  identifier_value: IdentifierValueType,
136
155
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
137
156
  use_cache: bool = True,
157
+ expand: OptListOfExpandableFields = None,
138
158
  ) -> "ReadSingleParameter": ...
139
159
  @classmethod
140
160
  def new(
@@ -143,6 +163,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
143
163
  identifier_value: IdentifierValueType,
144
164
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
145
165
  use_cache: bool = True,
166
+ expand: OptListOfExpandableFields = None,
146
167
  ) -> "ReadSingleParameter":
147
168
  return cls(
148
169
  identifier=OrganizationIdentifier(
@@ -150,21 +171,20 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
150
171
  ),
151
172
  statuses=statuses,
152
173
  use_cache=use_cache,
174
+ expand=expand,
153
175
  )
154
176
 
155
177
  def to_query_params(self) -> StrToAnyDict:
156
178
  return self.model_dump(
157
- mode="json", include={"statuses", "use_cache"}, exclude_none=True
179
+ mode="json", include={"statuses", "use_cache", "expand"}, exclude_none=True
158
180
  )
159
181
 
160
182
 
161
- class FullUpdateData(Name[str], Key[str], FullOrganizationTypeMixin[OrganizationType]):
183
+ class FullUpdateData(Name[str]):
162
184
  pass
163
185
 
164
186
 
165
- class PartialUpdateData(
166
- Name[OptStr], Key[OptStr], FullOrganizationTypeMixin[OptOrganizationType]
167
- ):
187
+ class PartialUpdateData(Name[OptStr]):
168
188
  pass
169
189
 
170
190
 
@@ -176,6 +196,7 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
176
196
 
177
197
 
178
198
  class UpdateParameter(
199
+ Expand,
179
200
  UpdateDataMixin[UpdateDataT],
180
201
  IdentifierMixin[OrganizationIdentifier],
181
202
  Generic[UpdateDataT],
@@ -187,6 +208,7 @@ class UpdateParameter(
187
208
  identifier_type: Literal[IdentifierType.ID],
188
209
  identifier_value: int,
189
210
  data: UpdateDataT,
211
+ expand: OptListOfExpandableFields = None,
190
212
  ) -> "UpdateParameter": ...
191
213
  @overload
192
214
  @classmethod
@@ -195,6 +217,7 @@ class UpdateParameter(
195
217
  identifier_type: Literal[IdentifierType.UUID],
196
218
  identifier_value: UUID,
197
219
  data: UpdateDataT,
220
+ expand: OptListOfExpandableFields = None,
198
221
  ) -> "UpdateParameter": ...
199
222
  @overload
200
223
  @classmethod
@@ -203,6 +226,7 @@ class UpdateParameter(
203
226
  identifier_type: Literal[IdentifierType.KEY],
204
227
  identifier_value: str,
205
228
  data: UpdateDataT,
229
+ expand: OptListOfExpandableFields = None,
206
230
  ) -> "UpdateParameter": ...
207
231
  @overload
208
232
  @classmethod
@@ -211,6 +235,7 @@ class UpdateParameter(
211
235
  identifier_type: IdentifierType,
212
236
  identifier_value: IdentifierValueType,
213
237
  data: UpdateDataT,
238
+ expand: OptListOfExpandableFields = None,
214
239
  ) -> "UpdateParameter": ...
215
240
  @classmethod
216
241
  def new(
@@ -218,16 +243,19 @@ class UpdateParameter(
218
243
  identifier_type: IdentifierType,
219
244
  identifier_value: IdentifierValueType,
220
245
  data: UpdateDataT,
246
+ expand: OptListOfExpandableFields = None,
221
247
  ) -> "UpdateParameter":
222
248
  return cls(
223
249
  identifier=OrganizationIdentifier(
224
250
  type=identifier_type, value=identifier_value
225
251
  ),
226
252
  data=data,
253
+ expand=expand,
227
254
  )
228
255
 
229
256
 
230
257
  class StatusUpdateParameter(
258
+ Expand,
231
259
  BaseStatusUpdateParameter[OrganizationIdentifier],
232
260
  ):
233
261
  @overload
@@ -237,6 +265,7 @@ class StatusUpdateParameter(
237
265
  identifier_type: Literal[IdentifierType.ID],
238
266
  identifier_value: int,
239
267
  type: ResourceOperationStatusUpdateType,
268
+ expand: OptListOfExpandableFields = None,
240
269
  ) -> "StatusUpdateParameter": ...
241
270
  @overload
242
271
  @classmethod
@@ -245,6 +274,7 @@ class StatusUpdateParameter(
245
274
  identifier_type: Literal[IdentifierType.UUID],
246
275
  identifier_value: UUID,
247
276
  type: ResourceOperationStatusUpdateType,
277
+ expand: OptListOfExpandableFields = None,
248
278
  ) -> "StatusUpdateParameter": ...
249
279
  @overload
250
280
  @classmethod
@@ -253,6 +283,7 @@ class StatusUpdateParameter(
253
283
  identifier_type: Literal[IdentifierType.KEY],
254
284
  identifier_value: str,
255
285
  type: ResourceOperationStatusUpdateType,
286
+ expand: OptListOfExpandableFields = None,
256
287
  ) -> "StatusUpdateParameter": ...
257
288
  @overload
258
289
  @classmethod
@@ -261,6 +292,7 @@ class StatusUpdateParameter(
261
292
  identifier_type: IdentifierType,
262
293
  identifier_value: IdentifierValueType,
263
294
  type: ResourceOperationStatusUpdateType,
295
+ expand: OptListOfExpandableFields = None,
264
296
  ) -> "StatusUpdateParameter": ...
265
297
  @classmethod
266
298
  def new(
@@ -268,12 +300,14 @@ class StatusUpdateParameter(
268
300
  identifier_type: IdentifierType,
269
301
  identifier_value: IdentifierValueType,
270
302
  type: ResourceOperationStatusUpdateType,
303
+ expand: OptListOfExpandableFields = None,
271
304
  ) -> "StatusUpdateParameter":
272
305
  return cls(
273
306
  identifier=OrganizationIdentifier(
274
307
  type=identifier_type, value=identifier_value
275
308
  ),
276
309
  type=type,
310
+ expand=expand,
277
311
  )
278
312
 
279
313
 
@@ -1,31 +1,31 @@
1
1
  from pydantic import BaseModel, Field
2
2
  from typing import Annotated, Generic, Literal, TypeVar, overload
3
3
  from uuid import UUID
4
- from maleo.enums.status import (
4
+ from nexo.enums.status import (
5
5
  ListOfDataStatuses,
6
6
  FULL_DATA_STATUSES,
7
7
  )
8
- from maleo.schemas.mixins.filter import convert as convert_filter
9
- from maleo.schemas.mixins.general import Codes
10
- from maleo.schemas.mixins.identity import (
8
+ from nexo.schemas.mixins.filter import convert as convert_filter
9
+ from nexo.schemas.mixins.general import Codes
10
+ from nexo.schemas.mixins.identity import (
11
11
  IdentifierMixin,
12
12
  Ids,
13
13
  IntOrganizationId,
14
14
  IntOrganizationIds,
15
15
  UUIDs,
16
16
  )
17
- from maleo.schemas.mixins.sort import convert as convert_sort
18
- from maleo.schemas.operation.enums import ResourceOperationStatusUpdateType
19
- from maleo.schemas.parameter import (
17
+ from nexo.schemas.mixins.sort import convert as convert_sort
18
+ from nexo.schemas.operation.enums import ResourceOperationStatusUpdateType
19
+ from nexo.schemas.parameter import (
20
20
  ReadSingleParameter as BaseReadSingleParameter,
21
21
  ReadPaginatedMultipleParameter,
22
22
  StatusUpdateParameter as BaseStatusUpdateParameter,
23
23
  DeleteSingleParameter as BaseDeleteSingleParameter,
24
24
  )
25
- from maleo.types.dict import StrToAnyDict
26
- from maleo.types.integer import OptInt, OptListOfInts
27
- from maleo.types.string import OptStr, OptListOfStrs
28
- from maleo.types.uuid import OptListOfUUIDs
25
+ from nexo.types.dict import StrToAnyDict
26
+ from nexo.types.integer import OptInt, OptListOfInts
27
+ from nexo.types.string import OptStr, OptListOfStrs
28
+ from nexo.types.uuid import OptListOfUUIDs
29
29
  from ..enums.organization_registration_code import IdentifierType
30
30
  from ..mixins.organization_registration_code import (
31
31
  CodeOrLength,