maleo-identity 0.0.73__py3-none-any.whl → 0.0.76__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-0.0.73.dist-info → maleo_identity-0.0.76.dist-info}/METADATA +3 -3
- maleo_identity-0.0.76.dist-info/RECORD +4 -0
- maleo_identity-0.0.76.dist-info/top_level.txt +1 -0
- maleo_identity/__init__.py +0 -0
- maleo_identity/client/__init__.py +0 -0
- maleo_identity/client/controllers/__init__.py +0 -17
- maleo_identity/client/controllers/http/__init__.py +0 -0
- maleo_identity/client/controllers/http/organization.py +0 -647
- maleo_identity/client/controllers/http/user.py +0 -541
- maleo_identity/client/manager.py +0 -77
- maleo_identity/client/services/__init__.py +0 -11
- maleo_identity/client/services/organization.py +0 -968
- maleo_identity/client/services/user.py +0 -817
- maleo_identity/constants/__init__.py +0 -17
- maleo_identity/constants/organization.py +0 -13
- maleo_identity/constants/organization_registration_code.py +0 -14
- maleo_identity/constants/organization_role.py +0 -22
- maleo_identity/constants/user.py +0 -27
- maleo_identity/constants/user_organization.py +0 -46
- maleo_identity/constants/user_organization_role.py +0 -35
- maleo_identity/constants/user_profile.py +0 -20
- maleo_identity/constants/user_system_role.py +0 -9
- maleo_identity/db.py +0 -6
- maleo_identity/enums/__init__.py +0 -19
- maleo_identity/enums/general.py +0 -5
- maleo_identity/enums/organization.py +0 -11
- maleo_identity/enums/organization_registration_code.py +0 -8
- maleo_identity/enums/organization_role.py +0 -7
- maleo_identity/enums/user.py +0 -16
- maleo_identity/enums/user_organization.py +0 -14
- maleo_identity/enums/user_organization_role.py +0 -15
- maleo_identity/enums/user_profile.py +0 -15
- maleo_identity/enums/user_system_role.py +0 -5
- maleo_identity/models/__init__.py +0 -11
- maleo_identity/models/responses/__init__.py +0 -17
- maleo_identity/models/responses/organization.py +0 -58
- maleo_identity/models/responses/organization_registration_code.py +0 -46
- maleo_identity/models/responses/organization_role.py +0 -25
- maleo_identity/models/responses/user.py +0 -68
- maleo_identity/models/responses/user_organization.py +0 -25
- maleo_identity/models/responses/user_organization_role.py +0 -25
- maleo_identity/models/responses/user_profile.py +0 -46
- maleo_identity/models/responses/user_system_role.py +0 -25
- maleo_identity/models/schemas/__init__.py +0 -19
- maleo_identity/models/schemas/general.py +0 -18
- maleo_identity/models/schemas/organization.py +0 -25
- maleo_identity/models/schemas/organization_registration_code.py +0 -21
- maleo_identity/models/schemas/organization_role.py +0 -15
- maleo_identity/models/schemas/user.py +0 -44
- maleo_identity/models/schemas/user_organization.py +0 -8
- maleo_identity/models/schemas/user_organization_role.py +0 -15
- maleo_identity/models/schemas/user_profile.py +0 -57
- maleo_identity/models/schemas/user_system_role.py +0 -8
- maleo_identity/models/tables/__init__.py +0 -19
- maleo_identity/models/tables/organization.py +0 -58
- maleo_identity/models/tables/organization_registration_code.py +0 -37
- maleo_identity/models/tables/organization_role.py +0 -43
- maleo_identity/models/tables/user.py +0 -43
- maleo_identity/models/tables/user_organization.py +0 -58
- maleo_identity/models/tables/user_organization_role.py +0 -69
- maleo_identity/models/tables/user_profile.py +0 -31
- maleo_identity/models/tables/user_system_role.py +0 -24
- maleo_identity/models/transfers/__init__.py +0 -9
- maleo_identity/models/transfers/general/__init__.py +0 -17
- maleo_identity/models/transfers/general/organization.py +0 -31
- maleo_identity/models/transfers/general/organization_registration_code.py +0 -19
- maleo_identity/models/transfers/general/organization_role.py +0 -20
- maleo_identity/models/transfers/general/user.py +0 -28
- maleo_identity/models/transfers/general/user_organization.py +0 -18
- maleo_identity/models/transfers/general/user_organization_role.py +0 -19
- maleo_identity/models/transfers/general/user_profile.py +0 -32
- maleo_identity/models/transfers/general/user_system_role.py +0 -17
- maleo_identity/models/transfers/parameters/__init__.py +0 -9
- maleo_identity/models/transfers/parameters/client/__init__.py +0 -17
- maleo_identity/models/transfers/parameters/client/organization.py +0 -77
- maleo_identity/models/transfers/parameters/client/organization_registration_code.py +0 -24
- maleo_identity/models/transfers/parameters/client/organization_role.py +0 -33
- maleo_identity/models/transfers/parameters/client/user.py +0 -34
- maleo_identity/models/transfers/parameters/client/user_organization.py +0 -45
- maleo_identity/models/transfers/parameters/client/user_organization_role.py +0 -36
- maleo_identity/models/transfers/parameters/client/user_profile.py +0 -23
- maleo_identity/models/transfers/parameters/client/user_system_role.py +0 -33
- maleo_identity/models/transfers/parameters/general/__init__.py +0 -17
- maleo_identity/models/transfers/parameters/general/organization.py +0 -35
- maleo_identity/models/transfers/parameters/general/organization_registration_code.py +0 -33
- maleo_identity/models/transfers/parameters/general/organization_role.py +0 -17
- maleo_identity/models/transfers/parameters/general/user.py +0 -77
- maleo_identity/models/transfers/parameters/general/user_organization.py +0 -31
- maleo_identity/models/transfers/parameters/general/user_organization_role.py +0 -18
- maleo_identity/models/transfers/parameters/general/user_profile.py +0 -55
- maleo_identity/models/transfers/parameters/general/user_system_role.py +0 -29
- maleo_identity/models/transfers/parameters/service/__init__.py +0 -17
- maleo_identity/models/transfers/parameters/service/organization.py +0 -66
- maleo_identity/models/transfers/parameters/service/organization_registration_code.py +0 -19
- maleo_identity/models/transfers/parameters/service/organization_role.py +0 -26
- maleo_identity/models/transfers/parameters/service/user.py +0 -34
- maleo_identity/models/transfers/parameters/service/user_organization.py +0 -31
- maleo_identity/models/transfers/parameters/service/user_organization_role.py +0 -28
- maleo_identity/models/transfers/parameters/service/user_profile.py +0 -23
- maleo_identity/models/transfers/parameters/service/user_system_role.py +0 -26
- maleo_identity/models/transfers/results/__init__.py +0 -5
- maleo_identity/models/transfers/results/client/__init__.py +0 -17
- maleo_identity/models/transfers/results/client/organization.py +0 -21
- maleo_identity/models/transfers/results/client/organization_registration_code.py +0 -15
- maleo_identity/models/transfers/results/client/organization_role.py +0 -15
- maleo_identity/models/transfers/results/client/user.py +0 -24
- maleo_identity/models/transfers/results/client/user_organization.py +0 -15
- maleo_identity/models/transfers/results/client/user_organization_role.py +0 -15
- maleo_identity/models/transfers/results/client/user_profile.py +0 -15
- maleo_identity/models/transfers/results/client/user_system_role.py +0 -15
- maleo_identity/models/transfers/results/service/__init__.py +0 -0
- maleo_identity/models/transfers/results/service/organization.py +0 -21
- maleo_identity/models/transfers/results/service/organization_registration_code.py +0 -15
- maleo_identity/models/transfers/results/service/organization_role.py +0 -15
- maleo_identity/models/transfers/results/service/user.py +0 -24
- maleo_identity/models/transfers/results/service/user_organization.py +0 -15
- maleo_identity/models/transfers/results/service/user_organization_role.py +0 -15
- maleo_identity/models/transfers/results/service/user_profile.py +0 -15
- maleo_identity/models/transfers/results/service/user_system_role.py +0 -15
- maleo_identity/types/__init__.py +0 -5
- maleo_identity/types/results/__init__.py +0 -5
- maleo_identity/types/results/client/__init__.py +0 -17
- maleo_identity/types/results/client/organization.py +0 -30
- maleo_identity/types/results/client/organization_registration_code.py +0 -20
- maleo_identity/types/results/client/organization_role.py +0 -14
- maleo_identity/types/results/client/user.py +0 -29
- maleo_identity/types/results/client/user_organization.py +0 -19
- maleo_identity/types/results/client/user_organization_role.py +0 -14
- maleo_identity/types/results/client/user_profile.py +0 -19
- maleo_identity/types/results/client/user_system_role.py +0 -19
- maleo_identity/types/results/service/__init__.py +0 -0
- maleo_identity/types/results/service/organization.py +0 -32
- maleo_identity/types/results/service/organization_registration_code.py +0 -21
- maleo_identity/types/results/service/organization_role.py +0 -15
- maleo_identity/types/results/service/user.py +0 -30
- maleo_identity/types/results/service/user_organization.py +0 -20
- maleo_identity/types/results/service/user_organization_role.py +0 -15
- maleo_identity/types/results/service/user_profile.py +0 -20
- maleo_identity/types/results/service/user_system_role.py +0 -20
- maleo_identity-0.0.73.dist-info/RECORD +0 -140
- maleo_identity-0.0.73.dist-info/top_level.txt +0 -1
- {maleo_identity-0.0.73.dist-info → maleo_identity-0.0.76.dist-info}/WHEEL +0 -0
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from maleo_foundation.models.responses import BaseResponses
|
|
3
|
-
from maleo_identity.enums.user_profile import MaleoIdentityUserProfileEnums
|
|
4
|
-
from maleo_identity.models.transfers.general.user_profile import UserProfileTransfers
|
|
5
|
-
|
|
6
|
-
class MaleoIdentityUserProfileResponses:
|
|
7
|
-
class InvalidIdentifierType(BaseResponses.BadRequest):
|
|
8
|
-
code:str = "IDT-UPR-001"
|
|
9
|
-
message:str = "Invalid identifier type"
|
|
10
|
-
description:str = "Invalid identifier type is given in the request"
|
|
11
|
-
other: str = f"Valid identifier types: {[f'{e.name} ({e.value})' for e in MaleoIdentityUserProfileEnums.IdentifierType]}"
|
|
12
|
-
|
|
13
|
-
class InvalidValueType(BaseResponses.BadRequest):
|
|
14
|
-
code:str = "IDT-UPR-002"
|
|
15
|
-
message:str = "Invalid value type"
|
|
16
|
-
description:str = "Invalid value type is given in the request"
|
|
17
|
-
|
|
18
|
-
class GetSingle(BaseResponses.SingleData):
|
|
19
|
-
code:str = "IDT-UPR-003"
|
|
20
|
-
message:str = "User profile found"
|
|
21
|
-
description:str = "Requested user profile found in database"
|
|
22
|
-
data:UserProfileTransfers = Field(..., description="User profile")
|
|
23
|
-
|
|
24
|
-
class GetMultiple(BaseResponses.PaginatedMultipleData):
|
|
25
|
-
code:str = "IDT-UPR-004"
|
|
26
|
-
message:str = "User profiles found"
|
|
27
|
-
description:str = "Requested user profiles found in database"
|
|
28
|
-
data:list[UserProfileTransfers] = Field(..., description="User profiles")
|
|
29
|
-
|
|
30
|
-
class CreateFailed(BaseResponses.BadRequest):
|
|
31
|
-
code:str = "IDT-UPR-005"
|
|
32
|
-
message:str = "Failed creating new user profile"
|
|
33
|
-
|
|
34
|
-
class CreateSuccess(BaseResponses.SingleData):
|
|
35
|
-
code:str = "IDT-UPR-006"
|
|
36
|
-
message:str = "Successfully created new user profile"
|
|
37
|
-
data:UserProfileTransfers = Field(..., description="User profile")
|
|
38
|
-
|
|
39
|
-
class UpdateFailed(BaseResponses.BadRequest):
|
|
40
|
-
code:str = "IDT-UPR-007"
|
|
41
|
-
message:str = "Failed updating user profile's data"
|
|
42
|
-
|
|
43
|
-
class UpdateSuccess(BaseResponses.SingleData):
|
|
44
|
-
code:str = "IDT-UPR-008"
|
|
45
|
-
message:str = "Successfully updated user profile's data"
|
|
46
|
-
data:UserProfileTransfers = Field(..., description="User profile")
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from maleo_foundation.models.responses import BaseResponses
|
|
3
|
-
from maleo_identity.models.transfers.general.user_system_role import UserSystemRoleTransfers
|
|
4
|
-
|
|
5
|
-
class MaleoIdentityUserSystemRoleResponses:
|
|
6
|
-
class GetSingle(BaseResponses.SingleData):
|
|
7
|
-
code:str = "IDT-URL-001"
|
|
8
|
-
message:str = "User system role found"
|
|
9
|
-
description:str = "Requested user system role found in database"
|
|
10
|
-
data:UserSystemRoleTransfers = Field(..., description="User system role")
|
|
11
|
-
|
|
12
|
-
class GetMultiple(BaseResponses.PaginatedMultipleData):
|
|
13
|
-
code:str = "IDT-URL-002"
|
|
14
|
-
message:str = "User system roles found"
|
|
15
|
-
description:str = "Requested user system roles found in database"
|
|
16
|
-
data:list[UserSystemRoleTransfers] = Field(..., description="User system roles")
|
|
17
|
-
|
|
18
|
-
class AssignFailed(BaseResponses.BadRequest):
|
|
19
|
-
code:str = "IDT-URL-003"
|
|
20
|
-
message:str = "Failed assigning new user system role"
|
|
21
|
-
|
|
22
|
-
class AssignSuccess(BaseResponses.SingleData):
|
|
23
|
-
code:str = "IDT-URL-004"
|
|
24
|
-
message:str = "Successfully assigned new user system role"
|
|
25
|
-
data:UserSystemRoleTransfers = Field(..., description="User system role")
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from .general import MaleoIdentityGeneralSchemas
|
|
3
|
-
from .organization_role import MaleoIdentityOrganizationRoleSchemas
|
|
4
|
-
from .organization import MaleoIdentityOrganizationSchemas
|
|
5
|
-
from .user_organization_role import MaleoIdentityUserOrganizationRoleSchemas
|
|
6
|
-
from .user_organization import MaleoIdentityUserOrganizationSchemas
|
|
7
|
-
from .user_profile import MaleoIdentityUserProfileSchemas
|
|
8
|
-
from .user_system_role import MaleoIdentityUserSystemRoleSchemas
|
|
9
|
-
from .user import MaleoIdentityUserSchemas
|
|
10
|
-
|
|
11
|
-
class MaleoIdentitySchemas:
|
|
12
|
-
General = MaleoIdentityGeneralSchemas
|
|
13
|
-
OrganizationRole = MaleoIdentityOrganizationRoleSchemas
|
|
14
|
-
Organization = MaleoIdentityOrganizationSchemas
|
|
15
|
-
UserOrganizationRole = MaleoIdentityUserOrganizationRoleSchemas
|
|
16
|
-
UserOrganization = MaleoIdentityUserOrganizationSchemas
|
|
17
|
-
UserProfile = MaleoIdentityUserProfileSchemas
|
|
18
|
-
UserSystemRole = MaleoIdentityUserSystemRoleSchemas
|
|
19
|
-
User = MaleoIdentityUserSchemas
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
from maleo_foundation.types import BaseTypes
|
|
3
|
-
|
|
4
|
-
class MaleoIdentityGeneralSchemas:
|
|
5
|
-
class UserId(BaseModel):
|
|
6
|
-
user_id:int = Field(..., ge=1, description="User's ID")
|
|
7
|
-
|
|
8
|
-
class OptionalListOfUserIds(BaseModel):
|
|
9
|
-
user_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="User's IDs")
|
|
10
|
-
|
|
11
|
-
class OrganizationId(BaseModel):
|
|
12
|
-
organization_id:int = Field(..., ge=1, description="Organization's ID")
|
|
13
|
-
|
|
14
|
-
class OptionalOrganizationId(BaseModel):
|
|
15
|
-
organization_id:BaseTypes.OptionalInteger = Field(None, ge=1, description="Optional Organization's ID")
|
|
16
|
-
|
|
17
|
-
class OptionalListOfOrganizationIds(BaseModel):
|
|
18
|
-
organization_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="Organization's IDs")
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
|
4
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
5
|
-
from maleo_foundation.types import BaseTypes
|
|
6
|
-
from maleo_identity.enums.organization import MaleoIdentityOrganizationEnums
|
|
7
|
-
|
|
8
|
-
class MaleoIdentityOrganizationSchemas:
|
|
9
|
-
class IdentifierType(BaseParameterSchemas.IdentifierType):
|
|
10
|
-
identifier:MaleoIdentityOrganizationEnums.IdentifierType = Field(..., description="Organization's identifier")
|
|
11
|
-
|
|
12
|
-
class Expand(BaseParameterSchemas.Expand):
|
|
13
|
-
expand:Optional[List[MaleoIdentityOrganizationEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
|
|
14
|
-
|
|
15
|
-
class OptionalParentId(BaseModel):
|
|
16
|
-
parent_id:BaseTypes.OptionalInteger = Field(None, ge=1, description="Parent organization's Id")
|
|
17
|
-
|
|
18
|
-
class OptionalListOfParentIds(BaseModel):
|
|
19
|
-
parent_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="Parent organization's Ids")
|
|
20
|
-
|
|
21
|
-
class Key(BaseGeneralSchemas.Key):
|
|
22
|
-
key:str = Field(..., max_length=255, description="Organization's key")
|
|
23
|
-
|
|
24
|
-
class Name(BaseGeneralSchemas.Name):
|
|
25
|
-
name:str = Field(..., max_length=255, description="Organization's name")
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
from uuid import UUID
|
|
3
|
-
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
|
4
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
5
|
-
from maleo_identity.enums.organization_registration_code import MaleoIdentityOrganizationRegistrationCodeEnums
|
|
6
|
-
|
|
7
|
-
class MaleoIdentityOrganizationRegistrationCodeSchemas:
|
|
8
|
-
class IdentifierType(BaseParameterSchemas.IdentifierType):
|
|
9
|
-
identifier:MaleoIdentityOrganizationRegistrationCodeEnums.IdentifierType = Field(..., description="Organization registration code's identifier")
|
|
10
|
-
|
|
11
|
-
class Name(BaseGeneralSchemas.Name):
|
|
12
|
-
name:str = Field(..., max_length=50, description="Organization Role's name")
|
|
13
|
-
|
|
14
|
-
class Code(BaseModel):
|
|
15
|
-
code:UUID = Field(..., description="Registration code")
|
|
16
|
-
|
|
17
|
-
class MaxUses(BaseModel):
|
|
18
|
-
max_uses:int = Field(..., ge=1, description="Max code uses")
|
|
19
|
-
|
|
20
|
-
class CurrentUses(BaseModel):
|
|
21
|
-
current_uses:int = Field(..., ge=0, description="Current code uses")
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
|
4
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
5
|
-
from maleo_identity.enums.organization_role import MaleoIdentityOrganizationRoleEnums
|
|
6
|
-
|
|
7
|
-
class MaleoIdentityOrganizationRoleSchemas:
|
|
8
|
-
class Expand(BaseParameterSchemas.Expand):
|
|
9
|
-
expand:Optional[List[MaleoIdentityOrganizationRoleEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
|
|
10
|
-
|
|
11
|
-
class Key(BaseGeneralSchemas.Key):
|
|
12
|
-
key:str = Field(..., max_length=50, description="Organization Role's key")
|
|
13
|
-
|
|
14
|
-
class Name(BaseGeneralSchemas.Name):
|
|
15
|
-
name:str = Field(..., max_length=50, description="Organization Role's name")
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
from uuid import UUID
|
|
4
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
5
|
-
from maleo_foundation.models.schemas.result import ResultMetadata
|
|
6
|
-
from maleo_foundation.types import BaseTypes
|
|
7
|
-
from maleo_identity.enums.user import MaleoIdentityUserEnums
|
|
8
|
-
|
|
9
|
-
class MaleoIdentityUserSchemas:
|
|
10
|
-
class IdentifierType(BaseParameterSchemas.IdentifierType):
|
|
11
|
-
identifier:MaleoIdentityUserEnums.IdentifierType = Field(..., description="User's identifier")
|
|
12
|
-
|
|
13
|
-
class Expand(BaseParameterSchemas.Expand):
|
|
14
|
-
expand:Optional[List[MaleoIdentityUserEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
|
|
15
|
-
|
|
16
|
-
class Username(BaseModel):
|
|
17
|
-
username:str = Field(..., max_length=50, description="User's username")
|
|
18
|
-
|
|
19
|
-
class OptionalListOfUsernames(BaseModel):
|
|
20
|
-
usernames:BaseTypes.OptionalListOfStrings = Field(None, description="Specific usernames")
|
|
21
|
-
|
|
22
|
-
class Email(BaseModel):
|
|
23
|
-
email:str = Field(..., max_length=255, description="User's email")
|
|
24
|
-
|
|
25
|
-
class OptionalListOfEmails(BaseModel):
|
|
26
|
-
emails:BaseTypes.OptionalListOfStrings = Field(None, description="Specific emails")
|
|
27
|
-
|
|
28
|
-
class Phone(BaseModel):
|
|
29
|
-
phone:str = Field(..., min_length=4, max_length=15, description="User's phone")
|
|
30
|
-
|
|
31
|
-
class OptionalListOfPhones(BaseModel):
|
|
32
|
-
phones:BaseTypes.OptionalListOfStrings = Field(None, description="Specific phones")
|
|
33
|
-
|
|
34
|
-
class Password(BaseModel):
|
|
35
|
-
password:str = Field(..., max_length=255, description="User's password")
|
|
36
|
-
|
|
37
|
-
class PasswordConfirmation(BaseModel):
|
|
38
|
-
password_confirmation:str = Field(..., max_length=255, description="User's password confirmation")
|
|
39
|
-
|
|
40
|
-
class RegistrationCode(BaseModel):
|
|
41
|
-
registration_code:UUID = Field(..., description="Registration code")
|
|
42
|
-
|
|
43
|
-
class RegisterResultMetadata(ResultMetadata):
|
|
44
|
-
organization_key:BaseTypes.OptionalString = Field(None, description="Organization key")
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
4
|
-
from maleo_identity.enums.user_organization import MaleoIdentityUserOrganizationEnums
|
|
5
|
-
|
|
6
|
-
class MaleoIdentityUserOrganizationSchemas:
|
|
7
|
-
class Expand(BaseParameterSchemas.Expand):
|
|
8
|
-
expand:Optional[List[MaleoIdentityUserOrganizationEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
|
4
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
5
|
-
from maleo_identity.enums.user_organization_role import MaleoIdentityUserOrganizationRoleEnums
|
|
6
|
-
|
|
7
|
-
class MaleoIdentityUserOrganizationRoleSchemas:
|
|
8
|
-
class Expand(BaseParameterSchemas.Expand):
|
|
9
|
-
expand:Optional[List[MaleoIdentityUserOrganizationRoleEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
|
|
10
|
-
|
|
11
|
-
class Key(BaseGeneralSchemas.Key):
|
|
12
|
-
key:str = Field(..., max_length=50, description="Organization Role's key")
|
|
13
|
-
|
|
14
|
-
class Name(BaseGeneralSchemas.Name):
|
|
15
|
-
name:str = Field(..., max_length=50, description="Organization Role's name")
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
4
|
-
from maleo_foundation.types import BaseTypes
|
|
5
|
-
from maleo_identity.enums.user_profile import MaleoIdentityUserProfileEnums
|
|
6
|
-
|
|
7
|
-
class MaleoIdentityUserProfileSchemas:
|
|
8
|
-
class IdentifierType(BaseParameterSchemas.IdentifierType):
|
|
9
|
-
identifier:MaleoIdentityUserProfileEnums.IdentifierType = Field(..., description="User profile's identifier")
|
|
10
|
-
|
|
11
|
-
class Expand(BaseParameterSchemas.Expand):
|
|
12
|
-
expand:Optional[List[MaleoIdentityUserProfileEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
|
|
13
|
-
|
|
14
|
-
class IdCard(BaseModel):
|
|
15
|
-
id_card:str = Field(..., max_length=16, description="User's ID Card")
|
|
16
|
-
|
|
17
|
-
class OptionalIdCard(BaseModel):
|
|
18
|
-
id_card:BaseTypes.OptionalString = Field(None, max_length=16, description="Optional User's ID Card")
|
|
19
|
-
|
|
20
|
-
class LeadingTitle(BaseModel):
|
|
21
|
-
leading_title:BaseTypes.OptionalString = Field(None, max_length=25, description="User's leading title")
|
|
22
|
-
|
|
23
|
-
class FirstName(BaseModel):
|
|
24
|
-
first_name:str = Field(..., max_length=50, description="User's first name")
|
|
25
|
-
|
|
26
|
-
class MiddleName(BaseModel):
|
|
27
|
-
middle_name:BaseTypes.OptionalString = Field(None, max_length=50, description="User's middle name")
|
|
28
|
-
|
|
29
|
-
class LastName(BaseModel):
|
|
30
|
-
last_name:str = Field(..., max_length=50, description="User's last name")
|
|
31
|
-
|
|
32
|
-
class EndingTitle(BaseModel):
|
|
33
|
-
ending_title:BaseTypes.OptionalString = Field(None, max_length=25, description="User's ending title")
|
|
34
|
-
|
|
35
|
-
class FullName(BaseModel):
|
|
36
|
-
full_name:str = Field(..., max_length=200, description="User's full name")
|
|
37
|
-
|
|
38
|
-
class BirthPlace(BaseModel):
|
|
39
|
-
birth_place:BaseTypes.OptionalString = Field(None, max_length=50, description="User's birth place")
|
|
40
|
-
|
|
41
|
-
class BirthDate(BaseModel):
|
|
42
|
-
birth_date:BaseTypes.OptionalDate = Field(None, description="User's birth date")
|
|
43
|
-
|
|
44
|
-
class AvatarName(BaseModel):
|
|
45
|
-
avatar_name:str = Field(..., description="User's avatar's name")
|
|
46
|
-
|
|
47
|
-
class OptionalAvatarUrl(BaseModel):
|
|
48
|
-
avatar_url:BaseTypes.OptionalString = Field(None, description="Avatar's URL")
|
|
49
|
-
|
|
50
|
-
class OptionalAvatar(BaseModel):
|
|
51
|
-
avatar:Optional[bytes] = Field(None, description="Optional Avatar")
|
|
52
|
-
|
|
53
|
-
class OptionalAvatarName(BaseModel):
|
|
54
|
-
avatar_name:BaseTypes.OptionalString = Field(None, description="Optional avatar's name")
|
|
55
|
-
|
|
56
|
-
class OptionalAvatarContentType(BaseModel):
|
|
57
|
-
content_type:BaseTypes.OptionalString = Field(None, description="Optional avatar's content type")
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
from maleo_foundation.models.schemas.parameter import BaseParameterSchemas
|
|
4
|
-
from maleo_identity.enums.user_system_role import MaleoIdentityUserSystemRoleEnums
|
|
5
|
-
|
|
6
|
-
class MaleoIdentityUserSystemRoleSchemas:
|
|
7
|
-
class Expand(BaseParameterSchemas.Expand):
|
|
8
|
-
expand:Optional[List[MaleoIdentityUserSystemRoleEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from .organization import OrganizationsTable
|
|
3
|
-
from .organization_registration_code import OrganizationRegistrationCodesTable
|
|
4
|
-
from .organization_role import OrganizationRolesTable
|
|
5
|
-
from .user import UsersTable
|
|
6
|
-
from .user_profile import UserProfilesTable
|
|
7
|
-
from .user_system_role import UserSystemRolesTable
|
|
8
|
-
from .user_organization import UserOrganizationsTable
|
|
9
|
-
from .user_organization_role import UserOrganizationRolesTable
|
|
10
|
-
|
|
11
|
-
class MaleoIdentityTables:
|
|
12
|
-
Organization = OrganizationsTable
|
|
13
|
-
OrganizationRegistrationCode = OrganizationRegistrationCodesTable
|
|
14
|
-
OrganizationRole = OrganizationRolesTable
|
|
15
|
-
User = UsersTable
|
|
16
|
-
UserProfile = UserProfilesTable
|
|
17
|
-
UserSystemRole = UserSystemRolesTable
|
|
18
|
-
UserOrganization = UserOrganizationsTable
|
|
19
|
-
UserOrganizationRole = UserOrganizationRolesTable
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Column, ForeignKey
|
|
2
|
-
from sqlalchemy.orm import relationship
|
|
3
|
-
from sqlalchemy.types import Integer, String, Enum, UUID
|
|
4
|
-
from uuid import uuid4
|
|
5
|
-
from maleo_metadata.enums.organization_type import MaleoMetadataOrganizationTypeEnums
|
|
6
|
-
from maleo_identity.db import MaleoIdentityMetadataManager
|
|
7
|
-
from maleo_foundation.models.table import DataTable
|
|
8
|
-
|
|
9
|
-
class OrganizationsMixin:
|
|
10
|
-
organization_type = Column(
|
|
11
|
-
name="organization_type",
|
|
12
|
-
type_=Enum(MaleoMetadataOrganizationTypeEnums.OrganizationType, name="organization_type"),
|
|
13
|
-
default=MaleoMetadataOrganizationTypeEnums.OrganizationType.REGULAR,
|
|
14
|
-
nullable=False
|
|
15
|
-
)
|
|
16
|
-
parent_id = Column("parent_id", Integer, ForeignKey("organizations.id", ondelete="SET NULL", onupdate="CASCADE"))
|
|
17
|
-
key = Column(name="key", type_=String(255), unique=True, nullable=False)
|
|
18
|
-
name = Column(name="name", type_=String(255), nullable=False)
|
|
19
|
-
secret = Column(name="secret", type_=UUID, default=uuid4, unique=True, nullable=False)
|
|
20
|
-
|
|
21
|
-
class OrganizationsTable(
|
|
22
|
-
OrganizationsMixin,
|
|
23
|
-
DataTable,
|
|
24
|
-
MaleoIdentityMetadataManager.Base
|
|
25
|
-
):
|
|
26
|
-
__tablename__ = "organizations"
|
|
27
|
-
parent = relationship(
|
|
28
|
-
"OrganizationsTable",
|
|
29
|
-
remote_side="OrganizationsTable.id",
|
|
30
|
-
back_populates="children"
|
|
31
|
-
)
|
|
32
|
-
children = relationship(
|
|
33
|
-
"OrganizationsTable",
|
|
34
|
-
back_populates="parent",
|
|
35
|
-
cascade="all",
|
|
36
|
-
lazy="select",
|
|
37
|
-
foreign_keys="[OrganizationsTable.parent_id]",
|
|
38
|
-
order_by="OrganizationsTable.id"
|
|
39
|
-
)
|
|
40
|
-
registration_code = relationship(
|
|
41
|
-
"OrganizationRegistrationCodesTable",
|
|
42
|
-
back_populates="organization",
|
|
43
|
-
cascade="all",
|
|
44
|
-
lazy="select",
|
|
45
|
-
uselist=False
|
|
46
|
-
)
|
|
47
|
-
user_organization = relationship(
|
|
48
|
-
"UserOrganizationsTable",
|
|
49
|
-
back_populates="organization",
|
|
50
|
-
cascade="all, delete-orphan",
|
|
51
|
-
uselist=False
|
|
52
|
-
)
|
|
53
|
-
organization_roles = relationship(
|
|
54
|
-
"OrganizationRolesTable",
|
|
55
|
-
back_populates="organization",
|
|
56
|
-
cascade="all, delete-orphan",
|
|
57
|
-
uselist=False
|
|
58
|
-
)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Column, ForeignKey
|
|
2
|
-
from sqlalchemy.orm import relationship
|
|
3
|
-
from sqlalchemy.types import Integer, UUID
|
|
4
|
-
from uuid import uuid4
|
|
5
|
-
from maleo_identity.db import MaleoIdentityMetadataManager
|
|
6
|
-
from maleo_foundation.models.table import DataTable
|
|
7
|
-
|
|
8
|
-
class OrganizationRegistrationCodesMixin:
|
|
9
|
-
#* Foreign Key OrganizationsTable
|
|
10
|
-
organization_id = Column(
|
|
11
|
-
Integer,
|
|
12
|
-
ForeignKey(
|
|
13
|
-
"organizations.id",
|
|
14
|
-
ondelete="CASCADE",
|
|
15
|
-
onupdate="CASCADE"
|
|
16
|
-
),
|
|
17
|
-
unique=True,
|
|
18
|
-
nullable=False
|
|
19
|
-
)
|
|
20
|
-
code = Column(name="code", type_=UUID, default=uuid4, unique=True, nullable=False)
|
|
21
|
-
max_uses = Column(name="max_uses", type_=Integer, nullable=False, default=1)
|
|
22
|
-
current_uses = Column(name="current_uses", type_=Integer, nullable=False, default=0)
|
|
23
|
-
|
|
24
|
-
class OrganizationRegistrationCodesTable(
|
|
25
|
-
OrganizationRegistrationCodesMixin,
|
|
26
|
-
DataTable,
|
|
27
|
-
MaleoIdentityMetadataManager.Base
|
|
28
|
-
):
|
|
29
|
-
__tablename__ = "organization_registration_codes"
|
|
30
|
-
|
|
31
|
-
organization = relationship(
|
|
32
|
-
"OrganizationsTable",
|
|
33
|
-
back_populates="registration_code",
|
|
34
|
-
cascade="all",
|
|
35
|
-
lazy="select",
|
|
36
|
-
uselist=False
|
|
37
|
-
)
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Column, ForeignKey
|
|
2
|
-
from sqlalchemy.orm import relationship
|
|
3
|
-
from sqlalchemy.types import Integer, String, Boolean
|
|
4
|
-
from maleo_identity.db import MaleoIdentityMetadataManager
|
|
5
|
-
from maleo_foundation.models.table import DataTable
|
|
6
|
-
|
|
7
|
-
class OrganizationRolesMixin:
|
|
8
|
-
#* Foreign Key OrganizationsTable
|
|
9
|
-
organization_id = Column(
|
|
10
|
-
Integer,
|
|
11
|
-
ForeignKey(
|
|
12
|
-
"organizations.id",
|
|
13
|
-
ondelete="CASCADE",
|
|
14
|
-
onupdate="CASCADE"
|
|
15
|
-
),
|
|
16
|
-
nullable=False
|
|
17
|
-
)
|
|
18
|
-
is_default = Column(name="is_default", type_=Boolean, nullable=False, default=False)
|
|
19
|
-
order = Column(name="order", type_=Integer)
|
|
20
|
-
key = Column(name="key", type_=String(50), nullable=False)
|
|
21
|
-
name = Column(name="name", type_=String(50), nullable=False)
|
|
22
|
-
|
|
23
|
-
class OrganizationRolesTable(
|
|
24
|
-
OrganizationRolesMixin,
|
|
25
|
-
DataTable,
|
|
26
|
-
MaleoIdentityMetadataManager.Base
|
|
27
|
-
):
|
|
28
|
-
__tablename__ = "organization_roles"
|
|
29
|
-
|
|
30
|
-
organization = relationship(
|
|
31
|
-
"OrganizationsTable",
|
|
32
|
-
back_populates="organization_roles",
|
|
33
|
-
cascade="all",
|
|
34
|
-
lazy="select",
|
|
35
|
-
uselist=False
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
user_organization_roles = relationship(
|
|
39
|
-
"UserOrganizationRolesTable",
|
|
40
|
-
back_populates="organization_role",
|
|
41
|
-
cascade="all, delete-orphan",
|
|
42
|
-
lazy="select"
|
|
43
|
-
)
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Column
|
|
2
|
-
from sqlalchemy.orm import relationship
|
|
3
|
-
from sqlalchemy.types import String, Enum
|
|
4
|
-
from maleo_metadata.enums.user_type import MaleoMetadataUserTypeEnums
|
|
5
|
-
from maleo_identity.db import MaleoIdentityMetadataManager
|
|
6
|
-
from maleo_foundation.models.table import DataTable
|
|
7
|
-
|
|
8
|
-
class UsersMixin:
|
|
9
|
-
user_type = Column(
|
|
10
|
-
name="user_type",
|
|
11
|
-
type_=Enum(MaleoMetadataUserTypeEnums.UserType, name="user_type"),
|
|
12
|
-
default=MaleoMetadataUserTypeEnums.UserType.REGULAR,
|
|
13
|
-
nullable=False
|
|
14
|
-
)
|
|
15
|
-
username = Column(name="username", type_=String(50), unique=True, nullable=False)
|
|
16
|
-
email = Column(name="email", type_=String(255), unique=True, nullable=False)
|
|
17
|
-
phone = Column(name="phone", type_=String(15), nullable=False)
|
|
18
|
-
password = Column(name="password", type_=String(255), nullable=False)
|
|
19
|
-
|
|
20
|
-
class UsersTable(
|
|
21
|
-
UsersMixin,
|
|
22
|
-
DataTable,
|
|
23
|
-
MaleoIdentityMetadataManager.Base
|
|
24
|
-
):
|
|
25
|
-
__tablename__ = "users"
|
|
26
|
-
|
|
27
|
-
profile = relationship(
|
|
28
|
-
"UserProfilesTable",
|
|
29
|
-
back_populates="user",
|
|
30
|
-
uselist=False,
|
|
31
|
-
cascade="all, delete-orphan"
|
|
32
|
-
)
|
|
33
|
-
system_roles = relationship(
|
|
34
|
-
"UserSystemRolesTable",
|
|
35
|
-
back_populates="user",
|
|
36
|
-
cascade="all, delete-orphan"
|
|
37
|
-
)
|
|
38
|
-
user_organization = relationship(
|
|
39
|
-
"UserOrganizationsTable",
|
|
40
|
-
back_populates="user",
|
|
41
|
-
cascade="all, delete-orphan",
|
|
42
|
-
uselist=False
|
|
43
|
-
)
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Column, ForeignKey
|
|
2
|
-
from sqlalchemy.orm import relationship
|
|
3
|
-
from sqlalchemy.types import Integer
|
|
4
|
-
from maleo_identity.db import MaleoIdentityMetadataManager
|
|
5
|
-
from maleo_foundation.models.table import DataTable
|
|
6
|
-
|
|
7
|
-
class UserOrganizationsMixin:
|
|
8
|
-
#* Foreign Key UsersTable
|
|
9
|
-
user_id = Column(
|
|
10
|
-
Integer,
|
|
11
|
-
ForeignKey(
|
|
12
|
-
"users.id",
|
|
13
|
-
ondelete="CASCADE",
|
|
14
|
-
onupdate="CASCADE"
|
|
15
|
-
),
|
|
16
|
-
nullable=False
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
#* Foreign Key OrganizationsTable
|
|
20
|
-
organization_id = Column(
|
|
21
|
-
Integer,
|
|
22
|
-
ForeignKey(
|
|
23
|
-
"organizations.id",
|
|
24
|
-
ondelete="CASCADE",
|
|
25
|
-
onupdate="CASCADE"
|
|
26
|
-
),
|
|
27
|
-
nullable=False
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
class UserOrganizationsTable(
|
|
31
|
-
UserOrganizationsMixin,
|
|
32
|
-
DataTable,
|
|
33
|
-
MaleoIdentityMetadataManager.Base
|
|
34
|
-
):
|
|
35
|
-
__tablename__ = "user_organizations"
|
|
36
|
-
|
|
37
|
-
user = relationship(
|
|
38
|
-
"UsersTable",
|
|
39
|
-
back_populates="user_organization",
|
|
40
|
-
cascade="all",
|
|
41
|
-
lazy="select",
|
|
42
|
-
uselist=False
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
organization = relationship(
|
|
46
|
-
"OrganizationsTable",
|
|
47
|
-
back_populates="user_organization",
|
|
48
|
-
cascade="all",
|
|
49
|
-
lazy="select",
|
|
50
|
-
uselist=False
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
user_organization_roles = relationship(
|
|
54
|
-
"UserOrganizationRolesTable",
|
|
55
|
-
back_populates="user_organization",
|
|
56
|
-
cascade="all, delete-orphan",
|
|
57
|
-
lazy="select"
|
|
58
|
-
)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Column, ForeignKey
|
|
2
|
-
from sqlalchemy.orm import relationship
|
|
3
|
-
from sqlalchemy.types import Integer
|
|
4
|
-
from maleo_identity.db import MaleoIdentityMetadataManager
|
|
5
|
-
from maleo_foundation.models.table import DataTable
|
|
6
|
-
|
|
7
|
-
class UserOrganizationRolesMixin:
|
|
8
|
-
#* Foreign Key UserOrganizationsTable
|
|
9
|
-
user_organization_id = Column(
|
|
10
|
-
Integer,
|
|
11
|
-
ForeignKey(
|
|
12
|
-
"user_organizations.id",
|
|
13
|
-
ondelete="CASCADE",
|
|
14
|
-
onupdate="CASCADE"
|
|
15
|
-
),
|
|
16
|
-
nullable=False
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
#* Foreign Key OrganizationRolesTable
|
|
20
|
-
organization_role_id = Column(
|
|
21
|
-
Integer,
|
|
22
|
-
ForeignKey(
|
|
23
|
-
"organization_roles.id",
|
|
24
|
-
ondelete="CASCADE",
|
|
25
|
-
onupdate="CASCADE"
|
|
26
|
-
),
|
|
27
|
-
nullable=False
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
class UserOrganizationRolesTable(
|
|
31
|
-
UserOrganizationRolesMixin,
|
|
32
|
-
DataTable,
|
|
33
|
-
MaleoIdentityMetadataManager.Base
|
|
34
|
-
):
|
|
35
|
-
__tablename__ = "user_organization_roles"
|
|
36
|
-
|
|
37
|
-
user_organization = relationship(
|
|
38
|
-
"UserOrganizationsTable",
|
|
39
|
-
back_populates="user_organization_roles",
|
|
40
|
-
cascade="all",
|
|
41
|
-
lazy="select",
|
|
42
|
-
uselist=False
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
user = relationship(
|
|
46
|
-
"UsersTable",
|
|
47
|
-
secondary="user_organizations",
|
|
48
|
-
primaryjoin="UserOrganizationRolesTable.user_organization_id == UserOrganizationsTable.id",
|
|
49
|
-
secondaryjoin="UserOrganizationsTable.user_id == UsersTable.id",
|
|
50
|
-
uselist=False,
|
|
51
|
-
viewonly=True
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
organization = relationship(
|
|
55
|
-
"OrganizationsTable",
|
|
56
|
-
secondary="user_organizations",
|
|
57
|
-
primaryjoin="UserOrganizationRolesTable.user_organization_id == UserOrganizationsTable.id",
|
|
58
|
-
secondaryjoin="UserOrganizationsTable.organization_id == OrganizationsTable.id",
|
|
59
|
-
uselist=False,
|
|
60
|
-
viewonly=True
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
organization_role = relationship(
|
|
64
|
-
"OrganizationRolesTable",
|
|
65
|
-
back_populates="user_organization_roles",
|
|
66
|
-
cascade="all",
|
|
67
|
-
lazy="select",
|
|
68
|
-
uselist=False
|
|
69
|
-
)
|