maleo-identity 0.1.3__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of maleo-identity might be problematic. Click here for more details.

Files changed (72) hide show
  1. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/PKG-INFO +1 -1
  2. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/maleo_identity.egg-info/PKG-INFO +1 -1
  3. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/maleo_identity.egg-info/SOURCES.txt +0 -1
  4. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/pyproject.toml +1 -1
  5. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/organization.py +0 -8
  6. maleo_identity-0.1.5/src/enums/patient.py +13 -0
  7. maleo_identity-0.1.3/src/enums/patient.py → maleo_identity-0.1.5/src/enums/user.py +2 -11
  8. maleo_identity-0.1.5/src/enums/user_profile.py +13 -0
  9. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/common.py +28 -38
  10. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/organization.py +4 -29
  11. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/patient.py +12 -27
  12. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/user.py +3 -15
  13. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/user_profile.py +4 -21
  14. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/utils/organization.py +0 -30
  15. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/utils/user.py +0 -30
  16. maleo_identity-0.1.3/src/dtos.py +0 -303
  17. maleo_identity-0.1.3/src/enums/user.py +0 -35
  18. maleo_identity-0.1.3/src/enums/user_profile.py +0 -22
  19. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/LICENSE +0 -0
  20. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/README.md +0 -0
  21. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/maleo_identity.egg-info/dependency_links.txt +0 -0
  22. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/maleo_identity.egg-info/requires.txt +0 -0
  23. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/maleo_identity.egg-info/top_level.txt +0 -0
  24. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/setup.cfg +0 -0
  25. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/__init__.py +0 -0
  26. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/__init__.py +0 -0
  27. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/api_key.py +0 -0
  28. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/organization.py +0 -0
  29. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/organization_registration_code.py +0 -0
  30. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/organization_relation.py +0 -0
  31. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/patient.py +0 -0
  32. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/user.py +0 -0
  33. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/user_medical_role.py +0 -0
  34. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/user_organization_role.py +0 -0
  35. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/user_profile.py +0 -0
  36. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/constants/user_system_role.py +0 -0
  37. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/__init__.py +0 -0
  38. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/api_key.py +0 -0
  39. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/organization_registration_code.py +0 -0
  40. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/organization_relation.py +0 -0
  41. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/user_medical_role.py +0 -0
  42. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/user_organization_role.py +0 -0
  43. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/enums/user_system_role.py +0 -0
  44. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/__init__.py +0 -0
  45. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/api_key.py +0 -0
  46. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/common.py +0 -0
  47. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/organization.py +0 -0
  48. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/organization_registration_code.py +0 -0
  49. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/organization_relation.py +0 -0
  50. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/patient.py +0 -0
  51. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/user.py +0 -0
  52. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/mixins/user_profile.py +0 -0
  53. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/models.py +0 -0
  54. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/__init__.py +0 -0
  55. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/api_key.py +0 -0
  56. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/organization_registration_code.py +0 -0
  57. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/organization_relation.py +0 -0
  58. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/user_medical_role.py +0 -0
  59. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/user_organization_role.py +0 -0
  60. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/schemas/user_system_role.py +0 -0
  61. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/__init__.py +0 -0
  62. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/api_key.py +0 -0
  63. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/organization.py +0 -0
  64. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/organization_registration_code.py +0 -0
  65. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/organization_relation.py +0 -0
  66. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/patient.py +0 -0
  67. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/user.py +0 -0
  68. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/user_medical_role.py +0 -0
  69. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/user_organization_role.py +0 -0
  70. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/user_profile.py +0 -0
  71. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/types/user_system_role.py +0 -0
  72. {maleo_identity-0.1.3 → maleo_identity-0.1.5}/src/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-identity
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: MaleoIdentity service package
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: Proprietary
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-identity
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: MaleoIdentity service package
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: Proprietary
@@ -7,7 +7,6 @@ maleo_identity.egg-info/dependency_links.txt
7
7
  maleo_identity.egg-info/requires.txt
8
8
  maleo_identity.egg-info/top_level.txt
9
9
  src/__init__.py
10
- src/dtos.py
11
10
  src/models.py
12
11
  src/constants/__init__.py
13
12
  src/constants/api_key.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo-identity"
7
- version = "0.1.3"
7
+ version = "0.1.5"
8
8
  description = "MaleoIdentity service package"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
@@ -19,11 +19,3 @@ class IdentifierType(StrEnum):
19
19
  @classmethod
20
20
  def choices(cls) -> ListOfStrs:
21
21
  return [e.value for e in cls]
22
-
23
-
24
- class ExpandableField(StrEnum):
25
- ORGANIZATION_TYPE = "organization_type"
26
-
27
-
28
- ListOfExpandableFields = list[ExpandableField]
29
- OptListOfExpandableFields = ListOfExpandableFields | None
@@ -0,0 +1,13 @@
1
+ from enum import StrEnum
2
+ from maleo.types.string import ListOfStrs
3
+
4
+
5
+ class IdentifierType(StrEnum):
6
+ ID = "id"
7
+ UUID = "uuid"
8
+ ID_CARD = "id_card"
9
+ PASSPORT = "passport"
10
+
11
+ @classmethod
12
+ def choices(cls) -> ListOfStrs:
13
+ return [e.value for e in cls]
@@ -14,18 +14,9 @@ class Granularity(StrEnum):
14
14
  class IdentifierType(StrEnum):
15
15
  ID = "id"
16
16
  UUID = "uuid"
17
- ID_CARD = "id_card"
18
- PASSPORT = "passport"
17
+ USERNAME = "username"
18
+ EMAIL = "email"
19
19
 
20
20
  @classmethod
21
21
  def choices(cls) -> ListOfStrs:
22
22
  return [e.value for e in cls]
23
-
24
-
25
- class ExpandableField(StrEnum):
26
- GENDER = "gender"
27
- BLOOD_TYPE = "blood_type"
28
-
29
-
30
- ListOfExpandableFields = list[ExpandableField]
31
- OptListOfExpandableFields = ListOfExpandableFields | None
@@ -0,0 +1,13 @@
1
+ from enum import StrEnum
2
+ from maleo.types.string import ListOfStrs
3
+
4
+
5
+ class IdentifierType(StrEnum):
6
+ ID = "id"
7
+ UUID = "uuid"
8
+ USER_ID = "user_id"
9
+ ID_CARD = "id_card"
10
+
11
+ @classmethod
12
+ def choices(cls) -> ListOfStrs:
13
+ return [e.value for e in cls]
@@ -1,37 +1,25 @@
1
1
  from datetime import date
2
2
  from pydantic import BaseModel, Field
3
3
  from typing import Annotated, Generic, TypeVar, Type
4
- from maleo.enums.identity import OptRhesus, RhesusMixin
5
- from maleo.metadata.schemas.organization_role import (
6
- FullOrganizationRoleMixin,
7
- KeyOrStandardSchema as KeyOrStandardOrganizationRoleSchema,
8
- )
9
- from maleo.enums.status import DataStatus as DataStatusEnum, SimpleDataStatusMixin
10
- from maleo.metadata.schemas.blood_type import (
11
- FullBloodTypeMixin,
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.metadata.schemas.organization_type import (
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
- FullBloodTypeMixin[OptKeyOrStandardBloodTypeSchema],
77
- FullGenderMixin[KeyOrStandardGenderSchema],
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[KeyOrStandardOrganizationTypeSchema],
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[KeyOrStandardMedicalRoleSchema],
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[KeyOrStandardOrganizationRoleSchema],
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[str],
230
- FullBloodTypeMixin[OptKeyOrStandardBloodTypeSchema],
231
- FullGenderMixin[OptKeyOrStandardGenderSchema],
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[KeyOrStandardSystemRoleSchema],
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[KeyOrStandardUserTypeSchema],
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, OptListOfExpandableFields
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 CreateData(InsertData):
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", "expand"}, exclude_none=True
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 Annotated, Generic, Literal, TypeVar, overload
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, OptListOfExpandableFields
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 Expand(BaseModel):
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(CreateQuery, CreateData):
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", "expand"}, exclude_none=True
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
@@ -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, OptListOfExpandableFields
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", "expand"}, exclude_none=True
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 Annotated, Generic, Literal, TypeVar, overload
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, OptListOfExpandableFields
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", "expand"}, exclude_none=True
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