maleo-identity 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of maleo-identity might be problematic. Click here for more details.
- maleo/identity/dtos.py +26 -12
- maleo/identity/models.py +23 -23
- maleo/identity/schemas/common.py +26 -11
- {maleo_identity-0.1.1.dist-info → maleo_identity-0.1.2.dist-info}/METADATA +1 -1
- {maleo_identity-0.1.1.dist-info → maleo_identity-0.1.2.dist-info}/RECORD +8 -8
- {maleo_identity-0.1.1.dist-info → maleo_identity-0.1.2.dist-info}/WHEEL +0 -0
- {maleo_identity-0.1.1.dist-info → maleo_identity-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {maleo_identity-0.1.1.dist-info → maleo_identity-0.1.2.dist-info}/top_level.txt +0 -0
maleo/identity/dtos.py
CHANGED
|
@@ -26,8 +26,6 @@ from maleo.schemas.mixins.identity import (
|
|
|
26
26
|
IntUserId,
|
|
27
27
|
BirthDate,
|
|
28
28
|
DateOfBirth,
|
|
29
|
-
IntSourceId,
|
|
30
|
-
IntTargetId,
|
|
31
29
|
)
|
|
32
30
|
from maleo.schemas.mixins.timestamp import DataTimestamp
|
|
33
31
|
from maleo.types.datetime import OptDate
|
|
@@ -108,19 +106,34 @@ class SourceOrganizationDTOMixin(BaseModel):
|
|
|
108
106
|
]
|
|
109
107
|
|
|
110
108
|
|
|
109
|
+
class SourceOrganizationRelationDTO(
|
|
110
|
+
Metadata,
|
|
111
|
+
IsBidirectional[bool],
|
|
112
|
+
SourceOrganizationDTOMixin,
|
|
113
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
114
|
+
DataTimestamp,
|
|
115
|
+
DataIdentifier,
|
|
116
|
+
):
|
|
117
|
+
pass
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class SourceOrganizationRelationsDTOMixin(BaseModel):
|
|
121
|
+
sources: Annotated[
|
|
122
|
+
list[SourceOrganizationRelationDTO],
|
|
123
|
+
Field(list[SourceOrganizationRelationDTO](), description="Sources"),
|
|
124
|
+
] = list[SourceOrganizationRelationDTO]()
|
|
125
|
+
|
|
126
|
+
|
|
111
127
|
class TargetOrganizationDTOMixin(BaseModel):
|
|
112
128
|
target: Annotated[
|
|
113
129
|
StandardOrganizationDTO, Field(..., description="Target organization")
|
|
114
130
|
]
|
|
115
131
|
|
|
116
132
|
|
|
117
|
-
class
|
|
133
|
+
class TargetOrganizationRelationDTO(
|
|
118
134
|
Metadata,
|
|
119
135
|
IsBidirectional[bool],
|
|
120
136
|
TargetOrganizationDTOMixin,
|
|
121
|
-
IntTargetId[int],
|
|
122
|
-
SourceOrganizationDTOMixin,
|
|
123
|
-
IntSourceId[int],
|
|
124
137
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
125
138
|
DataTimestamp,
|
|
126
139
|
DataIdentifier,
|
|
@@ -128,15 +141,16 @@ class OrganizationRelationDTO(
|
|
|
128
141
|
pass
|
|
129
142
|
|
|
130
143
|
|
|
131
|
-
class
|
|
132
|
-
|
|
133
|
-
list[
|
|
134
|
-
Field(list[
|
|
135
|
-
] = list[
|
|
144
|
+
class TargetOrganizationRelationsDTOMixin(BaseModel):
|
|
145
|
+
targets: Annotated[
|
|
146
|
+
list[TargetOrganizationRelationDTO],
|
|
147
|
+
Field(list[TargetOrganizationRelationDTO](), description="Targets"),
|
|
148
|
+
] = list[TargetOrganizationRelationDTO]()
|
|
136
149
|
|
|
137
150
|
|
|
138
151
|
class FullOrganizationDTO(
|
|
139
|
-
|
|
152
|
+
TargetOrganizationRelationsDTOMixin,
|
|
153
|
+
SourceOrganizationRelationsDTOMixin,
|
|
140
154
|
OrganizationRegistrationCodeDTOMixin,
|
|
141
155
|
StandardOrganizationDTO,
|
|
142
156
|
):
|
maleo/identity/models.py
CHANGED
|
@@ -94,6 +94,29 @@ class Patient(
|
|
|
94
94
|
)
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
class OrganizationRegistrationCode(
|
|
98
|
+
DataStatus,
|
|
99
|
+
DataTimestamp,
|
|
100
|
+
DataIdentifier,
|
|
101
|
+
):
|
|
102
|
+
__tablename__ = "organization_registration_codes"
|
|
103
|
+
organization_id: Mapped[int] = mapped_column(
|
|
104
|
+
Integer,
|
|
105
|
+
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
106
|
+
unique=True,
|
|
107
|
+
nullable=False,
|
|
108
|
+
)
|
|
109
|
+
code: Mapped[str] = mapped_column(
|
|
110
|
+
name="code", type_=String(36), unique=True, nullable=False
|
|
111
|
+
)
|
|
112
|
+
max_uses: Mapped[int] = mapped_column(
|
|
113
|
+
name="max_uses", type_=Integer, nullable=False, default=1
|
|
114
|
+
)
|
|
115
|
+
current_uses: Mapped[int] = mapped_column(
|
|
116
|
+
name="current_uses", type_=Integer, nullable=False, default=0
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
97
120
|
class OrganizationRelation(
|
|
98
121
|
DataStatus,
|
|
99
122
|
DataTimestamp,
|
|
@@ -123,29 +146,6 @@ class OrganizationRelation(
|
|
|
123
146
|
)
|
|
124
147
|
|
|
125
148
|
|
|
126
|
-
class OrganizationRegistrationCode(
|
|
127
|
-
DataStatus,
|
|
128
|
-
DataTimestamp,
|
|
129
|
-
DataIdentifier,
|
|
130
|
-
):
|
|
131
|
-
__tablename__ = "organization_registration_codes"
|
|
132
|
-
organization_id: Mapped[int] = mapped_column(
|
|
133
|
-
Integer,
|
|
134
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
135
|
-
unique=True,
|
|
136
|
-
nullable=False,
|
|
137
|
-
)
|
|
138
|
-
code: Mapped[str] = mapped_column(
|
|
139
|
-
name="code", type_=String(36), unique=True, nullable=False
|
|
140
|
-
)
|
|
141
|
-
max_uses: Mapped[int] = mapped_column(
|
|
142
|
-
name="max_uses", type_=Integer, nullable=False, default=1
|
|
143
|
-
)
|
|
144
|
-
current_uses: Mapped[int] = mapped_column(
|
|
145
|
-
name="current_uses", type_=Integer, nullable=False, default=0
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
|
|
149
149
|
class Organization(
|
|
150
150
|
DataStatus,
|
|
151
151
|
DataTimestamp,
|
maleo/identity/schemas/common.py
CHANGED
|
@@ -38,8 +38,6 @@ from maleo.schemas.mixins.identity import (
|
|
|
38
38
|
IntUserId,
|
|
39
39
|
BirthDate,
|
|
40
40
|
DateOfBirth,
|
|
41
|
-
IntSourceId,
|
|
42
|
-
IntTargetId,
|
|
43
41
|
)
|
|
44
42
|
from maleo.schemas.mixins.timestamp import DataTimestamp
|
|
45
43
|
from maleo.types.datetime import OptDate
|
|
@@ -133,19 +131,34 @@ class SourceOrganizationSchemaMixin(BaseModel):
|
|
|
133
131
|
]
|
|
134
132
|
|
|
135
133
|
|
|
134
|
+
class SourceOrganizationRelationSchema(
|
|
135
|
+
Metadata,
|
|
136
|
+
IsBidirectional[bool],
|
|
137
|
+
SourceOrganizationSchemaMixin,
|
|
138
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
139
|
+
DataTimestamp,
|
|
140
|
+
DataIdentifier,
|
|
141
|
+
):
|
|
142
|
+
pass
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class SourceOrganizationRelationsSchemaMixin(BaseModel):
|
|
146
|
+
sources: Annotated[
|
|
147
|
+
list[SourceOrganizationRelationSchema],
|
|
148
|
+
Field(list[SourceOrganizationRelationSchema](), description="Sources"),
|
|
149
|
+
] = list[SourceOrganizationRelationSchema]()
|
|
150
|
+
|
|
151
|
+
|
|
136
152
|
class TargetOrganizationSchemaMixin(BaseModel):
|
|
137
153
|
target: Annotated[
|
|
138
154
|
StandardOrganizationSchema, Field(..., description="Target organization")
|
|
139
155
|
]
|
|
140
156
|
|
|
141
157
|
|
|
142
|
-
class
|
|
158
|
+
class TargetOrganizationRelationSchema(
|
|
143
159
|
Metadata,
|
|
144
160
|
IsBidirectional[bool],
|
|
145
161
|
TargetOrganizationSchemaMixin,
|
|
146
|
-
IntTargetId[int],
|
|
147
|
-
SourceOrganizationSchemaMixin,
|
|
148
|
-
IntSourceId[int],
|
|
149
162
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
150
163
|
DataTimestamp,
|
|
151
164
|
DataIdentifier,
|
|
@@ -153,14 +166,16 @@ class OrganizationRelationSchema(
|
|
|
153
166
|
pass
|
|
154
167
|
|
|
155
168
|
|
|
156
|
-
class
|
|
157
|
-
|
|
158
|
-
list[
|
|
159
|
-
Field(list[
|
|
160
|
-
] = list[
|
|
169
|
+
class TargetOrganizationRelationsSchemaMixin(BaseModel):
|
|
170
|
+
targets: Annotated[
|
|
171
|
+
list[TargetOrganizationRelationSchema],
|
|
172
|
+
Field(list[TargetOrganizationRelationSchema](), description="Targets"),
|
|
173
|
+
] = list[TargetOrganizationRelationSchema]()
|
|
161
174
|
|
|
162
175
|
|
|
163
176
|
class FullOrganizationSchema(
|
|
177
|
+
TargetOrganizationRelationsSchemaMixin,
|
|
178
|
+
SourceOrganizationRelationsSchemaMixin,
|
|
164
179
|
OrganizationRegistrationCodeSchemaMixin,
|
|
165
180
|
StandardOrganizationSchema,
|
|
166
181
|
):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
maleo/identity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
maleo/identity/dtos.py,sha256=
|
|
3
|
-
maleo/identity/models.py,sha256=
|
|
2
|
+
maleo/identity/dtos.py,sha256=XhfLat9emtRaVl-2McVDz8zunyoshAK7gm2OYmhZ_ZE,7876
|
|
3
|
+
maleo/identity/models.py,sha256=aBYbkkd07BzH2zRq3q_D80xMR8DdhCiw1eQ2EYa9ZTQ,10223
|
|
4
4
|
maleo/identity/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
maleo/identity/constants/api_key.py,sha256=e7CsTodUBgyoX30SJUnYx457WBZeRFyyeaOFGsZ-7mY,264
|
|
6
6
|
maleo/identity/constants/organization.py,sha256=Jeewz4VlaTmuHHDqNZUZyLD3bdndQjpx9K0EabhCFUM,259
|
|
@@ -34,7 +34,7 @@ maleo/identity/mixins/user.py,sha256=UHoMgFJXptE9x9QsR07KG2bgp5OlCNqvYjEtP9S3TIY
|
|
|
34
34
|
maleo/identity/mixins/user_profile.py,sha256=LFHAzGD-3wli6YJGfl9-Sy0gtQHkhgvrZ5EzOfl1vXY,1174
|
|
35
35
|
maleo/identity/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
maleo/identity/schemas/api_key.py,sha256=UnQfnoEMkFgOfWDKai6wWNyD5QsovyoOov6jN52QPKI,3713
|
|
37
|
-
maleo/identity/schemas/common.py,sha256=
|
|
37
|
+
maleo/identity/schemas/common.py,sha256=AxI4NKUM30Y4oS-jDjhdNnJGF-0-kOCA0wCnUl9ESlc,9213
|
|
38
38
|
maleo/identity/schemas/organization.py,sha256=hcKYw-fObxvme2PUkU9jWk0dgj6XIQdU4gIs-Z3JY08,5391
|
|
39
39
|
maleo/identity/schemas/organization_registration_code.py,sha256=jAP7MGb_28wh1WoBZDl2FSJBxKFRH56YSQvMFQ5_iyo,4731
|
|
40
40
|
maleo/identity/schemas/organization_relation.py,sha256=ZQauGidff-cAFY1gS9i3XRwauyWLg1f8xFES7mL6B8M,5083
|
|
@@ -60,8 +60,8 @@ maleo/identity/utils/organization.py,sha256=jU-PLlxPbsRciid82p-ScdLSydspI-5ofJX7
|
|
|
60
60
|
maleo/identity/utils/user.py,sha256=Mk1NTrViz1nBJxtPZRWdQmYHjTPxxc61a02eyikEBoU,1459
|
|
61
61
|
maleo/identity/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
62
|
maleo/identity/validators/patient.py,sha256=b4krKsXMuwUCXYuzCeUXtOXNTaEkKtQaAYmAmuVYIgo,221
|
|
63
|
-
maleo_identity-0.1.
|
|
64
|
-
maleo_identity-0.1.
|
|
65
|
-
maleo_identity-0.1.
|
|
66
|
-
maleo_identity-0.1.
|
|
67
|
-
maleo_identity-0.1.
|
|
63
|
+
maleo_identity-0.1.2.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
64
|
+
maleo_identity-0.1.2.dist-info/METADATA,sha256=zabPBMKNTilRuDNdeqgQuVzuMtIybcdiD-7_u3PLfd0,3583
|
|
65
|
+
maleo_identity-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
66
|
+
maleo_identity-0.1.2.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
67
|
+
maleo_identity-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|