maleo-identity 0.1.11__py3-none-any.whl → 0.1.27__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- maleo/identity/constants/api_key.py +2 -2
- maleo/identity/constants/organization.py +1 -1
- maleo/identity/constants/organization_registration_code.py +2 -2
- maleo/identity/constants/organization_relation.py +2 -2
- maleo/identity/constants/patient.py +1 -1
- maleo/identity/constants/user.py +1 -1
- maleo/identity/constants/user_medical_role.py +2 -2
- maleo/identity/constants/user_organization_role.py +2 -2
- maleo/identity/constants/user_profile.py +1 -1
- maleo/identity/constants/user_system_role.py +6 -2
- maleo/identity/enums/api_key.py +13 -1
- maleo/identity/enums/organization.py +4 -0
- maleo/identity/enums/organization_registration_code.py +4 -0
- maleo/identity/enums/organization_relation.py +11 -1
- maleo/identity/enums/patient.py +18 -2
- maleo/identity/enums/user.py +4 -0
- maleo/identity/enums/user_medical_role.py +11 -1
- maleo/identity/enums/user_organization_role.py +11 -1
- maleo/identity/enums/user_profile.py +18 -0
- maleo/identity/enums/user_system_role.py +24 -1
- maleo/identity/mixins/api_key.py +11 -4
- maleo/identity/mixins/organization.py +3 -1
- maleo/identity/mixins/organization_registration_code.py +40 -4
- maleo/identity/mixins/organization_relation.py +11 -4
- maleo/identity/mixins/patient.py +13 -44
- maleo/identity/mixins/user.py +3 -1
- maleo/identity/mixins/user_medical_role.py +11 -4
- maleo/identity/mixins/user_organization_role.py +11 -4
- maleo/identity/mixins/user_profile.py +26 -3
- maleo/identity/mixins/user_system_role.py +19 -6
- maleo/identity/schemas/api_key.py +21 -4
- maleo/identity/schemas/common.py +39 -25
- maleo/identity/schemas/organization.py +26 -0
- maleo/identity/schemas/organization_registration_code.py +19 -2
- maleo/identity/schemas/organization_relation.py +23 -5
- maleo/identity/schemas/patient.py +56 -31
- maleo/identity/schemas/user.py +23 -0
- maleo/identity/schemas/user_medical_role.py +25 -6
- maleo/identity/schemas/user_organization_role.py +25 -6
- maleo/identity/schemas/user_profile.py +73 -7
- maleo/identity/schemas/user_system_role.py +52 -11
- maleo/identity/types/api_key.py +2 -2
- maleo/identity/types/organization_relation.py +2 -2
- maleo/identity/types/patient.py +1 -1
- maleo/identity/types/user_medical_role.py +2 -2
- maleo/identity/types/user_organization_role.py +2 -2
- maleo/identity/types/user_system_role.py +3 -2
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/METADATA +6 -5
- maleo_identity-0.1.27.dist-info/RECORD +66 -0
- maleo/identity/models.py +0 -337
- maleo_identity-0.1.11.dist-info/RECORD +0 -67
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/WHEEL +0 -0
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/licenses/LICENSE +0 -0
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
maleo/identity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
maleo/identity/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
maleo/identity/constants/api_key.py,sha256=pHkcAqOu6eQWtHAovHfoXDPS-Eg6JP9u4ryq-M-uZ88,262
|
|
4
|
+
maleo/identity/constants/organization.py,sha256=QblTibK3GDkSdoniAlg7HGBd3g5k36Ep7KbSE2QPA4U,257
|
|
5
|
+
maleo/identity/constants/organization_registration_code.py,sha256=yxiPciVb68BIgpYJyG7n4KAixFGtYDFky3Vf1ftr87E,354
|
|
6
|
+
maleo/identity/constants/organization_relation.py,sha256=qGlwLnzSQB3HFOvJ13HBLVcj9-TN1QAqr7LlQG0Sb48,318
|
|
7
|
+
maleo/identity/constants/patient.py,sha256=F_OP2yp67L34ygbvPV7GLhezWW7RV7KE7OZsOHwgx_U,201
|
|
8
|
+
maleo/identity/constants/user.py,sha256=lIwXkUzbE6WtHc8RdHSmVa4BAVlLHtdUj2-l0TVY7EY,189
|
|
9
|
+
maleo/identity/constants/user_medical_role.py,sha256=jxPDawhnauLBoWqJ1SW4p6nUkPASIJVYrHPcdTo_7qI,302
|
|
10
|
+
maleo/identity/constants/user_organization_role.py,sha256=g7JTYhv6jih0QoF4-HrQmNf4DS3dnIVONTcQZgOONjI,322
|
|
11
|
+
maleo/identity/constants/user_profile.py,sha256=qNox8XB8gQlVj2rnsTU8j59gLgLRINRQN0rcyVuEQAw,257
|
|
12
|
+
maleo/identity/constants/user_system_role.py,sha256=zc44fMwguNkErmHQ2P7I-L_KU__7PpX8ihdAyVKUx-Y,400
|
|
13
|
+
maleo/identity/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
maleo/identity/enums/api_key.py,sha256=twpkiI21x52roagXHJjq4vhMLv9WPGhWFtPM55LSZ-w,721
|
|
15
|
+
maleo/identity/enums/organization.py,sha256=y9sLqKPx9iC2402MKY8GTZ0_WWNRJT5_rVQkG_CCgso,476
|
|
16
|
+
maleo/identity/enums/organization_registration_code.py,sha256=Cz7ZIo2a1lTXko9rJLQerNP90qMvrvV7gSAKkGup418,352
|
|
17
|
+
maleo/identity/enums/organization_relation.py,sha256=-GxBCzUi-PFrICnHqray2PtFZb6LoG7NluDmyjljOa8,628
|
|
18
|
+
maleo/identity/enums/patient.py,sha256=gonmheVM5S99Wtddha7uJI4FzVOl9V0l1-ov1a-Kcqc,623
|
|
19
|
+
maleo/identity/enums/user.py,sha256=Vv_5fHov_cPxKCcaxVeNNJgZL_wa2uewtr7w4smiVVU,506
|
|
20
|
+
maleo/identity/enums/user_medical_role.py,sha256=KvPDu66wIh_sqvx0dyW38aTlCt5e_kRDcJ05Rk0rOd4,636
|
|
21
|
+
maleo/identity/enums/user_organization_role.py,sha256=bV07sZYttbJPfefkp7u9Bkc4V1e3xsyhtErtpkXb-Xg,641
|
|
22
|
+
maleo/identity/enums/user_profile.py,sha256=WvlEnYqKxlImEgYARl-NvEkz3Zm-HLvHCbsXxoePjTI,671
|
|
23
|
+
maleo/identity/enums/user_system_role.py,sha256=zINGAt5D1nZ95ddvLXrFZaO_2k15S5gc4S9jF8sZ72s,925
|
|
24
|
+
maleo/identity/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
+
maleo/identity/mixins/api_key.py,sha256=T-MupQfKe5ru_kO-AQ3JZ11aqK92lFOgsIUy2cJWoo8,2383
|
|
26
|
+
maleo/identity/mixins/common.py,sha256=diWtUiPMI_ypHtDrmI5y8IArxCdomo9Gt6X69iFhyuw,905
|
|
27
|
+
maleo/identity/mixins/organization.py,sha256=P_GW483KCK4_ds9Jm82RVXEszwGgSzq1PHQk0ykgghk,2556
|
|
28
|
+
maleo/identity/mixins/organization_registration_code.py,sha256=t_OHVoJobjYyfOVwAw_I3nebIFgG-AodApmIhDCVYmM,4693
|
|
29
|
+
maleo/identity/mixins/organization_relation.py,sha256=Fz_-2d6kdX8olzj67AN2UYj_Dw741SqS6ZQSllnujL8,2881
|
|
30
|
+
maleo/identity/mixins/patient.py,sha256=unDmyazC5tyIsoXtAjMyWjAOOoxgMXa2DYfg6vZbLGI,2193
|
|
31
|
+
maleo/identity/mixins/user.py,sha256=ShTtmt5mTSrJwbffnFePP7IXC08j2q1BKsAmV32YEiM,3537
|
|
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=hha88X83ugGEPsXAdUw-0iQK11eGZyutMCQLkk3pywQ,4401
|
|
35
|
+
maleo/identity/mixins/user_system_role.py,sha256=7L0C-sFCMzjUZYk2ZJZ6FLXJwvMO66KaYWODW1oFXAE,2585
|
|
36
|
+
maleo/identity/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
+
maleo/identity/schemas/api_key.py,sha256=_JWrUwrRCqxTrcan-eKMegNVU1T46gERNcr8pNK_Y-U,5376
|
|
38
|
+
maleo/identity/schemas/common.py,sha256=-ijdgmyz1xo8CYpKkh34iioZtIs-im5akHt1C54DzY0,9110
|
|
39
|
+
maleo/identity/schemas/organization.py,sha256=0oVnuvB-E55AZ2h-PFoprY9wyyKi-xPLErXJW6yrBn8,9302
|
|
40
|
+
maleo/identity/schemas/organization_registration_code.py,sha256=6LzKsIXt5DNQv1605dRsv2DmaonDLN36jgHyi9xxY-k,9192
|
|
41
|
+
maleo/identity/schemas/organization_relation.py,sha256=9HGZypuhpK9egCHVDS1nh_lm5D0osxYM_4KmEEV8sHI,9487
|
|
42
|
+
maleo/identity/schemas/patient.py,sha256=qhycLtZfEDL8FWdT5GSe63so_9fdRXW_vAPNU0-kNi8,10222
|
|
43
|
+
maleo/identity/schemas/user.py,sha256=y2X_2QckxrO2qWPYbn5RIMsK4MYgJU1V3huKTX3C7ds,9390
|
|
44
|
+
maleo/identity/schemas/user_medical_role.py,sha256=zZdsRmty2InIthAvEgrXDWu7uv7Ez5dQ0XX86-JSE4E,9303
|
|
45
|
+
maleo/identity/schemas/user_organization_role.py,sha256=r_9zEjL7tmDzSdsflf80qez2DgbGNEoueHCmM9wWOZo,9475
|
|
46
|
+
maleo/identity/schemas/user_profile.py,sha256=h_hwlHabHahGToio3YXIbquM-41y7qtT2GFxt8DR4YU,11167
|
|
47
|
+
maleo/identity/schemas/user_system_role.py,sha256=89vucqAxQjjfe0CFd6Z76008de5JxnZb56Zi1GU-Y-A,10095
|
|
48
|
+
maleo/identity/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
+
maleo/identity/types/api_key.py,sha256=dJ4dnw9xYwedJVmSlQhGJrDFlY91T7-2EibP5FI_-rM,198
|
|
50
|
+
maleo/identity/types/organization.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
51
|
+
maleo/identity/types/organization_registration_code.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
52
|
+
maleo/identity/types/organization_relation.py,sha256=slyRLcaT1gatzXCufzawAspwM18KeuCBTND0c3tLzQc,230
|
|
53
|
+
maleo/identity/types/patient.py,sha256=DJ-l-Ft2atX2oMzExo381PTSgdpVCtqBVSxZlmF_pCA,57
|
|
54
|
+
maleo/identity/types/user.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
55
|
+
maleo/identity/types/user_medical_role.py,sha256=xQohfQyK1D6ngjUUiJYfA5pMJaFYi7_nNmeuNvgMlMg,207
|
|
56
|
+
maleo/identity/types/user_organization_role.py,sha256=YJxj1TUgsc4kNG4ejOJDxExHBjzXKHD0QlB6cEX0WcU,222
|
|
57
|
+
maleo/identity/types/user_profile.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
58
|
+
maleo/identity/types/user_system_role.py,sha256=9kNZ56HOMCdiT7fsT9uB2w0p8iQyfclYjAXo3kKUF_w,241
|
|
59
|
+
maleo/identity/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
+
maleo/identity/utils/organization.py,sha256=aEegzeoNLUptrScUB5kWrYlJj7dzTZeVXymltE5lWpE,874
|
|
61
|
+
maleo/identity/utils/user.py,sha256=1pyfmAbXkAEOo6WM2KRA_kRnFi0O_A2ZUEqv01wY-cU,794
|
|
62
|
+
maleo_identity-0.1.27.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
63
|
+
maleo_identity-0.1.27.dist-info/METADATA,sha256=Sw79f_sMcza3NRQ-Hd60mow7zoZpGJG4o41_ZxltTO0,3584
|
|
64
|
+
maleo_identity-0.1.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
65
|
+
maleo_identity-0.1.27.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
66
|
+
maleo_identity-0.1.27.dist-info/RECORD,,
|
maleo/identity/models.py
DELETED
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
from datetime import date
|
|
2
|
-
from sqlalchemy import CheckConstraint, ForeignKey, UniqueConstraint
|
|
3
|
-
from sqlalchemy.dialects.postgresql import JSONB, UUID as PostgreSQLUUID
|
|
4
|
-
from sqlalchemy.orm import Mapped, mapped_column
|
|
5
|
-
from sqlalchemy.types import Boolean, Date, Enum, Integer, String, Text
|
|
6
|
-
from uuid import UUID, uuid4
|
|
7
|
-
from maleo.enums.identity import (
|
|
8
|
-
BloodType,
|
|
9
|
-
OptBloodType,
|
|
10
|
-
Rhesus,
|
|
11
|
-
OptRhesus,
|
|
12
|
-
Gender,
|
|
13
|
-
OptGender,
|
|
14
|
-
)
|
|
15
|
-
from maleo.enums.organization import (
|
|
16
|
-
OrganizationType,
|
|
17
|
-
OrganizationRelation as OrganizationRelationEnum,
|
|
18
|
-
OrganizationRole,
|
|
19
|
-
)
|
|
20
|
-
from maleo.enums.medical import MedicalRole
|
|
21
|
-
from maleo.enums.system import SystemRole
|
|
22
|
-
from maleo.enums.user import UserType
|
|
23
|
-
from maleo.schemas.model import DataIdentifier, DataStatus, DataTimestamp
|
|
24
|
-
from maleo.types.integer import OptInt
|
|
25
|
-
from maleo.types.misc import OptListOfAnyOrStrToAnyDict
|
|
26
|
-
from maleo.types.string import OptStr
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class APIKey(
|
|
30
|
-
DataStatus,
|
|
31
|
-
DataTimestamp,
|
|
32
|
-
DataIdentifier,
|
|
33
|
-
):
|
|
34
|
-
__tablename__ = "api_keys"
|
|
35
|
-
user_id: Mapped[int] = mapped_column(
|
|
36
|
-
Integer,
|
|
37
|
-
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
38
|
-
nullable=False,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
organization_id: Mapped[OptInt] = mapped_column(
|
|
42
|
-
Integer,
|
|
43
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
api_key: Mapped[str] = mapped_column(
|
|
47
|
-
name="api_key", type_=String(255), unique=True, nullable=False
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
__table_args__ = (
|
|
51
|
-
UniqueConstraint("user_id", "organization_id", name="uq_user_organization"),
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
class Patient(
|
|
56
|
-
DataStatus,
|
|
57
|
-
DataTimestamp,
|
|
58
|
-
DataIdentifier,
|
|
59
|
-
):
|
|
60
|
-
__tablename__ = "patients"
|
|
61
|
-
user_id: Mapped[int] = mapped_column(
|
|
62
|
-
Integer,
|
|
63
|
-
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
64
|
-
nullable=False,
|
|
65
|
-
)
|
|
66
|
-
organization_id: Mapped[int] = mapped_column(
|
|
67
|
-
Integer,
|
|
68
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
69
|
-
nullable=False,
|
|
70
|
-
)
|
|
71
|
-
id_card: Mapped[OptStr] = mapped_column(
|
|
72
|
-
name="id_card", type_=String(16), unique=True
|
|
73
|
-
)
|
|
74
|
-
passport: Mapped[OptStr] = mapped_column(
|
|
75
|
-
name="passport", type_=String(9), unique=True
|
|
76
|
-
)
|
|
77
|
-
full_name: Mapped[str] = mapped_column(
|
|
78
|
-
name="full_name", type_=String(200), nullable=False
|
|
79
|
-
)
|
|
80
|
-
place_of_birth: Mapped[OptStr] = mapped_column(
|
|
81
|
-
name="place_of_birth", type_=String(50)
|
|
82
|
-
)
|
|
83
|
-
date_of_birth: Mapped[date] = mapped_column(
|
|
84
|
-
name="date_of_birth", type_=Date, nullable=False
|
|
85
|
-
)
|
|
86
|
-
gender: Mapped[Gender] = mapped_column(
|
|
87
|
-
name="gender", type_=Enum(Gender, name="gender"), nullable=False
|
|
88
|
-
)
|
|
89
|
-
blood_type: Mapped[OptBloodType] = mapped_column(
|
|
90
|
-
name="blood_type", type_=Enum(BloodType, name="blood_type")
|
|
91
|
-
)
|
|
92
|
-
rhesus: Mapped[OptRhesus] = mapped_column(
|
|
93
|
-
name="rhesus", type_=Enum(Rhesus, name="rhesus")
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
__table_args__ = (
|
|
97
|
-
CheckConstraint(
|
|
98
|
-
"id_card IS NOT NULL OR passport IS NOT NULL",
|
|
99
|
-
name="chk_id_card_or_passport",
|
|
100
|
-
),
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class OrganizationRegistrationCode(
|
|
105
|
-
DataStatus,
|
|
106
|
-
DataTimestamp,
|
|
107
|
-
DataIdentifier,
|
|
108
|
-
):
|
|
109
|
-
__tablename__ = "organization_registration_codes"
|
|
110
|
-
organization_id: Mapped[int] = mapped_column(
|
|
111
|
-
Integer,
|
|
112
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
113
|
-
unique=True,
|
|
114
|
-
nullable=False,
|
|
115
|
-
)
|
|
116
|
-
code: Mapped[str] = mapped_column(
|
|
117
|
-
name="code", type_=String(36), unique=True, nullable=False
|
|
118
|
-
)
|
|
119
|
-
current_uses: Mapped[int] = mapped_column(
|
|
120
|
-
name="current_uses", type_=Integer, nullable=False, default=0
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
class OrganizationRelation(
|
|
125
|
-
DataStatus,
|
|
126
|
-
DataTimestamp,
|
|
127
|
-
DataIdentifier,
|
|
128
|
-
):
|
|
129
|
-
__tablename__ = "organization_relations"
|
|
130
|
-
source_id: Mapped[int] = mapped_column(
|
|
131
|
-
Integer,
|
|
132
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
133
|
-
nullable=False,
|
|
134
|
-
)
|
|
135
|
-
target_id: Mapped[int] = mapped_column(
|
|
136
|
-
Integer,
|
|
137
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
138
|
-
nullable=False,
|
|
139
|
-
)
|
|
140
|
-
relation: Mapped[OrganizationRelationEnum] = mapped_column(
|
|
141
|
-
name="relation",
|
|
142
|
-
type_=Enum(OrganizationRelationEnum, name="organization_relation"),
|
|
143
|
-
nullable=False,
|
|
144
|
-
)
|
|
145
|
-
is_bidirectional: Mapped[bool] = mapped_column(
|
|
146
|
-
name="is_bidirectional", type_=Boolean, default=False, nullable=False
|
|
147
|
-
)
|
|
148
|
-
meta: Mapped[OptListOfAnyOrStrToAnyDict] = mapped_column(
|
|
149
|
-
name="meta", type_=JSONB, default=None
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
class Organization(
|
|
154
|
-
DataStatus,
|
|
155
|
-
DataTimestamp,
|
|
156
|
-
DataIdentifier,
|
|
157
|
-
):
|
|
158
|
-
__tablename__ = "organizations"
|
|
159
|
-
organization_type: Mapped[OrganizationType] = mapped_column(
|
|
160
|
-
name="organization_type",
|
|
161
|
-
type_=Enum(OrganizationType, name="organization_type"),
|
|
162
|
-
default=OrganizationType.REGULAR,
|
|
163
|
-
nullable=False,
|
|
164
|
-
)
|
|
165
|
-
key: Mapped[str] = mapped_column(
|
|
166
|
-
name="key", type_=String(255), unique=True, nullable=False
|
|
167
|
-
)
|
|
168
|
-
name: Mapped[str] = mapped_column(name="name", type_=String(255), nullable=False)
|
|
169
|
-
secret: Mapped[UUID] = mapped_column(
|
|
170
|
-
name="secret",
|
|
171
|
-
type_=PostgreSQLUUID(as_uuid=True),
|
|
172
|
-
default=uuid4,
|
|
173
|
-
unique=True,
|
|
174
|
-
nullable=False,
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
class UserMedicalRole(DataStatus, DataTimestamp, DataIdentifier):
|
|
179
|
-
__tablename__ = "user_medical_roles"
|
|
180
|
-
user_id: Mapped[int] = mapped_column(
|
|
181
|
-
Integer,
|
|
182
|
-
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
183
|
-
nullable=False,
|
|
184
|
-
)
|
|
185
|
-
organization_id: Mapped[int] = mapped_column(
|
|
186
|
-
Integer,
|
|
187
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
188
|
-
nullable=False,
|
|
189
|
-
)
|
|
190
|
-
medical_role: Mapped[MedicalRole] = mapped_column(
|
|
191
|
-
name="medical_role",
|
|
192
|
-
type_=Enum(MedicalRole, name="medical_role"),
|
|
193
|
-
nullable=False,
|
|
194
|
-
)
|
|
195
|
-
|
|
196
|
-
__table_args__ = (
|
|
197
|
-
UniqueConstraint(
|
|
198
|
-
"user_id", "organization_id", "medical_role", name="uq_user_medical_role"
|
|
199
|
-
),
|
|
200
|
-
)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
class UserOrganizationRole(DataStatus, DataTimestamp, DataIdentifier):
|
|
204
|
-
__tablename__ = "user_organization_roles_v2"
|
|
205
|
-
user_id: Mapped[int] = mapped_column(
|
|
206
|
-
Integer,
|
|
207
|
-
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
208
|
-
nullable=False,
|
|
209
|
-
)
|
|
210
|
-
organization_id: Mapped[int] = mapped_column(
|
|
211
|
-
Integer,
|
|
212
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
213
|
-
nullable=False,
|
|
214
|
-
)
|
|
215
|
-
organization_role: Mapped[OrganizationRole] = mapped_column(
|
|
216
|
-
name="organization_role",
|
|
217
|
-
type_=Enum(OrganizationRole, name="organization_role"),
|
|
218
|
-
nullable=False,
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
__table_args__ = (
|
|
222
|
-
UniqueConstraint(
|
|
223
|
-
"user_id",
|
|
224
|
-
"organization_id",
|
|
225
|
-
"organization_role",
|
|
226
|
-
name="uq_user_organization_role",
|
|
227
|
-
),
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
class UserProfile(
|
|
232
|
-
DataStatus,
|
|
233
|
-
DataTimestamp,
|
|
234
|
-
DataIdentifier,
|
|
235
|
-
):
|
|
236
|
-
__tablename__ = "user_profiles"
|
|
237
|
-
user_id: Mapped[int] = mapped_column(
|
|
238
|
-
Integer,
|
|
239
|
-
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
240
|
-
nullable=False,
|
|
241
|
-
)
|
|
242
|
-
id_card: Mapped[OptStr] = mapped_column(name="id_card", type_=String(16))
|
|
243
|
-
leading_title: Mapped[OptStr] = mapped_column(
|
|
244
|
-
name="leading_title", type_=String(25)
|
|
245
|
-
)
|
|
246
|
-
first_name: Mapped[str] = mapped_column(
|
|
247
|
-
name="first_name", type_=String(50), nullable=False
|
|
248
|
-
)
|
|
249
|
-
middle_name: Mapped[OptStr] = mapped_column(name="middle_name", type_=String(50))
|
|
250
|
-
last_name: Mapped[str] = mapped_column(
|
|
251
|
-
name="last_name", type_=String(50), nullable=False
|
|
252
|
-
)
|
|
253
|
-
ending_title: Mapped[OptStr] = mapped_column(name="ending_title", type_=String(25))
|
|
254
|
-
full_name: Mapped[str] = mapped_column(
|
|
255
|
-
name="full_name", type_=String(200), nullable=False
|
|
256
|
-
)
|
|
257
|
-
birth_place: Mapped[OptStr] = mapped_column(name="birth_place", type_=String(50))
|
|
258
|
-
birth_date: Mapped[date] = mapped_column(name="birth_date", type_=Date)
|
|
259
|
-
gender: Mapped[OptGender] = mapped_column(
|
|
260
|
-
name="gender", type_=Enum(Gender, name="gender")
|
|
261
|
-
)
|
|
262
|
-
blood_type: Mapped[OptBloodType] = mapped_column(
|
|
263
|
-
name="blood_type", type_=Enum(BloodType, name="blood_type")
|
|
264
|
-
)
|
|
265
|
-
avatar_name: Mapped[str] = mapped_column(
|
|
266
|
-
name="avatar_name", type_=Text, nullable=False
|
|
267
|
-
)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
class UserSystemRole(
|
|
271
|
-
DataStatus,
|
|
272
|
-
DataTimestamp,
|
|
273
|
-
DataIdentifier,
|
|
274
|
-
):
|
|
275
|
-
__tablename__ = "user_system_roles"
|
|
276
|
-
user_id: Mapped[int] = mapped_column(
|
|
277
|
-
Integer,
|
|
278
|
-
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
279
|
-
nullable=False,
|
|
280
|
-
)
|
|
281
|
-
system_role: Mapped[SystemRole] = mapped_column(
|
|
282
|
-
name="system_role",
|
|
283
|
-
type_=Enum(SystemRole, name="system_role"),
|
|
284
|
-
default=SystemRole.USER,
|
|
285
|
-
nullable=False,
|
|
286
|
-
)
|
|
287
|
-
|
|
288
|
-
__table_args__ = (
|
|
289
|
-
UniqueConstraint("user_id", "system_role", name="uq_user_system_role"),
|
|
290
|
-
)
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
class User(
|
|
294
|
-
DataStatus,
|
|
295
|
-
DataTimestamp,
|
|
296
|
-
DataIdentifier,
|
|
297
|
-
):
|
|
298
|
-
__tablename__ = "users"
|
|
299
|
-
user_type: Mapped[UserType] = mapped_column(
|
|
300
|
-
name="user_type",
|
|
301
|
-
type_=Enum(UserType, name="user_type"),
|
|
302
|
-
default=UserType.REGULAR,
|
|
303
|
-
nullable=False,
|
|
304
|
-
)
|
|
305
|
-
username: Mapped[str] = mapped_column(
|
|
306
|
-
name="username", type_=String(50), unique=True, nullable=False
|
|
307
|
-
)
|
|
308
|
-
email: Mapped[str] = mapped_column(
|
|
309
|
-
name="email", type_=String(255), unique=True, nullable=False
|
|
310
|
-
)
|
|
311
|
-
phone: Mapped[str] = mapped_column(name="phone", type_=String(15), nullable=False)
|
|
312
|
-
password: Mapped[str] = mapped_column(
|
|
313
|
-
name="password", type_=String(255), nullable=False
|
|
314
|
-
)
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
class UserOrganization(
|
|
318
|
-
DataStatus,
|
|
319
|
-
DataTimestamp,
|
|
320
|
-
DataIdentifier,
|
|
321
|
-
):
|
|
322
|
-
__tablename__ = "user_organizations"
|
|
323
|
-
user_id: Mapped[int] = mapped_column(
|
|
324
|
-
Integer,
|
|
325
|
-
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
326
|
-
nullable=False,
|
|
327
|
-
)
|
|
328
|
-
|
|
329
|
-
organization_id: Mapped[int] = mapped_column(
|
|
330
|
-
Integer,
|
|
331
|
-
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
332
|
-
nullable=False,
|
|
333
|
-
)
|
|
334
|
-
|
|
335
|
-
__table_args__ = (
|
|
336
|
-
UniqueConstraint("user_id", "organization_id", name="uq_user_organization"),
|
|
337
|
-
)
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
maleo/identity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
maleo/identity/models.py,sha256=CkcLrrcT_WEvNdp_FvUfnJZ8wVMVwrE4zrbor_Cvc_0,10293
|
|
3
|
-
maleo/identity/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
maleo/identity/constants/api_key.py,sha256=e7CsTodUBgyoX30SJUnYx457WBZeRFyyeaOFGsZ-7mY,264
|
|
5
|
-
maleo/identity/constants/organization.py,sha256=Jeewz4VlaTmuHHDqNZUZyLD3bdndQjpx9K0EabhCFUM,259
|
|
6
|
-
maleo/identity/constants/organization_registration_code.py,sha256=L_j_NrLtsniN6kbDif7rQ7Yj9CdxUsgL3Yte9SE5Zes,356
|
|
7
|
-
maleo/identity/constants/organization_relation.py,sha256=XqfQlA96a8VrPPD7mjl8UZVYKK7B-1r5_dObC2Mc4fk,320
|
|
8
|
-
maleo/identity/constants/patient.py,sha256=-A0edrjgOOsHPjfcvvAIoojIrsywlczszpN6xux-DM0,203
|
|
9
|
-
maleo/identity/constants/user.py,sha256=vlF60H4-THtoOpwyAHMYqaLknXsQOANCLTngbyhNET4,191
|
|
10
|
-
maleo/identity/constants/user_medical_role.py,sha256=HVeXXb191qpAJJHtSgJ0NdFlLCxeEQBOKRr7JCQN8Pg,304
|
|
11
|
-
maleo/identity/constants/user_organization_role.py,sha256=-6z8e5-OJWmm_47_zbbp61JxiRGGytELqk0iZ5yX4Wk,324
|
|
12
|
-
maleo/identity/constants/user_profile.py,sha256=trDI4mNlcbA1_ignknMy07I6H-VqAytlfB8ejoQ7XH0,259
|
|
13
|
-
maleo/identity/constants/user_system_role.py,sha256=_p5FI2X7yBUJuA06ia_vIkDRyfY4WZweQD08G3wCuRw,300
|
|
14
|
-
maleo/identity/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
maleo/identity/enums/api_key.py,sha256=WST6RsRrvJGeSL5ugVeZNKXReGsh9GEPDxmRy-owiEk,276
|
|
16
|
-
maleo/identity/enums/organization.py,sha256=akxi_BJqRMokQ59K4KMZDkO-yLVC0Q_A7jErOiuixqs,406
|
|
17
|
-
maleo/identity/enums/organization_registration_code.py,sha256=ZkteIpOW6MOLEHBbmDUaRGalTlTWUIRlimz-FohBWiM,282
|
|
18
|
-
maleo/identity/enums/organization_relation.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
19
|
-
maleo/identity/enums/patient.py,sha256=rMyUPFApFV9Mf3H-hsvTf4KFbHVkR-GAIluGfdQMpHc,274
|
|
20
|
-
maleo/identity/enums/user.py,sha256=Y81ZPrZa8Of84AwFmPtrFygK_kXuWYxMZXUm2FFISK8,436
|
|
21
|
-
maleo/identity/enums/user_medical_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
22
|
-
maleo/identity/enums/user_organization_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
23
|
-
maleo/identity/enums/user_profile.py,sha256=LgX7Ct-MAfx7o0W8MICzpHMfDhi7wpiJfRszn6vr1zc,272
|
|
24
|
-
maleo/identity/enums/user_system_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
25
|
-
maleo/identity/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
maleo/identity/mixins/api_key.py,sha256=WbRhcO_wdQnn4ow62eg4kRoPYMyNFjXvi5pivRNdP14,2093
|
|
27
|
-
maleo/identity/mixins/common.py,sha256=diWtUiPMI_ypHtDrmI5y8IArxCdomo9Gt6X69iFhyuw,905
|
|
28
|
-
maleo/identity/mixins/organization.py,sha256=cJQWOWaRj5F3ITCrpLU7R8hOUM-OWZz_T7H0aV6nc2I,2440
|
|
29
|
-
maleo/identity/mixins/organization_registration_code.py,sha256=--XHacpOTCdOLou2I9wE3DiWD_H5MeIotGsg3KJCVaw,3418
|
|
30
|
-
maleo/identity/mixins/organization_relation.py,sha256=b76eiW6Qrw-Ce6qASaYOVTK4Ox7UAltvLl3sbPra9mY,2591
|
|
31
|
-
maleo/identity/mixins/patient.py,sha256=kLJKyc5KDgHvK9ljfiaZJJExnovbCWO70HdtHkdKYeQ,3120
|
|
32
|
-
maleo/identity/mixins/user.py,sha256=PrBEF9GDMewh4UUwWRKF5mVr9exEjBlczLAmbfY3gKY,3421
|
|
33
|
-
maleo/identity/mixins/user_medical_role.py,sha256=p1QHv_X9bce0zpDTzjuZP6LVNrKaE5vlFRmNDU7vRyk,2131
|
|
34
|
-
maleo/identity/mixins/user_organization_role.py,sha256=KOSGPLhcnNB7ejD-OhDsSgRAv7aiMOrhgW5-3RR8H90,2222
|
|
35
|
-
maleo/identity/mixins/user_profile.py,sha256=QbCIiuKeottVLMWg3MJQe6e7nl_RcF6K5yhtCjqf3OA,3697
|
|
36
|
-
maleo/identity/mixins/user_system_role.py,sha256=wxCX7HpT5xYuOqC-rPqnXqdEU5WEf_JLYg7l1zhQIwM,2114
|
|
37
|
-
maleo/identity/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
-
maleo/identity/schemas/api_key.py,sha256=3wFfQBiNQEFAF2ZStfczvFhCgM3zC4A2wfWyZshJhhA,4675
|
|
39
|
-
maleo/identity/schemas/common.py,sha256=YseA6bREI4YFdSHGXK3eS4CIibqm7ZmMBcxLKBiB64Y,8218
|
|
40
|
-
maleo/identity/schemas/organization.py,sha256=FCaQ0kEVxeGUW9AVRhrYX8_sWyfYoX1cHGK4GKN4tkg,8285
|
|
41
|
-
maleo/identity/schemas/organization_registration_code.py,sha256=5ClSTE5dGYGosiW90p4NKOG8dA3Z3Q8i3CfwS5jdJpQ,8498
|
|
42
|
-
maleo/identity/schemas/organization_relation.py,sha256=O2C6TH2hQRxk5RO0QQll7s28AcDrblx4cqLY2KW_1L0,8686
|
|
43
|
-
maleo/identity/schemas/patient.py,sha256=Wgbce_kcFt5WupsM17YhjzskZaPlZnPmXtm_asDX6fQ,8926
|
|
44
|
-
maleo/identity/schemas/user.py,sha256=GCoKDk1d5wNR50VrFxxMdvcqHqTMVR4cTHsf4mw-B10,8438
|
|
45
|
-
maleo/identity/schemas/user_medical_role.py,sha256=17w4Q6x8a1RCzeHfn9LML27BkW3ffF8aX93ZgTPiM0M,8497
|
|
46
|
-
maleo/identity/schemas/user_organization_role.py,sha256=OLMNUck6oVsulycmVBevYL2KUYAKYo6yCoAZrtbot3w,8649
|
|
47
|
-
maleo/identity/schemas/user_profile.py,sha256=CYZfxyddyBGz3LcpH192TSEd1baSc5i8Lon4r0JMW7c,8956
|
|
48
|
-
maleo/identity/schemas/user_system_role.py,sha256=yCPDBiMUECyv5T78OnuZt-_p_X0IvrndcnRuAWpgx5c,8371
|
|
49
|
-
maleo/identity/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
-
maleo/identity/types/api_key.py,sha256=pjWzyAh1p0DTS6v2ImYv849iF-T0PbEM8qlrwN3c-2o,190
|
|
51
|
-
maleo/identity/types/organization.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
52
|
-
maleo/identity/types/organization_registration_code.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
53
|
-
maleo/identity/types/organization_relation.py,sha256=EVqAXNkswHRo07Fh8eRX5CyPEF5PqX00vAIaavtNZv4,222
|
|
54
|
-
maleo/identity/types/patient.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
55
|
-
maleo/identity/types/user.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
56
|
-
maleo/identity/types/user_medical_role.py,sha256=rH8z-qz_T5eTykXUBe8jLUvdyEOC4wMTC4zWpX3Ca4g,199
|
|
57
|
-
maleo/identity/types/user_organization_role.py,sha256=FFgzo2IvblckLwKN-rnOXI9TRpV_lYv1NprmUIl_JBE,214
|
|
58
|
-
maleo/identity/types/user_profile.py,sha256=UqOBL4v138jumjQstCAZ-2ZV1Ax8-Cr4SvL36nx8brw,63
|
|
59
|
-
maleo/identity/types/user_system_role.py,sha256=6KIDk7kCWBlrloNLfIElflS5N8oBYqPeNRqySD2BQEE,191
|
|
60
|
-
maleo/identity/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
|
-
maleo/identity/utils/organization.py,sha256=aEegzeoNLUptrScUB5kWrYlJj7dzTZeVXymltE5lWpE,874
|
|
62
|
-
maleo/identity/utils/user.py,sha256=1pyfmAbXkAEOo6WM2KRA_kRnFi0O_A2ZUEqv01wY-cU,794
|
|
63
|
-
maleo_identity-0.1.11.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
64
|
-
maleo_identity-0.1.11.dist-info/METADATA,sha256=2pPJzaDeE1P48ctmC4qgS_gkzJjC44NG91b7rXarh6E,3546
|
|
65
|
-
maleo_identity-0.1.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
66
|
-
maleo_identity-0.1.11.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
67
|
-
maleo_identity-0.1.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|