maleo-identity 0.0.1__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.

Files changed (113) hide show
  1. maleo_identity/__init__.py +0 -0
  2. maleo_identity/client/__init__.py +0 -0
  3. maleo_identity/client/controllers/__init__.py +15 -0
  4. maleo_identity/client/controllers/http/__init__.py +0 -0
  5. maleo_identity/client/controllers/http/organization.py +76 -0
  6. maleo_identity/client/controllers/http/user.py +76 -0
  7. maleo_identity/client/manager.py +56 -0
  8. maleo_identity/client/services/__init__.py +9 -0
  9. maleo_identity/client/services/organization.py +148 -0
  10. maleo_identity/client/services/user.py +148 -0
  11. maleo_identity/constants/__init__.py +13 -0
  12. maleo_identity/constants/organization.py +13 -0
  13. maleo_identity/constants/user.py +34 -0
  14. maleo_identity/constants/user_organization.py +31 -0
  15. maleo_identity/constants/user_profile.py +11 -0
  16. maleo_identity/constants/user_system_role.py +20 -0
  17. maleo_identity/db.py +6 -0
  18. maleo_identity/enums/__init__.py +15 -0
  19. maleo_identity/enums/general.py +5 -0
  20. maleo_identity/enums/organization.py +10 -0
  21. maleo_identity/enums/user.py +15 -0
  22. maleo_identity/enums/user_organization.py +8 -0
  23. maleo_identity/enums/user_profile.py +10 -0
  24. maleo_identity/enums/user_system_role.py +7 -0
  25. maleo_identity/models/__init__.py +9 -0
  26. maleo_identity/models/responses/__init__.py +13 -0
  27. maleo_identity/models/responses/organization.py +46 -0
  28. maleo_identity/models/responses/user.py +46 -0
  29. maleo_identity/models/responses/user_organization.py +25 -0
  30. maleo_identity/models/responses/user_profile.py +46 -0
  31. maleo_identity/models/responses/user_system_role.py +25 -0
  32. maleo_identity/models/schemas/__init__.py +9 -0
  33. maleo_identity/models/schemas/general/__init__.py +13 -0
  34. maleo_identity/models/schemas/general/organization.py +24 -0
  35. maleo_identity/models/schemas/general/user.py +22 -0
  36. maleo_identity/models/schemas/general/user_organization.py +20 -0
  37. maleo_identity/models/schemas/general/user_profile.py +44 -0
  38. maleo_identity/models/schemas/general/user_system_role.py +14 -0
  39. maleo_identity/models/schemas/parameters/__init__.py +13 -0
  40. maleo_identity/models/schemas/parameters/organization.py +10 -0
  41. maleo_identity/models/schemas/parameters/user.py +15 -0
  42. maleo_identity/models/schemas/parameters/user_organization.py +7 -0
  43. maleo_identity/models/schemas/parameters/user_profile.py +22 -0
  44. maleo_identity/models/schemas/parameters/user_system_role.py +8 -0
  45. maleo_identity/models/schemas/results/__init__.py +13 -0
  46. maleo_identity/models/schemas/results/organization.py +18 -0
  47. maleo_identity/models/schemas/results/user.py +18 -0
  48. maleo_identity/models/schemas/results/user_organization.py +7 -0
  49. maleo_identity/models/schemas/results/user_profile.py +34 -0
  50. maleo_identity/models/schemas/results/user_system_role.py +8 -0
  51. maleo_identity/models/tables/__init__.py +13 -0
  52. maleo_identity/models/tables/organization.py +18 -0
  53. maleo_identity/models/tables/user.py +17 -0
  54. maleo_identity/models/tables/user_organization.py +10 -0
  55. maleo_identity/models/tables/user_profile.py +21 -0
  56. maleo_identity/models/tables/user_system_role.py +15 -0
  57. maleo_identity/models/transfers/__init__.py +9 -0
  58. maleo_identity/models/transfers/general/__init__.py +13 -0
  59. maleo_identity/models/transfers/general/organization.py +24 -0
  60. maleo_identity/models/transfers/general/user.py +16 -0
  61. maleo_identity/models/transfers/general/user_organization.py +13 -0
  62. maleo_identity/models/transfers/general/user_profile.py +14 -0
  63. maleo_identity/models/transfers/general/user_system_role.py +13 -0
  64. maleo_identity/models/transfers/parameters/__init__.py +9 -0
  65. maleo_identity/models/transfers/parameters/client/__init__.py +13 -0
  66. maleo_identity/models/transfers/parameters/client/organization.py +19 -0
  67. maleo_identity/models/transfers/parameters/client/user.py +23 -0
  68. maleo_identity/models/transfers/parameters/client/user_organization.py +32 -0
  69. maleo_identity/models/transfers/parameters/client/user_profile.py +22 -0
  70. maleo_identity/models/transfers/parameters/client/user_system_role.py +26 -0
  71. maleo_identity/models/transfers/parameters/general/__init__.py +13 -0
  72. maleo_identity/models/transfers/parameters/general/organization.py +30 -0
  73. maleo_identity/models/transfers/parameters/general/user.py +35 -0
  74. maleo_identity/models/transfers/parameters/general/user_organization.py +31 -0
  75. maleo_identity/models/transfers/parameters/general/user_profile.py +35 -0
  76. maleo_identity/models/transfers/parameters/general/user_system_role.py +25 -0
  77. maleo_identity/models/transfers/parameters/service/__init__.py +13 -0
  78. maleo_identity/models/transfers/parameters/service/organization.py +19 -0
  79. maleo_identity/models/transfers/parameters/service/user.py +23 -0
  80. maleo_identity/models/transfers/parameters/service/user_organization.py +30 -0
  81. maleo_identity/models/transfers/parameters/service/user_profile.py +22 -0
  82. maleo_identity/models/transfers/parameters/service/user_system_role.py +25 -0
  83. maleo_identity/models/transfers/results/__init__.py +7 -0
  84. maleo_identity/models/transfers/results/general/__init__.py +13 -0
  85. maleo_identity/models/transfers/results/general/organization.py +15 -0
  86. maleo_identity/models/transfers/results/general/user.py +15 -0
  87. maleo_identity/models/transfers/results/general/user_organization.py +15 -0
  88. maleo_identity/models/transfers/results/general/user_profile.py +15 -0
  89. maleo_identity/models/transfers/results/general/user_system_role.py +15 -0
  90. maleo_identity/models/transfers/results/query/__init__.py +13 -0
  91. maleo_identity/models/transfers/results/query/organization.py +19 -0
  92. maleo_identity/models/transfers/results/query/user.py +19 -0
  93. maleo_identity/models/transfers/results/query/user_organization.py +19 -0
  94. maleo_identity/models/transfers/results/query/user_profile.py +19 -0
  95. maleo_identity/models/transfers/results/query/user_system_role.py +19 -0
  96. maleo_identity/types/__init__.py +5 -0
  97. maleo_identity/types/results/__init__.py +7 -0
  98. maleo_identity/types/results/general/__init__.py +13 -0
  99. maleo_identity/types/results/general/organization.py +20 -0
  100. maleo_identity/types/results/general/user.py +20 -0
  101. maleo_identity/types/results/general/user_organization.py +20 -0
  102. maleo_identity/types/results/general/user_profile.py +20 -0
  103. maleo_identity/types/results/general/user_system_role.py +20 -0
  104. maleo_identity/types/results/query/__init__.py +13 -0
  105. maleo_identity/types/results/query/organization.py +20 -0
  106. maleo_identity/types/results/query/user.py +20 -0
  107. maleo_identity/types/results/query/user_organization.py +20 -0
  108. maleo_identity/types/results/query/user_profile.py +20 -0
  109. maleo_identity/types/results/query/user_system_role.py +20 -0
  110. maleo_identity-0.0.1.dist-info/METADATA +39 -0
  111. maleo_identity-0.0.1.dist-info/RECORD +113 -0
  112. maleo_identity-0.0.1.dist-info/WHEEL +5 -0
  113. maleo_identity-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,20 @@
1
+ from typing import Dict, List
2
+ from maleo_identity.enums.user import MaleoIdentityUserEnums
3
+ from maleo_identity.enums.user_system_role import MaleoIdentityUserSystemRoleEnums
4
+
5
+ class MaleoIdentityUserSystemRoleConstants:
6
+ EXPANDABLE_FIELDS_DEPENDENCIES_MAP:Dict[
7
+ MaleoIdentityUserSystemRoleEnums.ExpandableFields,
8
+ List[MaleoIdentityUserSystemRoleEnums.ExpandableFields]
9
+ ] = {
10
+ MaleoIdentityUserSystemRoleEnums.ExpandableFields.USER: [
11
+ MaleoIdentityUserSystemRoleEnums.ExpandableFields.USER_TYPE
12
+ ]
13
+ }
14
+
15
+ USER_EXPANDABLE_FIELDS_MAP:Dict[
16
+ MaleoIdentityUserSystemRoleEnums.ExpandableFields,
17
+ MaleoIdentityUserEnums.ExpandableFields
18
+ ] = {
19
+ MaleoIdentityUserSystemRoleEnums.ExpandableFields.USER_TYPE: MaleoIdentityUserEnums.ExpandableFields.USER_TYPE
20
+ }
maleo_identity/db.py ADDED
@@ -0,0 +1,6 @@
1
+ from sqlalchemy.orm import declarative_base
2
+ from maleo_foundation.models.table import BaseTable
3
+ from maleo_foundation.managers.db import MetadataManager
4
+
5
+ class MaleoIdentityMetadataManager(MetadataManager):
6
+ Base = declarative_base(cls=BaseTable)
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+ from .general import MaleoIdentityGeneralEnums
3
+ from .user_profile import MaleoIdentityUserProfileEnums
4
+ from .user_system_role import MaleoIdentityUserSystemRoleEnums
5
+ from .user_organization import MaleoIdentityUserOrganizationEnums
6
+ from .organization import MaleoIdentityOrganizationEnums
7
+ from .user import MaleoIdentityUserEnums
8
+
9
+ class MaleoIdentityEnums:
10
+ General = MaleoIdentityGeneralEnums
11
+ UserProfile = MaleoIdentityUserProfileEnums
12
+ UserSystemRole = MaleoIdentityUserSystemRoleEnums
13
+ UserOrganization = MaleoIdentityUserOrganizationEnums
14
+ Organization = MaleoIdentityOrganizationEnums
15
+ User = MaleoIdentityUserEnums
@@ -0,0 +1,5 @@
1
+ from enum import StrEnum
2
+
3
+ class MaleoIdentityGeneralEnums:
4
+ class ClientControllerType(StrEnum):
5
+ HTTP = "http"
@@ -0,0 +1,10 @@
1
+ from enum import StrEnum
2
+
3
+ class MaleoIdentityOrganizationEnums:
4
+ class IdentifierType(StrEnum):
5
+ ID = "id"
6
+ UUID = "uuid"
7
+ KEY = "key"
8
+
9
+ class ExpandableFields(StrEnum):
10
+ ORGANIZATION_TYPE = "organization_type"
@@ -0,0 +1,15 @@
1
+ from enum import StrEnum
2
+
3
+ class MaleoIdentityUserEnums:
4
+ class IdentifierType(StrEnum):
5
+ ID = "id"
6
+ UUID = "uuid"
7
+ USERNAME = "username"
8
+ EMAIL = "email"
9
+ PHONE = "phone"
10
+
11
+ class ExpandableFields(StrEnum):
12
+ USER_TYPE = "user_type"
13
+ PROFILE = "profile"
14
+ GENDER = "profile.gender"
15
+ BLOOD_TYPE = "profile.blood_type"
@@ -0,0 +1,8 @@
1
+ from enum import StrEnum
2
+
3
+ class MaleoIdentityUserOrganizationEnums:
4
+ class ExpandableFields(StrEnum):
5
+ USER = "user"
6
+ USER_TYPE = "user.user_type"
7
+ ORGANIZATION = "organization"
8
+ ORGANIZATION_TYPE = "organization.organization_type"
@@ -0,0 +1,10 @@
1
+ from enum import StrEnum
2
+
3
+ class MaleoIdentityUserProfileEnums:
4
+ class IdentifierType(StrEnum):
5
+ USER_ID = "user_id"
6
+ ID_CARD = "id_card"
7
+
8
+ class ExpandableFields(StrEnum):
9
+ GENDER = "gender"
10
+ BLOOD_TYPE = "blood_type"
@@ -0,0 +1,7 @@
1
+ from enum import StrEnum
2
+
3
+ class MaleoIdentityUserSystemRoleEnums:
4
+ class ExpandableFields(StrEnum):
5
+ USER = "user"
6
+ USER_TYPE = "user.user_type"
7
+ SYSTEM_ROLE = "system_role"
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+ from .tables import MaleoIdentityTables
3
+ from .transfers import MaleoIdentityTransfers
4
+ from .responses import MaleoIdentityResponses
5
+
6
+ class MaleoIdentityModels:
7
+ Tables = MaleoIdentityTables
8
+ Transfers = MaleoIdentityTransfers
9
+ Responses = MaleoIdentityResponses
@@ -0,0 +1,13 @@
1
+ from __future__ import annotations
2
+ from .organization import MaleoIdentityOrganizationResponses
3
+ from .user import MaleoIdentityUserResponses
4
+ from .user_profile import MaleoIdentityUserProfileResponses
5
+ from .user_system_role import MaleoIdentityUserSystemRoleResponses
6
+ from .user_organization import MaleoIdentityUserOrganizationResponses
7
+
8
+ class MaleoIdentityResponses:
9
+ Organization = MaleoIdentityOrganizationResponses
10
+ User = MaleoIdentityUserResponses
11
+ UserProfile = MaleoIdentityUserProfileResponses
12
+ UserSystemRole = MaleoIdentityUserSystemRoleResponses
13
+ UserOrganization = MaleoIdentityUserOrganizationResponses
@@ -0,0 +1,46 @@
1
+ from pydantic import Field
2
+ from maleo_foundation.models.responses import BaseResponses
3
+ from maleo_identity.enums.organization import MaleoIdentityOrganizationEnums
4
+ from maleo_identity.models.transfers.general.organization import OrganizationTransfers
5
+
6
+ class MaleoIdentityOrganizationResponses:
7
+ class InvalidIdentifierType(BaseResponses.BadRequest):
8
+ code:str = "IDT-ORG-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 MaleoIdentityOrganizationEnums.IdentifierType]}"
12
+
13
+ class InvalidValueType(BaseResponses.BadRequest):
14
+ code:str = "IDT-ORG-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-ORG-003"
20
+ message:str = "Organization found"
21
+ description:str = "Requested organization found in database"
22
+ data:OrganizationTransfers = Field(..., description="Organization")
23
+
24
+ class GetMultiple(BaseResponses.PaginatedMultipleData):
25
+ code:str = "IDT-ORG-004"
26
+ message:str = "Organizations found"
27
+ description:str = "Requested organizations found in database"
28
+ data:list[OrganizationTransfers] = Field(..., description="Organizations")
29
+
30
+ class CreateFailed(BaseResponses.BadRequest):
31
+ code:str = "IDT-ORG-005"
32
+ message:str = "Failed creating new organization"
33
+
34
+ class CreateSuccess(BaseResponses.SingleData):
35
+ code:str = "IDT-ORG-006"
36
+ message:str = "Successfully created new organization"
37
+ data:OrganizationTransfers = Field(..., description="Organization")
38
+
39
+ class UpdateFailed(BaseResponses.BadRequest):
40
+ code:str = "IDT-ORG-007"
41
+ message:str = "Failed updating organization's data"
42
+
43
+ class UpdateSuccess(BaseResponses.SingleData):
44
+ code:str = "IDT-ORG-008"
45
+ message:str = "Successfully updated organization's data"
46
+ data:OrganizationTransfers = Field(..., description="Organization")
@@ -0,0 +1,46 @@
1
+ from pydantic import Field
2
+ from maleo_foundation.models.responses import BaseResponses
3
+ from maleo_identity.enums.user import MaleoIdentityUserEnums
4
+ from maleo_identity.models.transfers.general.user import UserTransfers
5
+
6
+ class MaleoIdentityUserResponses:
7
+ class InvalidIdentifierType(BaseResponses.BadRequest):
8
+ code:str = "IDT-USR-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 MaleoIdentityUserEnums.IdentifierType]}"
12
+
13
+ class InvalidValueType(BaseResponses.BadRequest):
14
+ code:str = "IDT-USR-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-USR-003"
20
+ message:str = "User found"
21
+ description:str = "Requested user found in database"
22
+ data:UserTransfers = Field(..., description="User")
23
+
24
+ class GetMultiple(BaseResponses.PaginatedMultipleData):
25
+ code:str = "IDT-USR-004"
26
+ message:str = "Users found"
27
+ description:str = "Requested users found in database"
28
+ data:list[UserTransfers] = Field(..., description="Users")
29
+
30
+ class CreateFailed(BaseResponses.BadRequest):
31
+ code:str = "IDT-USR-005"
32
+ message:str = "Failed creating new user"
33
+
34
+ class CreateSuccess(BaseResponses.SingleData):
35
+ code:str = "IDT-USR-006"
36
+ message:str = "Successfully created new user"
37
+ data:UserTransfers = Field(..., description="User")
38
+
39
+ class UpdateFailed(BaseResponses.BadRequest):
40
+ code:str = "IDT-USR-007"
41
+ message:str = "Failed updating user's data"
42
+
43
+ class UpdateSuccess(BaseResponses.SingleData):
44
+ code:str = "IDT-USR-008"
45
+ message:str = "Successfully updated user's data"
46
+ data:UserTransfers = Field(..., description="User")
@@ -0,0 +1,25 @@
1
+ from pydantic import Field
2
+ from maleo_foundation.models.responses import BaseResponses
3
+ from maleo_identity.models.transfers.general.user_organization import UserOrganizationTransfers
4
+
5
+ class MaleoIdentityUserOrganizationResponses:
6
+ class GetSingle(BaseResponses.SingleData):
7
+ code:str = "IDT-UOG-001"
8
+ message:str = "User organization found"
9
+ description:str = "Requested user organization found in database"
10
+ data:UserOrganizationTransfers = Field(..., description="User organization")
11
+
12
+ class GetMultiple(BaseResponses.PaginatedMultipleData):
13
+ code:str = "IDT-UOG-002"
14
+ message:str = "User organizations found"
15
+ description:str = "Requested user organizations found in database"
16
+ data:list[UserOrganizationTransfers] = Field(..., description="User organizations")
17
+
18
+ class CreateFailed(BaseResponses.BadRequest):
19
+ code:str = "IDT-UOG-003"
20
+ message:str = "Failed creating new user organization"
21
+
22
+ class CreateSuccess(BaseResponses.SingleData):
23
+ code:str = "IDT-UOG-004"
24
+ message:str = "Successfully created new user organization"
25
+ data:UserOrganizationTransfers = Field(..., description="User organization")
@@ -0,0 +1,46 @@
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")
@@ -0,0 +1,25 @@
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 CreateFailed(BaseResponses.BadRequest):
19
+ code:str = "IDT-URL-003"
20
+ message:str = "Failed creating new user system role"
21
+
22
+ class CreateSuccess(BaseResponses.SingleData):
23
+ code:str = "IDT-URL-004"
24
+ message:str = "Successfully created new user system role"
25
+ data:UserSystemRoleTransfers = Field(..., description="User system role")
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+ from .general import MaleoIdentityGeneralSchemas
3
+ from .parameters import MaleoIdentityParametersSchemas
4
+ from .results import MaleoIdentityResultsSchemas
5
+
6
+ class MaleoIdentitySchemas:
7
+ General = MaleoIdentityGeneralSchemas
8
+ Parameters = MaleoIdentityParametersSchemas
9
+ Results = MaleoIdentityResultsSchemas
@@ -0,0 +1,13 @@
1
+ from __future__ import annotations
2
+ from .organization import MaleoIdentityOrganizationGeneralSchemas
3
+ from .user import MaleoIdentityUserGeneralSchemas
4
+ from .user_profile import MaleoIdentityUserProfileGeneralSchemas
5
+ from .user_system_role import MaleoIdentityUserSystemRoleGeneralSchemas
6
+ from .user_organization import MaleoIdentityUserOrganizationGeneralSchemas
7
+
8
+ class MaleoIdentityGeneralSchemas:
9
+ Organization = MaleoIdentityOrganizationGeneralSchemas
10
+ User = MaleoIdentityUserGeneralSchemas
11
+ UserProfile = MaleoIdentityUserProfileGeneralSchemas
12
+ UserSystemRole = MaleoIdentityUserSystemRoleGeneralSchemas
13
+ UserOrganization = MaleoIdentityUserOrganizationGeneralSchemas
@@ -0,0 +1,24 @@
1
+ from pydantic import BaseModel, Field
2
+ from typing import Optional, List
3
+ from maleo_foundation.types import BaseTypes
4
+ from maleo_foundation.models.schemas.general import BaseGeneralSchemas
5
+ from maleo_identity.enums.organization import MaleoIdentityOrganizationEnums
6
+
7
+ class MaleoIdentityOrganizationGeneralSchemas:
8
+ class IdentifierType(BaseModel):
9
+ identifier:MaleoIdentityOrganizationEnums.IdentifierType = Field(..., description="Organization's identifier")
10
+
11
+ class Expand(BaseModel):
12
+ expand:Optional[List[MaleoIdentityOrganizationEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
13
+
14
+ class OptionalParentOrganizationId(BaseModel):
15
+ parent_organization_id:BaseTypes.OptionalInteger = Field(None, ge=1, description="Parent organization's Id")
16
+
17
+ class OptionalListOfParentOrganizationId(BaseModel):
18
+ parent_organization_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="Parent organization's Ids")
19
+
20
+ class Key(BaseGeneralSchemas.Key):
21
+ key:str = Field(..., max_length=255, description="Organization's key")
22
+
23
+ class Name(BaseGeneralSchemas.Name):
24
+ name:str = Field(..., max_length=255, description="Organization's name")
@@ -0,0 +1,22 @@
1
+ from pydantic import BaseModel, Field
2
+ from typing import Optional, List
3
+ from maleo_identity.enums.user import MaleoIdentityUserEnums
4
+
5
+ class MaleoIdentityUserGeneralSchemas:
6
+ class IdentifierType(BaseModel):
7
+ identifier:MaleoIdentityUserEnums.IdentifierType = Field(..., description="User's identifier")
8
+
9
+ class Expand(BaseModel):
10
+ expand:Optional[List[MaleoIdentityUserEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
11
+
12
+ class Username(BaseModel):
13
+ username:str = Field(..., max_length=50, description="User's username")
14
+
15
+ class Email(BaseModel):
16
+ email:str = Field(..., max_length=255, description="User's email")
17
+
18
+ class Phone(BaseModel):
19
+ phone:str = Field(..., max_length=15, description="User's username")
20
+
21
+ class Password(BaseModel):
22
+ password:str = Field(..., max_length=255, description="User's password")
@@ -0,0 +1,20 @@
1
+ from pydantic import BaseModel, Field
2
+ from typing import Optional, List
3
+ from maleo_foundation.types import BaseTypes
4
+ from maleo_identity.enums.user_organization import MaleoIdentityUserOrganizationEnums
5
+
6
+ class MaleoIdentityUserOrganizationGeneralSchemas:
7
+ class Expand(BaseModel):
8
+ expand:Optional[List[MaleoIdentityUserOrganizationEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
9
+
10
+ class UserId(BaseModel):
11
+ user_id:int = Field(..., ge=1, description="User's ID")
12
+
13
+ class OptionalListOfUserId(BaseModel):
14
+ user_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="User's IDs")
15
+
16
+ class OrganizationId(BaseModel):
17
+ organization_id:int = Field(..., ge=1, description="Organization's ID")
18
+
19
+ class OptionalListOfOrganizationId(BaseModel):
20
+ organization_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="Organization's IDs")
@@ -0,0 +1,44 @@
1
+ from pydantic import BaseModel, Field
2
+ from typing import Optional, List
3
+ from maleo_foundation.types import BaseTypes
4
+ from maleo_identity.enums.user_profile import MaleoIdentityUserProfileEnums
5
+
6
+ class MaleoIdentityUserProfileGeneralSchemas:
7
+ class IdentifierType(BaseModel):
8
+ identifier:MaleoIdentityUserProfileEnums.IdentifierType = Field(..., description="User profile's identifier")
9
+
10
+ class Expand(BaseModel):
11
+ expand:Optional[List[MaleoIdentityUserProfileEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
12
+
13
+ class UserId(BaseModel):
14
+ user_id:int = Field(..., ge=1, description="User's ID")
15
+
16
+ class OptionalListOfUserId(BaseModel):
17
+ user_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="User's IDs")
18
+
19
+ class IdCard(BaseModel):
20
+ id_card:str = Field(..., max_length=16, description="User's ID Card")
21
+
22
+ class LeadingTitle(BaseModel):
23
+ leading_title:BaseTypes.OptionalString = Field(None, max_length=25, description="User's leading title")
24
+
25
+ class FirstName(BaseModel):
26
+ first_name:str = Field(..., max_length=50, description="User's first name")
27
+
28
+ class MiddleName(BaseModel):
29
+ middle_name:BaseTypes.OptionalString = Field(None, max_length=50, description="User's middle name")
30
+
31
+ class LastName(BaseModel):
32
+ last_name:str = Field(..., max_length=50, description="User's last name")
33
+
34
+ class EndingTitle(BaseModel):
35
+ ending_title:BaseTypes.OptionalString = Field(None, max_length=25, description="User's ending title")
36
+
37
+ class FullName(BaseModel):
38
+ full_name:str = Field(..., max_length=200, description="User's full name")
39
+
40
+ class BirthPlace(BaseModel):
41
+ birth_place:BaseTypes.OptionalString = Field(None, max_length=50, description="User's birth place")
42
+
43
+ class BirthDate(BaseModel):
44
+ birth_date:BaseTypes.OptionalDate = Field(None, description="User's birth date")
@@ -0,0 +1,14 @@
1
+ from pydantic import BaseModel, Field
2
+ from typing import Optional, List
3
+ from maleo_foundation.types import BaseTypes
4
+ from maleo_identity.enums.user_system_role import MaleoIdentityUserSystemRoleEnums
5
+
6
+ class MaleoIdentityUserSystemRoleGeneralSchemas:
7
+ class Expand(BaseModel):
8
+ expand:Optional[List[MaleoIdentityUserSystemRoleEnums.ExpandableFields]] = Field(None, description="Expanded field(s)")
9
+
10
+ class UserId(BaseModel):
11
+ user_id:int = Field(..., ge=1, description="User's ID")
12
+
13
+ class OptionalListOfUserId(BaseModel):
14
+ user_ids:BaseTypes.OptionalListOfIntegers = Field(None, description="User's IDs")
@@ -0,0 +1,13 @@
1
+ from __future__ import annotations
2
+ from .organization import MaleoIdentityOrganizationParametersSchemas
3
+ from .user import MaleoIdentityUserParametersSchemas
4
+ from .user_profile import MaleoIdentityUserProfileParametersSchemas
5
+ from .user_system_role import MaleoIdentityUserSystemRoleParametersSchemas
6
+ from .user_organization import MaleoIdentityUserOrganizationParametersSchemas
7
+
8
+ class MaleoIdentityParametersSchemas:
9
+ Organization = MaleoIdentityOrganizationParametersSchemas
10
+ User = MaleoIdentityUserParametersSchemas
11
+ UserProfile = MaleoIdentityUserProfileParametersSchemas
12
+ UserSystemRole = MaleoIdentityUserSystemRoleParametersSchemas
13
+ UserOrganization = MaleoIdentityUserOrganizationParametersSchemas
@@ -0,0 +1,10 @@
1
+ from maleo_metadata.models.expanded_schemas.organization_type import MaleoMetadataOrganizationTypeExpandedSchemas
2
+ from maleo_identity.models.schemas.general.organization import MaleoIdentityOrganizationGeneralSchemas
3
+
4
+ class MaleoIdentityOrganizationParametersSchemas:
5
+ class Base(
6
+ MaleoIdentityOrganizationGeneralSchemas.Name,
7
+ MaleoIdentityOrganizationGeneralSchemas.Key,
8
+ MaleoIdentityOrganizationGeneralSchemas.OptionalParentOrganizationId,
9
+ MaleoMetadataOrganizationTypeExpandedSchemas.SimpleOrganizationType
10
+ ): pass
@@ -0,0 +1,15 @@
1
+ from maleo_metadata.models.expanded_schemas.user_type import MaleoMetadataUserTypeExpandedSchemas
2
+ from maleo_identity.models.schemas.general.user import MaleoIdentityUserGeneralSchemas
3
+
4
+ class MaleoIdentityUserParametersSchemas:
5
+ class Base(
6
+ MaleoIdentityUserGeneralSchemas.Phone,
7
+ MaleoIdentityUserGeneralSchemas.Email,
8
+ MaleoIdentityUserGeneralSchemas.Username,
9
+ MaleoMetadataUserTypeExpandedSchemas.SimpleUserType
10
+ ): pass
11
+
12
+ class Extended(
13
+ MaleoIdentityUserGeneralSchemas.Password,
14
+ Base
15
+ ): pass
@@ -0,0 +1,7 @@
1
+ from maleo_identity.models.schemas.general.user_organization import MaleoIdentityUserOrganizationGeneralSchemas
2
+
3
+ class MaleoIdentityUserOrganizationParametersSchemas:
4
+ class Base(
5
+ MaleoIdentityUserOrganizationGeneralSchemas.OrganizationId,
6
+ MaleoIdentityUserOrganizationGeneralSchemas.UserId
7
+ ): pass
@@ -0,0 +1,22 @@
1
+ from maleo_metadata.models.expanded_schemas.blood_type import MaleoMetadataBloodTypeExpandedSchemas
2
+ from maleo_metadata.models.expanded_schemas.gender import MaleoMetadataGenderExpandedSchemas
3
+ from maleo_identity.models.schemas.general.user_profile import MaleoIdentityUserProfileGeneralSchemas
4
+
5
+ class MaleoIdentityUserProfileParametersSchemas:
6
+ class Base(
7
+ MaleoMetadataGenderExpandedSchemas.OptionalSimpleGender,
8
+ MaleoMetadataBloodTypeExpandedSchemas.OptionalSimpleBloodType,
9
+ MaleoIdentityUserProfileGeneralSchemas.BirthDate,
10
+ MaleoIdentityUserProfileGeneralSchemas.BirthPlace,
11
+ MaleoIdentityUserProfileGeneralSchemas.EndingTitle,
12
+ MaleoIdentityUserProfileGeneralSchemas.LastName,
13
+ MaleoIdentityUserProfileGeneralSchemas.MiddleName,
14
+ MaleoIdentityUserProfileGeneralSchemas.FirstName,
15
+ MaleoIdentityUserProfileGeneralSchemas.LeadingTitle,
16
+ MaleoIdentityUserProfileGeneralSchemas.IdCard
17
+ ): pass
18
+
19
+ class Extended(
20
+ Base,
21
+ MaleoIdentityUserProfileGeneralSchemas.UserId
22
+ ): pass
@@ -0,0 +1,8 @@
1
+ from maleo_metadata.models.expanded_schemas.system_role import MaleoMetadataSystemRoleExpandedSchemas
2
+ from maleo_identity.models.schemas.general.user_system_role import MaleoIdentityUserSystemRoleGeneralSchemas
3
+
4
+ class MaleoIdentityUserSystemRoleParametersSchemas:
5
+ class Base(
6
+ MaleoMetadataSystemRoleExpandedSchemas.SimpleSystemRole,
7
+ MaleoIdentityUserSystemRoleGeneralSchemas.UserId
8
+ ): pass
@@ -0,0 +1,13 @@
1
+ from __future__ import annotations
2
+ from .organization import MaleoIdentityOrganizationResultsSchemas
3
+ from .user import MaleoIdentityUserResultsSchemas
4
+ from .user_profile import MaleoIdentityUserProfileResultsSchemas
5
+ from .user_system_role import MaleoIdentityUserSystemRoleResultsSchemas
6
+ from .user_organization import MaleoIdentityUserOrganizationResultsSchemas
7
+
8
+ class MaleoIdentityResultsSchemas:
9
+ Organization = MaleoIdentityOrganizationResultsSchemas
10
+ User = MaleoIdentityUserResultsSchemas
11
+ UserProfile = MaleoIdentityUserProfileResultsSchemas
12
+ UserSystemRole = MaleoIdentityUserSystemRoleResultsSchemas
13
+ UserOrganization = MaleoIdentityUserOrganizationResultsSchemas
@@ -0,0 +1,18 @@
1
+ from maleo_metadata.models.expanded_schemas.organization_type import MaleoMetadataOrganizationTypeExpandedSchemas
2
+ from maleo_identity.models.schemas.general.organization import MaleoIdentityOrganizationGeneralSchemas
3
+
4
+ class MaleoIdentityOrganizationResultsSchemas:
5
+ class General(
6
+ MaleoIdentityOrganizationGeneralSchemas.Name,
7
+ MaleoIdentityOrganizationGeneralSchemas.Key,
8
+ MaleoIdentityOrganizationGeneralSchemas.OptionalParentOrganizationId,
9
+ MaleoMetadataOrganizationTypeExpandedSchemas.OptionalExpandedOrganizationType,
10
+ MaleoMetadataOrganizationTypeExpandedSchemas.SimpleOrganizationType
11
+ ): pass
12
+
13
+ class Query(
14
+ MaleoIdentityOrganizationGeneralSchemas.Name,
15
+ MaleoIdentityOrganizationGeneralSchemas.Key,
16
+ MaleoIdentityOrganizationGeneralSchemas.OptionalParentOrganizationId,
17
+ MaleoMetadataOrganizationTypeExpandedSchemas.SimpleOrganizationType
18
+ ): pass
@@ -0,0 +1,18 @@
1
+ from maleo_metadata.models.expanded_schemas.user_type import MaleoMetadataUserTypeExpandedSchemas
2
+ from maleo_identity.models.schemas.general.user import MaleoIdentityUserGeneralSchemas
3
+
4
+ class MaleoIdentityUserResultsSchemas:
5
+ class General(
6
+ MaleoIdentityUserGeneralSchemas.Phone,
7
+ MaleoIdentityUserGeneralSchemas.Email,
8
+ MaleoIdentityUserGeneralSchemas.Username,
9
+ MaleoMetadataUserTypeExpandedSchemas.OptionalExpandedUserType,
10
+ MaleoMetadataUserTypeExpandedSchemas.SimpleUserType
11
+ ): pass
12
+
13
+ class Query(
14
+ MaleoIdentityUserGeneralSchemas.Phone,
15
+ MaleoIdentityUserGeneralSchemas.Email,
16
+ MaleoIdentityUserGeneralSchemas.Username,
17
+ MaleoMetadataUserTypeExpandedSchemas.SimpleUserType
18
+ ): pass
@@ -0,0 +1,7 @@
1
+ from maleo_identity.models.schemas.general.user_organization import MaleoIdentityUserOrganizationGeneralSchemas
2
+
3
+ class MaleoIdentityUserOrganizationResultsSchemas:
4
+ class Base(
5
+ MaleoIdentityUserOrganizationGeneralSchemas.OrganizationId,
6
+ MaleoIdentityUserOrganizationGeneralSchemas.UserId
7
+ ): pass