maleo-identity 0.0.97__tar.gz → 0.0.99__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.
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/PKG-INFO +2 -1
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/maleo_identity.egg-info/PKG-INFO +2 -1
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/maleo_identity.egg-info/SOURCES.txt +32 -1
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/maleo_identity.egg-info/requires.txt +1 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/pyproject.toml +7 -3
- maleo_identity-0.0.99/src/constants/api_key.py +13 -0
- maleo_identity-0.0.99/src/constants/organization.py +11 -0
- maleo_identity-0.0.99/src/constants/organization_registration_code.py +13 -0
- maleo_identity-0.0.99/src/constants/organization_relation.py +13 -0
- maleo_identity-0.0.99/src/constants/patient.py +7 -0
- maleo_identity-0.0.99/src/constants/user.py +7 -0
- maleo_identity-0.0.99/src/constants/user_medical_role.py +13 -0
- maleo_identity-0.0.99/src/constants/user_organization_role.py +13 -0
- maleo_identity-0.0.99/src/constants/user_profile.py +11 -0
- maleo_identity-0.0.99/src/constants/user_system_role.py +13 -0
- maleo_identity-0.0.99/src/dtos.py +295 -0
- maleo_identity-0.0.99/src/enums/api_key.py +13 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/enums/organization.py +5 -6
- maleo_identity-0.0.97/src/enums/user_profile.py → maleo_identity-0.0.99/src/enums/organization_relation.py +1 -2
- maleo_identity-0.0.99/src/enums/patient.py +22 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/enums/user.py +10 -6
- maleo_identity-0.0.99/src/enums/user_medical_role.py +12 -0
- maleo_identity-0.0.99/src/enums/user_organization_role.py +12 -0
- maleo_identity-0.0.99/src/enums/user_profile.py +22 -0
- maleo_identity-0.0.99/src/enums/user_system_role.py +12 -0
- maleo_identity-0.0.99/src/mixins/api_key.py +6 -0
- maleo_identity-0.0.99/src/mixins/common.py +29 -0
- maleo_identity-0.0.99/src/mixins/organization_relation.py +14 -0
- maleo_identity-0.0.99/src/mixins/patient.py +8 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/mixins/user_profile.py +4 -21
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/models.py +89 -95
- maleo_identity-0.0.99/src/schemas/api_key.py +128 -0
- maleo_identity-0.0.99/src/schemas/common.py +323 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/schemas/organization.py +39 -6
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/schemas/organization_registration_code.py +14 -5
- maleo_identity-0.0.99/src/schemas/organization_relation.py +178 -0
- maleo_identity-0.0.99/src/schemas/patient.py +234 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/schemas/user.py +19 -4
- maleo_identity-0.0.99/src/schemas/user_medical_role.py +181 -0
- maleo_identity-0.0.99/src/schemas/user_organization_role.py +181 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/schemas/user_profile.py +68 -10
- maleo_identity-0.0.99/src/schemas/user_system_role.py +174 -0
- maleo_identity-0.0.99/src/types/api_key.py +7 -0
- maleo_identity-0.0.99/src/types/organization.py +4 -0
- maleo_identity-0.0.99/src/types/organization_registration_code.py +4 -0
- maleo_identity-0.0.99/src/types/organization_relation.py +7 -0
- maleo_identity-0.0.99/src/types/patient.py +4 -0
- maleo_identity-0.0.99/src/types/user.py +4 -0
- maleo_identity-0.0.99/src/types/user_medical_role.py +7 -0
- maleo_identity-0.0.99/src/types/user_organization_role.py +7 -0
- maleo_identity-0.0.99/src/types/user_profile.py +4 -0
- maleo_identity-0.0.99/src/types/user_system_role.py +7 -0
- maleo_identity-0.0.99/src/utils/organization.py +62 -0
- maleo_identity-0.0.99/src/utils/user.py +62 -0
- maleo_identity-0.0.99/src/validators/__init__.py +0 -0
- maleo_identity-0.0.99/src/validators/patient.py +6 -0
- maleo_identity-0.0.97/src/constants/organization.py +0 -25
- maleo_identity-0.0.97/src/constants/organization_registration_code.py +0 -28
- maleo_identity-0.0.97/src/constants/user.py +0 -22
- maleo_identity-0.0.97/src/constants/user_profile.py +0 -26
- maleo_identity-0.0.97/src/schemas/common.py +0 -291
- maleo_identity-0.0.97/src/types/organization.py +0 -5
- maleo_identity-0.0.97/src/types/organization_registration_code.py +0 -5
- maleo_identity-0.0.97/src/types/user.py +0 -5
- maleo_identity-0.0.97/src/types/user_profile.py +0 -5
- maleo_identity-0.0.97/src/utils/organization.py +0 -56
- maleo_identity-0.0.97/src/utils/user.py +0 -56
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/LICENSE +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/README.md +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/maleo_identity.egg-info/dependency_links.txt +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/maleo_identity.egg-info/top_level.txt +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/setup.cfg +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/__init__.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/constants/__init__.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/enums/__init__.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/enums/organization_registration_code.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/mixins/__init__.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/mixins/organization.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/mixins/organization_registration_code.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/mixins/user.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/schemas/__init__.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/types/__init__.py +0 -0
- {maleo_identity-0.0.97 → maleo_identity-0.0.99}/src/utils/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.99
|
|
4
4
|
Summary: MaleoIdentity service package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: Proprietary
|
|
@@ -44,6 +44,7 @@ Requires-Dist: iniconfig>=2.1.0
|
|
|
44
44
|
Requires-Dist: maleo-crypto>=0.0.40
|
|
45
45
|
Requires-Dist: maleo-enums>=0.0.40
|
|
46
46
|
Requires-Dist: maleo-logging>=0.0.40
|
|
47
|
+
Requires-Dist: maleo-metadata>=0.0.54
|
|
47
48
|
Requires-Dist: maleo-schemas>=0.1.50
|
|
48
49
|
Requires-Dist: maleo-types>=0.0.20
|
|
49
50
|
Requires-Dist: maleo-utils>=0.0.40
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.99
|
|
4
4
|
Summary: MaleoIdentity service package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: Proprietary
|
|
@@ -44,6 +44,7 @@ Requires-Dist: iniconfig>=2.1.0
|
|
|
44
44
|
Requires-Dist: maleo-crypto>=0.0.40
|
|
45
45
|
Requires-Dist: maleo-enums>=0.0.40
|
|
46
46
|
Requires-Dist: maleo-logging>=0.0.40
|
|
47
|
+
Requires-Dist: maleo-metadata>=0.0.54
|
|
47
48
|
Requires-Dist: maleo-schemas>=0.1.50
|
|
48
49
|
Requires-Dist: maleo-types>=0.0.20
|
|
49
50
|
Requires-Dist: maleo-utils>=0.0.40
|
|
@@ -7,33 +7,64 @@ 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
|
|
10
11
|
src/models.py
|
|
11
12
|
src/constants/__init__.py
|
|
13
|
+
src/constants/api_key.py
|
|
12
14
|
src/constants/organization.py
|
|
13
15
|
src/constants/organization_registration_code.py
|
|
16
|
+
src/constants/organization_relation.py
|
|
17
|
+
src/constants/patient.py
|
|
14
18
|
src/constants/user.py
|
|
19
|
+
src/constants/user_medical_role.py
|
|
20
|
+
src/constants/user_organization_role.py
|
|
15
21
|
src/constants/user_profile.py
|
|
22
|
+
src/constants/user_system_role.py
|
|
16
23
|
src/enums/__init__.py
|
|
24
|
+
src/enums/api_key.py
|
|
17
25
|
src/enums/organization.py
|
|
18
26
|
src/enums/organization_registration_code.py
|
|
27
|
+
src/enums/organization_relation.py
|
|
28
|
+
src/enums/patient.py
|
|
19
29
|
src/enums/user.py
|
|
30
|
+
src/enums/user_medical_role.py
|
|
31
|
+
src/enums/user_organization_role.py
|
|
20
32
|
src/enums/user_profile.py
|
|
33
|
+
src/enums/user_system_role.py
|
|
21
34
|
src/mixins/__init__.py
|
|
35
|
+
src/mixins/api_key.py
|
|
36
|
+
src/mixins/common.py
|
|
22
37
|
src/mixins/organization.py
|
|
23
38
|
src/mixins/organization_registration_code.py
|
|
39
|
+
src/mixins/organization_relation.py
|
|
40
|
+
src/mixins/patient.py
|
|
24
41
|
src/mixins/user.py
|
|
25
42
|
src/mixins/user_profile.py
|
|
26
43
|
src/schemas/__init__.py
|
|
44
|
+
src/schemas/api_key.py
|
|
27
45
|
src/schemas/common.py
|
|
28
46
|
src/schemas/organization.py
|
|
29
47
|
src/schemas/organization_registration_code.py
|
|
48
|
+
src/schemas/organization_relation.py
|
|
49
|
+
src/schemas/patient.py
|
|
30
50
|
src/schemas/user.py
|
|
51
|
+
src/schemas/user_medical_role.py
|
|
52
|
+
src/schemas/user_organization_role.py
|
|
31
53
|
src/schemas/user_profile.py
|
|
54
|
+
src/schemas/user_system_role.py
|
|
32
55
|
src/types/__init__.py
|
|
56
|
+
src/types/api_key.py
|
|
33
57
|
src/types/organization.py
|
|
34
58
|
src/types/organization_registration_code.py
|
|
59
|
+
src/types/organization_relation.py
|
|
60
|
+
src/types/patient.py
|
|
35
61
|
src/types/user.py
|
|
62
|
+
src/types/user_medical_role.py
|
|
63
|
+
src/types/user_organization_role.py
|
|
36
64
|
src/types/user_profile.py
|
|
65
|
+
src/types/user_system_role.py
|
|
37
66
|
src/utils/__init__.py
|
|
38
67
|
src/utils/organization.py
|
|
39
|
-
src/utils/user.py
|
|
68
|
+
src/utils/user.py
|
|
69
|
+
src/validators/__init__.py
|
|
70
|
+
src/validators/patient.py
|
|
@@ -3,8 +3,8 @@ requires = ["setuptools", "wheel"]
|
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
|
-
name = "maleo-identity"
|
|
7
|
-
version = "0.0.
|
|
6
|
+
name = "maleo-identity"
|
|
7
|
+
version = "0.0.99"
|
|
8
8
|
description = "MaleoIdentity service package"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
|
|
@@ -50,6 +50,7 @@ dependencies = [
|
|
|
50
50
|
"maleo-crypto>=0.0.40",
|
|
51
51
|
"maleo-enums>=0.0.40",
|
|
52
52
|
"maleo-logging>=0.0.40",
|
|
53
|
+
"maleo-metadata>=0.0.54",
|
|
53
54
|
"maleo-schemas>=0.1.50",
|
|
54
55
|
"maleo-types>=0.0.20",
|
|
55
56
|
"maleo-utils>=0.0.40",
|
|
@@ -102,6 +103,7 @@ packages = [
|
|
|
102
103
|
"maleo.identity.schemas",
|
|
103
104
|
"maleo.identity.types",
|
|
104
105
|
"maleo.identity.utils",
|
|
106
|
+
"maleo.identity.validators",
|
|
105
107
|
]
|
|
106
108
|
|
|
107
109
|
[tool.setuptools.package-data]
|
|
@@ -112,6 +114,7 @@ packages = [
|
|
|
112
114
|
"maleo.identity.schemas" = ["*.json", "*.yaml"]
|
|
113
115
|
"maleo.identity.types" = ["*.json", "*.yaml"]
|
|
114
116
|
"maleo.identity.utils" = ["*.json", "*.yaml"]
|
|
117
|
+
"maleo.identity.validators" = ["*.json", "*.yaml"]
|
|
115
118
|
|
|
116
119
|
[tool.setuptools.package-dir]
|
|
117
120
|
"maleo.identity" = "src"
|
|
@@ -120,4 +123,5 @@ packages = [
|
|
|
120
123
|
"maleo.identity.mixins" = "src/mixins"
|
|
121
124
|
"maleo.identity.schemas" = "src/schemas"
|
|
122
125
|
"maleo.identity.types" = "src/types"
|
|
123
|
-
"maleo.identity.utils" = "src/utils"
|
|
126
|
+
"maleo.identity.utils" = "src/utils"
|
|
127
|
+
"maleo.identity.validators" = "src/validators"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
ORGANIZATION_REGISTRATION_CODE_RESOURCE = Resource(
|
|
5
|
+
identifiers=[
|
|
6
|
+
ResourceIdentifier(
|
|
7
|
+
key="organization_registration_codes",
|
|
8
|
+
name="Organization Registration Codes",
|
|
9
|
+
slug="organization-registration-codes",
|
|
10
|
+
)
|
|
11
|
+
],
|
|
12
|
+
details=None,
|
|
13
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
ORGANIZATION_RELATION_RESOURCE = Resource(
|
|
5
|
+
identifiers=[
|
|
6
|
+
ResourceIdentifier(
|
|
7
|
+
key="organization_relations",
|
|
8
|
+
name="Organization Relations",
|
|
9
|
+
slug="organization-relations",
|
|
10
|
+
)
|
|
11
|
+
],
|
|
12
|
+
details=None,
|
|
13
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
USER_MEDICAL_ROLE_RESOURCE = Resource(
|
|
5
|
+
identifiers=[
|
|
6
|
+
ResourceIdentifier(
|
|
7
|
+
key="user_medical_roles",
|
|
8
|
+
name="User Medical Roles",
|
|
9
|
+
slug="user-medical-roles",
|
|
10
|
+
)
|
|
11
|
+
],
|
|
12
|
+
details=None,
|
|
13
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
USER_ORGANIZATION_ROLE_RESOURCE = Resource(
|
|
5
|
+
identifiers=[
|
|
6
|
+
ResourceIdentifier(
|
|
7
|
+
key="user_organization_roles",
|
|
8
|
+
name="User Organization Roles",
|
|
9
|
+
slug="user-organization-roles",
|
|
10
|
+
)
|
|
11
|
+
],
|
|
12
|
+
details=None,
|
|
13
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
USER_SYSTEM_ROLE_RESOURCE = Resource(
|
|
5
|
+
identifiers=[
|
|
6
|
+
ResourceIdentifier(
|
|
7
|
+
key="user_system_roles",
|
|
8
|
+
name="User System Roles",
|
|
9
|
+
slug="user-system-roles",
|
|
10
|
+
)
|
|
11
|
+
],
|
|
12
|
+
details=None,
|
|
13
|
+
)
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
from datetime import date
|
|
2
|
+
from pydantic import BaseModel, Field, model_validator
|
|
3
|
+
from typing import Annotated, Generic, Self, TypeVar, Type
|
|
4
|
+
from maleo.enums.identity import (
|
|
5
|
+
OptBloodType,
|
|
6
|
+
BloodTypeMixin,
|
|
7
|
+
OptRhesus,
|
|
8
|
+
RhesusMixin,
|
|
9
|
+
Gender,
|
|
10
|
+
OptGender,
|
|
11
|
+
GenderMixin,
|
|
12
|
+
)
|
|
13
|
+
from maleo.enums.medical import MedicalRole, FullMedicalRoleMixin
|
|
14
|
+
from maleo.enums.organization import (
|
|
15
|
+
OrganizationRole,
|
|
16
|
+
FullOrganizationRoleMixin,
|
|
17
|
+
OrganizationType,
|
|
18
|
+
FullOrganizationTypeMixin,
|
|
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
|
|
23
|
+
from maleo.schemas.mixins.identity import (
|
|
24
|
+
DataIdentifier,
|
|
25
|
+
IntOrganizationId,
|
|
26
|
+
IntUserId,
|
|
27
|
+
BirthDate,
|
|
28
|
+
DateOfBirth,
|
|
29
|
+
IntSourceId,
|
|
30
|
+
IntTargetId,
|
|
31
|
+
)
|
|
32
|
+
from maleo.schemas.mixins.timestamp import DataTimestamp
|
|
33
|
+
from maleo.types.datetime import OptDate
|
|
34
|
+
from maleo.types.string import OptStr
|
|
35
|
+
from .mixins.common import IdCard, FullName, BirthPlace, PlaceOfBirth
|
|
36
|
+
from .mixins.organization_registration_code import Code, MaxUses, CurrentUses
|
|
37
|
+
from .mixins.organization_relation import IsBidirectional, Metadata
|
|
38
|
+
from .mixins.organization import Key as OrganizationKey, Name as OrganizationName
|
|
39
|
+
from .mixins.patient import Passport
|
|
40
|
+
from .mixins.user_profile import (
|
|
41
|
+
LeadingTitle,
|
|
42
|
+
FirstName,
|
|
43
|
+
MiddleName,
|
|
44
|
+
LastName,
|
|
45
|
+
EndingTitle,
|
|
46
|
+
AvatarName,
|
|
47
|
+
)
|
|
48
|
+
from .mixins.user import Username, Email, Phone
|
|
49
|
+
from .validators.patient import validate_id_card_or_passport
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class PatientDTO(
|
|
53
|
+
RhesusMixin[OptRhesus],
|
|
54
|
+
BloodTypeMixin[OptBloodType],
|
|
55
|
+
GenderMixin[Gender],
|
|
56
|
+
DateOfBirth[date],
|
|
57
|
+
PlaceOfBirth[OptStr],
|
|
58
|
+
FullName[str],
|
|
59
|
+
Passport[OptStr],
|
|
60
|
+
IdCard[OptStr],
|
|
61
|
+
IntOrganizationId[int],
|
|
62
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
63
|
+
DataTimestamp,
|
|
64
|
+
DataIdentifier,
|
|
65
|
+
):
|
|
66
|
+
@model_validator(mode="after")
|
|
67
|
+
def chk_id_card_or_passport(self) -> Self:
|
|
68
|
+
validate_id_card_or_passport(self.id_card, self.passport)
|
|
69
|
+
return self
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class OrganizationRegistrationCodeDTO(
|
|
73
|
+
CurrentUses,
|
|
74
|
+
MaxUses[int],
|
|
75
|
+
Code[str],
|
|
76
|
+
IntOrganizationId[int],
|
|
77
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
78
|
+
DataTimestamp,
|
|
79
|
+
DataIdentifier,
|
|
80
|
+
):
|
|
81
|
+
pass
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
OptOrganizationRegistrationCodeDTO = OrganizationRegistrationCodeDTO | None
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class OrganizationRegistrationCodeDTOMixin(BaseModel):
|
|
88
|
+
registration_code: Annotated[
|
|
89
|
+
OptOrganizationRegistrationCodeDTO,
|
|
90
|
+
Field(None, description="Organization's registration code"),
|
|
91
|
+
] = None
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class StandardOrganizationDTO(
|
|
95
|
+
OrganizationName[str],
|
|
96
|
+
OrganizationKey[str],
|
|
97
|
+
FullOrganizationTypeMixin[OrganizationType],
|
|
98
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
99
|
+
DataTimestamp,
|
|
100
|
+
DataIdentifier,
|
|
101
|
+
):
|
|
102
|
+
pass
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class SourceOrganizationDTOMixin(BaseModel):
|
|
106
|
+
source: Annotated[
|
|
107
|
+
StandardOrganizationDTO, Field(..., description="Source organization")
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class TargetOrganizationDTOMixin(BaseModel):
|
|
112
|
+
target: Annotated[
|
|
113
|
+
StandardOrganizationDTO, Field(..., description="Target organization")
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class OrganizationRelationDTO(
|
|
118
|
+
Metadata,
|
|
119
|
+
IsBidirectional[bool],
|
|
120
|
+
TargetOrganizationDTOMixin,
|
|
121
|
+
IntTargetId[int],
|
|
122
|
+
SourceOrganizationDTOMixin,
|
|
123
|
+
IntSourceId[int],
|
|
124
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
125
|
+
DataTimestamp,
|
|
126
|
+
DataIdentifier,
|
|
127
|
+
):
|
|
128
|
+
pass
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class OrganizationRelationsDTOMixin(BaseModel):
|
|
132
|
+
relations: Annotated[
|
|
133
|
+
list[OrganizationRelationDTO],
|
|
134
|
+
Field(list[OrganizationRelationDTO](), description="Relations"),
|
|
135
|
+
] = list[OrganizationRelationDTO]()
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class FullOrganizationDTO(
|
|
139
|
+
OrganizationRelationsDTOMixin,
|
|
140
|
+
OrganizationRegistrationCodeDTOMixin,
|
|
141
|
+
StandardOrganizationDTO,
|
|
142
|
+
):
|
|
143
|
+
pass
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
AnyOrganizationDTOType = Type[StandardOrganizationDTO] | Type[FullOrganizationDTO]
|
|
147
|
+
AnyOrganizationDTO = StandardOrganizationDTO | FullOrganizationDTO
|
|
148
|
+
AnyOrganizationDTOT = TypeVar("AnyOrganizationDTOT", bound=AnyOrganizationDTO)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class OrganizationDTOMixin(BaseModel, Generic[AnyOrganizationDTOT]):
|
|
152
|
+
organization: Annotated[AnyOrganizationDTOT, Field(..., description="Organization")]
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class UserMedicalRoleDTO(
|
|
156
|
+
FullMedicalRoleMixin[MedicalRole],
|
|
157
|
+
IntOrganizationId[int],
|
|
158
|
+
IntUserId[int],
|
|
159
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
160
|
+
DataTimestamp,
|
|
161
|
+
DataIdentifier,
|
|
162
|
+
):
|
|
163
|
+
pass
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class UserMedicalRolesDTOMixin(BaseModel):
|
|
167
|
+
medical_roles: Annotated[
|
|
168
|
+
list[UserMedicalRoleDTO],
|
|
169
|
+
Field(list[UserMedicalRoleDTO](), description="Medical roles"),
|
|
170
|
+
] = list[UserMedicalRoleDTO]()
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class UserOrganizationRoleDTO(
|
|
174
|
+
FullOrganizationRoleMixin[OrganizationRole],
|
|
175
|
+
IntOrganizationId[int],
|
|
176
|
+
IntUserId[int],
|
|
177
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
178
|
+
DataTimestamp,
|
|
179
|
+
DataIdentifier,
|
|
180
|
+
):
|
|
181
|
+
pass
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class UserOrganizationRolesDTOMixin(BaseModel):
|
|
185
|
+
organization_roles: Annotated[
|
|
186
|
+
list[UserOrganizationRoleDTO],
|
|
187
|
+
Field(list[UserOrganizationRoleDTO](), description="Organization roles"),
|
|
188
|
+
] = list[UserOrganizationRoleDTO]()
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class UserProfileDTO(
|
|
192
|
+
AvatarName[str],
|
|
193
|
+
BloodTypeMixin[OptBloodType],
|
|
194
|
+
GenderMixin[OptGender],
|
|
195
|
+
BirthDate[OptDate],
|
|
196
|
+
BirthPlace[OptStr],
|
|
197
|
+
FullName[str],
|
|
198
|
+
EndingTitle[OptStr],
|
|
199
|
+
LastName[str],
|
|
200
|
+
MiddleName[OptStr],
|
|
201
|
+
FirstName[str],
|
|
202
|
+
LeadingTitle[OptStr],
|
|
203
|
+
IdCard[OptStr],
|
|
204
|
+
IntUserId[int],
|
|
205
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
206
|
+
DataTimestamp,
|
|
207
|
+
DataIdentifier,
|
|
208
|
+
):
|
|
209
|
+
pass
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
OptUserProfileDTO = UserProfileDTO | None
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class UserProfileDTOMixin(BaseModel):
|
|
216
|
+
profile: Annotated[OptUserProfileDTO, Field(None, description="User's Profile")] = (
|
|
217
|
+
None
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class UserSystemRoleDTO(
|
|
222
|
+
FullSystemRoleMixin[SystemRole],
|
|
223
|
+
IntUserId[int],
|
|
224
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
225
|
+
DataTimestamp,
|
|
226
|
+
DataIdentifier,
|
|
227
|
+
):
|
|
228
|
+
pass
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
class UserSystemRolesDTOMixin(BaseModel):
|
|
232
|
+
system_roles: Annotated[
|
|
233
|
+
list[UserSystemRoleDTO],
|
|
234
|
+
Field(
|
|
235
|
+
list[UserSystemRoleDTO](),
|
|
236
|
+
description="User's system roles",
|
|
237
|
+
min_length=1,
|
|
238
|
+
),
|
|
239
|
+
] = list[UserSystemRoleDTO]()
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class StandardUserDTO(
|
|
243
|
+
UserProfileDTOMixin,
|
|
244
|
+
Phone[str],
|
|
245
|
+
Email[str],
|
|
246
|
+
Username[str],
|
|
247
|
+
FullUserTypeMixin[UserType],
|
|
248
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
249
|
+
DataTimestamp,
|
|
250
|
+
DataIdentifier,
|
|
251
|
+
):
|
|
252
|
+
pass
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class UserOrganizationDTO(
|
|
256
|
+
UserMedicalRolesDTOMixin,
|
|
257
|
+
UserOrganizationRolesDTOMixin,
|
|
258
|
+
OrganizationDTOMixin[StandardOrganizationDTO],
|
|
259
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
260
|
+
DataTimestamp,
|
|
261
|
+
DataIdentifier,
|
|
262
|
+
):
|
|
263
|
+
pass
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
class UserOrganizationsDTOMixin(BaseModel):
|
|
267
|
+
organizations: Annotated[
|
|
268
|
+
list[UserOrganizationDTO],
|
|
269
|
+
Field(list[UserOrganizationDTO](), description="Organizations"),
|
|
270
|
+
] = list[UserOrganizationDTO]()
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
class FullUserDTO(UserOrganizationsDTOMixin, StandardUserDTO):
|
|
274
|
+
pass
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
AnyUserDTOType = Type[StandardUserDTO] | Type[FullUserDTO]
|
|
278
|
+
AnyUserDTO = StandardUserDTO | FullUserDTO
|
|
279
|
+
AnyUserDTOT = TypeVar("AnyUserDTOT", bound=AnyUserDTO)
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
class UserDTOMixin(BaseModel, Generic[AnyUserDTOT]):
|
|
283
|
+
user: Annotated[AnyUserDTOT, Field(..., description="User")]
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
class UserAndOrganizationDTO(
|
|
287
|
+
UserMedicalRolesDTOMixin,
|
|
288
|
+
UserOrganizationRolesDTOMixin,
|
|
289
|
+
OrganizationDTOMixin[StandardOrganizationDTO],
|
|
290
|
+
UserDTOMixin[StandardUserDTO],
|
|
291
|
+
SimpleDataStatusMixin[DataStatusEnum],
|
|
292
|
+
DataTimestamp,
|
|
293
|
+
DataIdentifier,
|
|
294
|
+
):
|
|
295
|
+
pass
|
|
@@ -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
|
+
API_KEY = "api_key"
|
|
9
|
+
COMPOSITE = "composite"
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
13
|
+
return [e.value for e in cls]
|
|
@@ -21,10 +21,9 @@ class IdentifierType(StrEnum):
|
|
|
21
21
|
return [e.value for e in cls]
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class
|
|
25
|
-
|
|
26
|
-
COMPLETE = "complete"
|
|
24
|
+
class ExpandableField(StrEnum):
|
|
25
|
+
ORGANIZATION_TYPE = "organization_type"
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
|
|
28
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
29
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
|
|
15
|
+
|
|
16
|
+
class ExpandableField(StrEnum):
|
|
17
|
+
GENDER = "gender"
|
|
18
|
+
BLOOD_TYPE = "blood_type"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
22
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -22,10 +22,14 @@ class IdentifierType(StrEnum):
|
|
|
22
22
|
return [e.value for e in cls]
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
class
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
class ExpandableField(StrEnum):
|
|
26
|
+
USER_TYPE = "user_type"
|
|
27
|
+
GENDER = "gender"
|
|
28
|
+
BLOOD_TYPE = "blood_type"
|
|
29
|
+
SYSTEM_ROLE = "system_role"
|
|
30
|
+
MEDICAL_ROLE = "medical_role"
|
|
31
|
+
ORGANIZATION_ROLE = "organization_role"
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
|
|
34
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
35
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|