maleo-identity 0.0.76__py3-none-any.whl → 0.0.78__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/__init__.py +0 -0
- maleo/identity/client/__init__.py +0 -0
- maleo/identity/client/manager.py +157 -0
- maleo/identity/client/services/__init__.py +0 -0
- maleo/identity/client/services/organization.py +1944 -0
- maleo/identity/client/services/organization_registration_code.py +470 -0
- maleo/identity/client/services/organization_role.py +276 -0
- maleo/identity/client/services/user.py +1559 -0
- maleo/identity/client/services/user_organization.py +276 -0
- maleo/identity/client/services/user_organization_role.py +278 -0
- maleo/identity/client/services/user_profile.py +276 -0
- maleo/identity/client/services/user_system_role.py +276 -0
- maleo/identity/constants/__init__.py +0 -0
- maleo/identity/constants/organization.py +18 -0
- maleo/identity/constants/organization_registration_code.py +25 -0
- maleo/identity/constants/organization_role.py +35 -0
- maleo/identity/constants/user.py +24 -0
- maleo/identity/constants/user_organization.py +58 -0
- maleo/identity/constants/user_organization_role.py +47 -0
- maleo/identity/constants/user_profile.py +26 -0
- maleo/identity/constants/user_system_role.py +16 -0
- maleo/identity/db.py +4 -0
- maleo/identity/dtos/__init__.py +0 -0
- maleo/identity/dtos/organization_registration_code.py +12 -0
- maleo/identity/enums/__init__.py +0 -0
- maleo/identity/enums/general.py +5 -0
- maleo/identity/enums/organization.py +12 -0
- maleo/identity/enums/organization_registration_code.py +8 -0
- maleo/identity/enums/organization_role.py +7 -0
- maleo/identity/enums/user.py +17 -0
- maleo/identity/enums/user_organization.py +14 -0
- maleo/identity/enums/user_organization_role.py +15 -0
- maleo/identity/enums/user_profile.py +17 -0
- maleo/identity/enums/user_system_role.py +5 -0
- maleo/identity/mixins/__init__.py +0 -0
- maleo/identity/mixins/organization.py +15 -0
- maleo/identity/mixins/organization_registration_code.py +14 -0
- maleo/identity/mixins/organization_role.py +15 -0
- maleo/identity/mixins/user.py +47 -0
- maleo/identity/mixins/user_organization.py +6 -0
- maleo/identity/mixins/user_organization_role.py +6 -0
- maleo/identity/mixins/user_profile.py +81 -0
- maleo/identity/mixins/user_system_role.py +6 -0
- maleo/identity/models/__init__.py +0 -0
- maleo/identity/models/organization.py +62 -0
- maleo/identity/models/organization_registration_code.py +33 -0
- maleo/identity/models/organization_role.py +37 -0
- maleo/identity/models/user.py +39 -0
- maleo/identity/models/user_organization.py +48 -0
- maleo/identity/models/user_organization_role.py +61 -0
- maleo/identity/models/user_profile.py +33 -0
- maleo/identity/models/user_system_role.py +26 -0
- maleo/identity/schemas/__init__.py +0 -0
- maleo/identity/schemas/data/__init__.py +0 -0
- maleo/identity/schemas/data/organization.py +36 -0
- maleo/identity/schemas/data/organization_registration_code.py +33 -0
- maleo/identity/schemas/data/organization_role.py +32 -0
- maleo/identity/schemas/data/user.py +33 -0
- maleo/identity/schemas/data/user_organization.py +23 -0
- maleo/identity/schemas/data/user_organization_role.py +13 -0
- maleo/identity/schemas/data/user_profile.py +59 -0
- maleo/identity/schemas/data/user_system_role.py +25 -0
- maleo/identity/schemas/metadata/__init__.py +0 -0
- maleo/identity/schemas/metadata/user.py +6 -0
- maleo/identity/schemas/parameter/__init__.py +0 -0
- maleo/identity/schemas/parameter/client/__init__.py +0 -0
- maleo/identity/schemas/parameter/client/organization.py +74 -0
- maleo/identity/schemas/parameter/client/organization_registration_code.py +24 -0
- maleo/identity/schemas/parameter/client/organization_role.py +42 -0
- maleo/identity/schemas/parameter/client/user.py +44 -0
- maleo/identity/schemas/parameter/client/user_organization.py +62 -0
- maleo/identity/schemas/parameter/client/user_organization_role.py +49 -0
- maleo/identity/schemas/parameter/client/user_profile.py +28 -0
- maleo/identity/schemas/parameter/client/user_system_role.py +43 -0
- maleo/identity/schemas/parameter/general/__init__.py +0 -0
- maleo/identity/schemas/parameter/general/organization.py +43 -0
- maleo/identity/schemas/parameter/general/organization_registration_code.py +30 -0
- maleo/identity/schemas/parameter/general/organization_role.py +14 -0
- maleo/identity/schemas/parameter/general/user.py +101 -0
- maleo/identity/schemas/parameter/general/user_organization.py +18 -0
- maleo/identity/schemas/parameter/general/user_organization_role.py +15 -0
- maleo/identity/schemas/parameter/general/user_profile.py +82 -0
- maleo/identity/schemas/parameter/general/user_system_role.py +30 -0
- maleo/identity/schemas/parameter/service/__init__.py +0 -0
- maleo/identity/schemas/parameter/service/organization.py +60 -0
- maleo/identity/schemas/parameter/service/organization_registration_code.py +24 -0
- maleo/identity/schemas/parameter/service/organization_role.py +35 -0
- maleo/identity/schemas/parameter/service/user.py +47 -0
- maleo/identity/schemas/parameter/service/user_organization_role.py +36 -0
- maleo/identity/schemas/parameter/service/user_profile.py +28 -0
- maleo/identity/schemas/parameter/service/user_system_role.py +31 -0
- maleo/identity/types/__init__.py +5 -0
- maleo/identity/types/base/__init__.py +0 -0
- maleo/identity/types/base/organization.py +5 -0
- maleo/identity/types/base/organization_registration_code.py +4 -0
- maleo/identity/types/base/user.py +5 -0
- maleo/identity/types/base/user_profile.py +4 -0
- {maleo_identity-0.0.76.dist-info → maleo_identity-0.0.78.dist-info}/METADATA +3 -3
- maleo_identity-0.0.78.dist-info/RECORD +101 -0
- maleo_identity-0.0.78.dist-info/top_level.txt +1 -0
- maleo_identity-0.0.76.dist-info/RECORD +0 -4
- maleo_identity-0.0.76.dist-info/top_level.txt +0 -1
- {maleo_identity-0.0.76.dist-info → maleo_identity-0.0.78.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from sqlalchemy import Column, ForeignKey
|
|
2
|
+
from sqlalchemy.orm import relationship
|
|
3
|
+
from sqlalchemy.types import Integer
|
|
4
|
+
from maleo.identity.db import MaleoIdentityBase
|
|
5
|
+
from maleo.soma.models.table import DataTable
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UserOrganizationsMixin:
|
|
9
|
+
# Foreign Key UsersTable
|
|
10
|
+
user_id = Column(
|
|
11
|
+
Integer,
|
|
12
|
+
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
13
|
+
nullable=False,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
# Foreign Key OrganizationsTable
|
|
17
|
+
organization_id = Column(
|
|
18
|
+
Integer,
|
|
19
|
+
ForeignKey("organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
20
|
+
nullable=False,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class UserOrganizationsTable(UserOrganizationsMixin, DataTable, MaleoIdentityBase):
|
|
25
|
+
__tablename__ = "user_organizations"
|
|
26
|
+
|
|
27
|
+
user = relationship(
|
|
28
|
+
"UsersTable",
|
|
29
|
+
back_populates="user_organization",
|
|
30
|
+
cascade="all",
|
|
31
|
+
lazy="select",
|
|
32
|
+
uselist=False,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
organization = relationship(
|
|
36
|
+
"OrganizationsTable",
|
|
37
|
+
back_populates="user_organization",
|
|
38
|
+
cascade="all",
|
|
39
|
+
lazy="select",
|
|
40
|
+
uselist=False,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
user_organization_roles = relationship(
|
|
44
|
+
"UserOrganizationRolesTable",
|
|
45
|
+
back_populates="user_organization",
|
|
46
|
+
cascade="all, delete-orphan",
|
|
47
|
+
lazy="select",
|
|
48
|
+
)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from sqlalchemy import Column, ForeignKey
|
|
2
|
+
from sqlalchemy.orm import relationship
|
|
3
|
+
from sqlalchemy.types import Integer
|
|
4
|
+
from maleo.soma.models.table import DataTable
|
|
5
|
+
from maleo.identity.db import MaleoIdentityBase
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UserOrganizationRolesMixin:
|
|
9
|
+
# Foreign Key UserOrganizationsTable
|
|
10
|
+
user_organization_id = Column(
|
|
11
|
+
Integer,
|
|
12
|
+
ForeignKey("user_organizations.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
13
|
+
nullable=False,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
# Foreign Key OrganizationRolesTable
|
|
17
|
+
organization_role_id = Column(
|
|
18
|
+
Integer,
|
|
19
|
+
ForeignKey("organization_roles.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
20
|
+
nullable=False,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class UserOrganizationRolesTable(
|
|
25
|
+
UserOrganizationRolesMixin, DataTable, MaleoIdentityBase
|
|
26
|
+
):
|
|
27
|
+
__tablename__ = "user_organization_roles"
|
|
28
|
+
|
|
29
|
+
user_organization = relationship(
|
|
30
|
+
"UserOrganizationsTable",
|
|
31
|
+
back_populates="user_organization_roles",
|
|
32
|
+
cascade="all",
|
|
33
|
+
lazy="select",
|
|
34
|
+
uselist=False,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
user = relationship(
|
|
38
|
+
"UsersTable",
|
|
39
|
+
secondary="user_organizations",
|
|
40
|
+
primaryjoin="UserOrganizationRolesTable.user_organization_id == UserOrganizationsTable.id",
|
|
41
|
+
secondaryjoin="UserOrganizationsTable.user_id == UsersTable.id",
|
|
42
|
+
uselist=False,
|
|
43
|
+
viewonly=True,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
organization = relationship(
|
|
47
|
+
"OrganizationsTable",
|
|
48
|
+
secondary="user_organizations",
|
|
49
|
+
primaryjoin="UserOrganizationRolesTable.user_organization_id == UserOrganizationsTable.id",
|
|
50
|
+
secondaryjoin="UserOrganizationsTable.organization_id == OrganizationsTable.id",
|
|
51
|
+
uselist=False,
|
|
52
|
+
viewonly=True,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
organization_role = relationship(
|
|
56
|
+
"OrganizationRolesTable",
|
|
57
|
+
back_populates="user_organization_roles",
|
|
58
|
+
cascade="all",
|
|
59
|
+
lazy="select",
|
|
60
|
+
uselist=False,
|
|
61
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from sqlalchemy import Column, ForeignKey
|
|
2
|
+
from sqlalchemy.orm import relationship
|
|
3
|
+
from sqlalchemy.types import String, Enum, Integer, Date, Text
|
|
4
|
+
from maleo.soma.models.table import DataTable
|
|
5
|
+
from maleo.metadata.enums.blood_type import BloodType
|
|
6
|
+
from maleo.metadata.enums.gender import Gender
|
|
7
|
+
from maleo.identity.db import MaleoIdentityBase
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class UserProfilesMixin:
|
|
11
|
+
# Foreign Key and Relationship to UsersTable
|
|
12
|
+
user_id = Column(
|
|
13
|
+
Integer,
|
|
14
|
+
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
15
|
+
nullable=False,
|
|
16
|
+
)
|
|
17
|
+
id_card = Column(name="id_card", type_=String(16))
|
|
18
|
+
leading_title = Column(name="leading_title", type_=String(25))
|
|
19
|
+
first_name = Column(name="first_name", type_=String(50), nullable=False)
|
|
20
|
+
middle_name = Column(name="middle_name", type_=String(50))
|
|
21
|
+
last_name = Column(name="last_name", type_=String(50), nullable=False)
|
|
22
|
+
ending_title = Column(name="ending_title", type_=String(25))
|
|
23
|
+
full_name = Column(name="full_name", type_=String(200), nullable=False)
|
|
24
|
+
birth_place = Column(name="birth_place", type_=String(50))
|
|
25
|
+
birth_date = Column(name="birth_date", type_=Date)
|
|
26
|
+
gender = Column(name="gender", type_=Enum(Gender, name="gender"))
|
|
27
|
+
blood_type = Column(name="blood_type", type_=Enum(BloodType, name="blood_type"))
|
|
28
|
+
avatar_name = Column(name="avatar_name", type_=Text, nullable=False)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class UserProfilesTable(UserProfilesMixin, DataTable, MaleoIdentityBase):
|
|
32
|
+
__tablename__ = "user_profiles"
|
|
33
|
+
user = relationship("UsersTable", back_populates="profile")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from sqlalchemy import Column, ForeignKey
|
|
2
|
+
from sqlalchemy.orm import relationship
|
|
3
|
+
from sqlalchemy.types import Enum, Integer
|
|
4
|
+
from maleo.soma.models.table import DataTable
|
|
5
|
+
from maleo.metadata.enums.system_role import SystemRole
|
|
6
|
+
from maleo.identity.db import MaleoIdentityBase
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UserSystemRolesMixin:
|
|
10
|
+
user_id = Column(
|
|
11
|
+
Integer,
|
|
12
|
+
ForeignKey("users.id", ondelete="CASCADE", onupdate="CASCADE"),
|
|
13
|
+
nullable=False,
|
|
14
|
+
)
|
|
15
|
+
system_role = Column(
|
|
16
|
+
name="system_role",
|
|
17
|
+
type_=Enum(SystemRole, name="system_role"),
|
|
18
|
+
default=SystemRole.USER,
|
|
19
|
+
nullable=False,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class UserSystemRolesTable(UserSystemRolesMixin, DataTable, MaleoIdentityBase):
|
|
24
|
+
__tablename__ = "user_system_roles"
|
|
25
|
+
# Foreign Key and Relationship to UsersTable
|
|
26
|
+
user = relationship("UsersTable", back_populates="system_roles")
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
4
|
+
from maleo.soma.mixins.general import OptionalParentId
|
|
5
|
+
from maleo.metadata.schemas.data.organization_type import (
|
|
6
|
+
SimpleOrganizationTypeMixin,
|
|
7
|
+
OptionalExpandedOrganizationTypeMixin,
|
|
8
|
+
)
|
|
9
|
+
from maleo.identity.mixins.organization import Key, Name
|
|
10
|
+
from .organization_registration_code import (
|
|
11
|
+
OptionalOrganizationRegistrationCodeDataMixin,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class OrganizationDataSchema(
|
|
16
|
+
OptionalOrganizationRegistrationCodeDataMixin,
|
|
17
|
+
Name,
|
|
18
|
+
Key,
|
|
19
|
+
OptionalParentId,
|
|
20
|
+
OptionalExpandedOrganizationTypeMixin,
|
|
21
|
+
SimpleOrganizationTypeMixin,
|
|
22
|
+
DataStatus,
|
|
23
|
+
DataTimestamp,
|
|
24
|
+
DataIdentifier,
|
|
25
|
+
):
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class OrganizationDataMixin(BaseModel):
|
|
30
|
+
organization: OrganizationDataSchema = Field(..., description="Organization.")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class OptionalOrganizationDataMixin(BaseModel):
|
|
34
|
+
organization: Optional[OrganizationDataSchema] = Field(
|
|
35
|
+
None, description="Organization. (Optional)"
|
|
36
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
4
|
+
from maleo.soma.mixins.general import OrganizationId
|
|
5
|
+
from maleo.identity.mixins.organization_registration_code import (
|
|
6
|
+
Code,
|
|
7
|
+
MaxUses,
|
|
8
|
+
CurrentUses,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class OrganizationRegistrationCodeDataSchema(
|
|
13
|
+
CurrentUses,
|
|
14
|
+
MaxUses,
|
|
15
|
+
Code,
|
|
16
|
+
OrganizationId,
|
|
17
|
+
DataStatus,
|
|
18
|
+
DataTimestamp,
|
|
19
|
+
DataIdentifier,
|
|
20
|
+
):
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class OrganizationRegistrationCodeDataMixin(BaseModel):
|
|
25
|
+
registration_code: OrganizationRegistrationCodeDataSchema = Field(
|
|
26
|
+
..., description="Organization's Registration Code."
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class OptionalOrganizationRegistrationCodeDataMixin(BaseModel):
|
|
31
|
+
registration_code: Optional[OrganizationRegistrationCodeDataSchema] = Field(
|
|
32
|
+
None, description="Organization's Registration Code. (Optional)"
|
|
33
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
4
|
+
from maleo.soma.mixins.general import IsDefault, Order, OrganizationId
|
|
5
|
+
from maleo.identity.mixins.organization_role import Key, Name
|
|
6
|
+
from .organization import OptionalOrganizationDataMixin
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class OrganizationRoleDataSchema(
|
|
10
|
+
Name,
|
|
11
|
+
Key,
|
|
12
|
+
Order,
|
|
13
|
+
IsDefault,
|
|
14
|
+
OptionalOrganizationDataMixin,
|
|
15
|
+
OrganizationId,
|
|
16
|
+
DataStatus,
|
|
17
|
+
DataTimestamp,
|
|
18
|
+
DataIdentifier,
|
|
19
|
+
):
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class OrganizationRoleDataMixin(BaseModel):
|
|
24
|
+
organization_role: OrganizationRoleDataSchema = Field(
|
|
25
|
+
..., description="Organization role."
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class OptionalOrganizationRoleDataMixin(BaseModel):
|
|
30
|
+
organization_role: Optional[OrganizationRoleDataSchema] = Field(
|
|
31
|
+
None, description="Organization role. (Optional)"
|
|
32
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
4
|
+
from maleo.metadata.schemas.data.user_type import (
|
|
5
|
+
SimpleUserTypeMixin,
|
|
6
|
+
OptionalExpandedUserTypeMixin,
|
|
7
|
+
)
|
|
8
|
+
from maleo.identity.mixins.user import Username, Email, Phone
|
|
9
|
+
from .user_profile import OptionalUserProfileDataMixin
|
|
10
|
+
from .user_system_role import ListOfUserSystemRolesDataMixin
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class UserDataSchema(
|
|
14
|
+
OptionalUserProfileDataMixin,
|
|
15
|
+
ListOfUserSystemRolesDataMixin,
|
|
16
|
+
Phone,
|
|
17
|
+
Email,
|
|
18
|
+
Username,
|
|
19
|
+
OptionalExpandedUserTypeMixin,
|
|
20
|
+
SimpleUserTypeMixin,
|
|
21
|
+
DataStatus,
|
|
22
|
+
DataTimestamp,
|
|
23
|
+
DataIdentifier,
|
|
24
|
+
):
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class UserDataMixin(BaseModel):
|
|
29
|
+
user: UserDataSchema = Field(..., description="User.")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class OptionalUserDataMixin(BaseModel):
|
|
33
|
+
user: Optional[UserDataSchema] = Field(None, description="User. (Optional)")
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
3
|
+
from maleo.soma.mixins.general import UserId, OrganizationId
|
|
4
|
+
from .organization import OrganizationDataMixin
|
|
5
|
+
from .user import UserDataMixin
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UserOrganizationDataSchema(
|
|
9
|
+
OrganizationDataMixin,
|
|
10
|
+
OrganizationId,
|
|
11
|
+
UserDataMixin,
|
|
12
|
+
UserId,
|
|
13
|
+
DataStatus,
|
|
14
|
+
DataTimestamp,
|
|
15
|
+
DataIdentifier,
|
|
16
|
+
):
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class UserOrganizationDataMixin(BaseModel):
|
|
21
|
+
user_organization: UserOrganizationDataSchema = Field(
|
|
22
|
+
..., description="User organization"
|
|
23
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
2
|
+
from maleo.identity.schemas.data.organization_role import OrganizationRoleDataMixin
|
|
3
|
+
from maleo.identity.schemas.data.user_organization import UserOrganizationDataMixin
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class UserOrganizationRoleDataSchema(
|
|
7
|
+
OrganizationRoleDataMixin,
|
|
8
|
+
UserOrganizationDataMixin,
|
|
9
|
+
DataStatus,
|
|
10
|
+
DataTimestamp,
|
|
11
|
+
DataIdentifier,
|
|
12
|
+
):
|
|
13
|
+
pass
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
4
|
+
from maleo.soma.mixins.general import UserId
|
|
5
|
+
from maleo.metadata.schemas.data.blood_type import (
|
|
6
|
+
OptionalSimpleBloodTypeMixin,
|
|
7
|
+
OptionalExpandedBloodTypeMixin,
|
|
8
|
+
)
|
|
9
|
+
from maleo.metadata.schemas.data.gender import (
|
|
10
|
+
OptionalSimpleGenderMixin,
|
|
11
|
+
OptionalExpandedGenderMixin,
|
|
12
|
+
)
|
|
13
|
+
from maleo.identity.mixins.user_profile import (
|
|
14
|
+
IdCard,
|
|
15
|
+
LeadingTitle,
|
|
16
|
+
FirstName,
|
|
17
|
+
MiddleName,
|
|
18
|
+
LastName,
|
|
19
|
+
EndingTitle,
|
|
20
|
+
FullName,
|
|
21
|
+
BirthPlace,
|
|
22
|
+
BirthDate,
|
|
23
|
+
AvatarName,
|
|
24
|
+
OptionalAvatarUrl,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class UserProfileDataSchema(
|
|
29
|
+
OptionalAvatarUrl,
|
|
30
|
+
AvatarName,
|
|
31
|
+
OptionalExpandedBloodTypeMixin,
|
|
32
|
+
OptionalSimpleBloodTypeMixin,
|
|
33
|
+
OptionalExpandedGenderMixin,
|
|
34
|
+
OptionalSimpleGenderMixin,
|
|
35
|
+
BirthDate,
|
|
36
|
+
BirthPlace,
|
|
37
|
+
FullName,
|
|
38
|
+
EndingTitle,
|
|
39
|
+
LastName,
|
|
40
|
+
MiddleName,
|
|
41
|
+
FirstName,
|
|
42
|
+
LeadingTitle,
|
|
43
|
+
IdCard,
|
|
44
|
+
UserId,
|
|
45
|
+
DataStatus,
|
|
46
|
+
DataTimestamp,
|
|
47
|
+
DataIdentifier,
|
|
48
|
+
):
|
|
49
|
+
pass
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class UserProfileDataMixin(BaseModel):
|
|
53
|
+
profile: UserProfileDataSchema = Field(..., description="Profile.")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class OptionalUserProfileDataMixin(BaseModel):
|
|
57
|
+
profile: Optional[UserProfileDataSchema] = Field(
|
|
58
|
+
None, description="Profile. (Optional)"
|
|
59
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import List
|
|
3
|
+
from maleo.soma.mixins.data import DataIdentifier, DataTimestamp, DataStatus
|
|
4
|
+
from maleo.soma.mixins.general import UserId
|
|
5
|
+
from maleo.metadata.schemas.data.system_role import (
|
|
6
|
+
SimpleSystemRoleMixin,
|
|
7
|
+
OptionalExpandedSystemRoleMixin,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class UserSystemRoleDataSchema(
|
|
12
|
+
OptionalExpandedSystemRoleMixin,
|
|
13
|
+
SimpleSystemRoleMixin,
|
|
14
|
+
UserId,
|
|
15
|
+
DataStatus,
|
|
16
|
+
DataTimestamp,
|
|
17
|
+
DataIdentifier,
|
|
18
|
+
):
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ListOfUserSystemRolesDataMixin(BaseModel):
|
|
23
|
+
system_roles: List[UserSystemRoleDataSchema] = Field(
|
|
24
|
+
[], description="User system roles"
|
|
25
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from maleo.soma.mixins.general import IsRoot, IsParent, IsChild, IsLeaf, OrganizationId
|
|
2
|
+
from maleo.soma.mixins.parameter import (
|
|
3
|
+
OptionalListOfIds,
|
|
4
|
+
OptionalListOfKeys,
|
|
5
|
+
OptionalListOfParentIds,
|
|
6
|
+
OptionalListOfUuids,
|
|
7
|
+
)
|
|
8
|
+
from maleo.soma.schemas.parameter.client import (
|
|
9
|
+
ReadPaginatedMultipleParameterSchema,
|
|
10
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
11
|
+
)
|
|
12
|
+
from maleo.metadata.schemas.data.organization_type import (
|
|
13
|
+
OptionalListOfSimpleOrganizationTypesMixin,
|
|
14
|
+
)
|
|
15
|
+
from maleo.identity.mixins.organization import Expand
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ReadMultipleParameter(
|
|
19
|
+
Expand,
|
|
20
|
+
ReadPaginatedMultipleParameterSchema,
|
|
21
|
+
OptionalListOfKeys,
|
|
22
|
+
IsLeaf,
|
|
23
|
+
IsChild,
|
|
24
|
+
IsParent,
|
|
25
|
+
IsRoot,
|
|
26
|
+
OptionalListOfParentIds,
|
|
27
|
+
OptionalListOfSimpleOrganizationTypesMixin,
|
|
28
|
+
OptionalListOfUuids,
|
|
29
|
+
OptionalListOfIds,
|
|
30
|
+
):
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class ReadMultipleChildrenParameter(
|
|
35
|
+
Expand,
|
|
36
|
+
ReadPaginatedMultipleParameterSchema,
|
|
37
|
+
OptionalListOfKeys,
|
|
38
|
+
IsLeaf,
|
|
39
|
+
IsParent,
|
|
40
|
+
OrganizationId,
|
|
41
|
+
OptionalListOfSimpleOrganizationTypesMixin,
|
|
42
|
+
OptionalListOfUuids,
|
|
43
|
+
OptionalListOfIds,
|
|
44
|
+
):
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class ReadMultipleQueryParameter(
|
|
49
|
+
Expand,
|
|
50
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
51
|
+
OptionalListOfKeys,
|
|
52
|
+
IsLeaf,
|
|
53
|
+
IsChild,
|
|
54
|
+
IsParent,
|
|
55
|
+
IsRoot,
|
|
56
|
+
OptionalListOfParentIds,
|
|
57
|
+
OptionalListOfSimpleOrganizationTypesMixin,
|
|
58
|
+
OptionalListOfUuids,
|
|
59
|
+
OptionalListOfIds,
|
|
60
|
+
):
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class ReadMultipleChildrenQueryParameter(
|
|
65
|
+
Expand,
|
|
66
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
67
|
+
OptionalListOfKeys,
|
|
68
|
+
IsLeaf,
|
|
69
|
+
IsParent,
|
|
70
|
+
OptionalListOfSimpleOrganizationTypesMixin,
|
|
71
|
+
OptionalListOfUuids,
|
|
72
|
+
OptionalListOfIds,
|
|
73
|
+
):
|
|
74
|
+
pass
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from maleo.soma.mixins.general import OrganizationId
|
|
2
|
+
from maleo.soma.mixins.parameter import OptionalListOfOrganizationIds
|
|
3
|
+
from maleo.soma.schemas.parameter.client import (
|
|
4
|
+
ReadPaginatedMultipleParameterSchema,
|
|
5
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ReadMultipleFromOrganizationParameter(
|
|
10
|
+
ReadPaginatedMultipleParameterSchema, OrganizationId
|
|
11
|
+
):
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ReadMultipleParameter(
|
|
16
|
+
ReadPaginatedMultipleParameterSchema, OptionalListOfOrganizationIds
|
|
17
|
+
):
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ReadMultipleQueryParameter(
|
|
22
|
+
ReadPaginatedMultipleQueryParameterSchema, OptionalListOfOrganizationIds
|
|
23
|
+
):
|
|
24
|
+
pass
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from maleo.soma.mixins.general import OrganizationId
|
|
2
|
+
from maleo.soma.mixins.parameter import (
|
|
3
|
+
OptionalListOfKeys,
|
|
4
|
+
OptionalListOfOrganizationIds,
|
|
5
|
+
)
|
|
6
|
+
from maleo.soma.schemas.parameter.client import (
|
|
7
|
+
ReadPaginatedMultipleParameterSchema,
|
|
8
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
9
|
+
)
|
|
10
|
+
from maleo.identity.mixins.organization_role import Expand
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ReadMultipleFromOrganizationParameter(
|
|
14
|
+
Expand, ReadPaginatedMultipleParameterSchema, OptionalListOfKeys, OrganizationId
|
|
15
|
+
):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ReadMultipleParameter(
|
|
20
|
+
Expand,
|
|
21
|
+
ReadPaginatedMultipleParameterSchema,
|
|
22
|
+
OptionalListOfKeys,
|
|
23
|
+
OptionalListOfOrganizationIds,
|
|
24
|
+
):
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ReadMultipleFromOrganizationQueryParameter(
|
|
29
|
+
Expand,
|
|
30
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
31
|
+
OptionalListOfKeys,
|
|
32
|
+
):
|
|
33
|
+
pass
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ReadMultipleQueryParameter(
|
|
37
|
+
Expand,
|
|
38
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
39
|
+
OptionalListOfKeys,
|
|
40
|
+
OptionalListOfOrganizationIds,
|
|
41
|
+
):
|
|
42
|
+
pass
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from maleo.soma.mixins.parameter import OptionalListOfIds, OptionalListOfUuids
|
|
2
|
+
from maleo.soma.schemas.parameter.client import (
|
|
3
|
+
ReadPaginatedMultipleParameterSchema,
|
|
4
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
5
|
+
)
|
|
6
|
+
from maleo.metadata.schemas.data.blood_type import OptionalListOfSimpleBloodTypesMixin
|
|
7
|
+
from maleo.metadata.schemas.data.gender import OptionalListOfSimpleGendersMixin
|
|
8
|
+
from maleo.metadata.schemas.data.user_type import OptionalListOfSimpleUserTypesMixin
|
|
9
|
+
from maleo.identity.mixins.user import (
|
|
10
|
+
OptionalListOfUsernames,
|
|
11
|
+
OptionalListOfEmails,
|
|
12
|
+
OptionalListOfPhones,
|
|
13
|
+
Expand,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ReadMultipleParameter(
|
|
18
|
+
Expand,
|
|
19
|
+
ReadPaginatedMultipleParameterSchema,
|
|
20
|
+
OptionalListOfSimpleBloodTypesMixin,
|
|
21
|
+
OptionalListOfSimpleGendersMixin,
|
|
22
|
+
OptionalListOfPhones,
|
|
23
|
+
OptionalListOfEmails,
|
|
24
|
+
OptionalListOfUsernames,
|
|
25
|
+
OptionalListOfSimpleUserTypesMixin,
|
|
26
|
+
OptionalListOfUuids,
|
|
27
|
+
OptionalListOfIds,
|
|
28
|
+
):
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ReadMultipleQueryParameter(
|
|
33
|
+
Expand,
|
|
34
|
+
ReadPaginatedMultipleQueryParameterSchema,
|
|
35
|
+
OptionalListOfSimpleBloodTypesMixin,
|
|
36
|
+
OptionalListOfSimpleGendersMixin,
|
|
37
|
+
OptionalListOfPhones,
|
|
38
|
+
OptionalListOfEmails,
|
|
39
|
+
OptionalListOfUsernames,
|
|
40
|
+
OptionalListOfSimpleUserTypesMixin,
|
|
41
|
+
OptionalListOfUuids,
|
|
42
|
+
OptionalListOfIds,
|
|
43
|
+
):
|
|
44
|
+
pass
|