maleo-foundation 0.0.61__tar.gz → 0.0.62__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/PKG-INFO +1 -1
  2. maleo_foundation-0.0.62/maleo_foundation/db/database.py +41 -0
  3. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation.egg-info/PKG-INFO +1 -1
  4. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/pyproject.toml +1 -1
  5. maleo_foundation-0.0.61/maleo_foundation/db/database.py +0 -41
  6. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/README.md +0 -0
  7. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/__init__.py +0 -0
  8. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/__init__.py +0 -0
  9. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/general/__init__.py +0 -0
  10. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/general/http.py +0 -0
  11. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/google/__init__.py +0 -0
  12. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/google/cloud/__init__.py +0 -0
  13. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/google/cloud/logging.py +0 -0
  14. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/google/cloud/secret.py +0 -0
  15. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/google/cloud/storage.py +0 -0
  16. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/utils/__init__.py +0 -0
  17. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/clients/utils/logger.py +0 -0
  18. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/constants.py +0 -0
  19. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/db/__init__.py +0 -0
  20. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/db/engine.py +0 -0
  21. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/db/session.py +0 -0
  22. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/enums.py +0 -0
  23. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/expanded_types/__init__.py +0 -0
  24. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/expanded_types/client.py +0 -0
  25. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/expanded_types/query.py +0 -0
  26. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/expanded_types/service.py +0 -0
  27. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/extended_types.py +0 -0
  28. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/middlewares/__init__.py +0 -0
  29. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/middlewares/base.py +0 -0
  30. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/middlewares/cors.py +0 -0
  31. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/__init__.py +0 -0
  32. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/responses.py +0 -0
  33. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/schemas/__init__.py +0 -0
  34. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/schemas/general.py +0 -0
  35. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/schemas/parameter.py +0 -0
  36. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/schemas/result.py +0 -0
  37. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/__init__.py +0 -0
  38. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
  39. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/parameters/client.py +0 -0
  40. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/parameters/general.py +0 -0
  41. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/parameters/service.py +0 -0
  42. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/__init__.py +0 -0
  43. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
  44. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
  45. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
  46. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/client/service.py +0 -0
  47. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
  48. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
  49. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
  50. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/service/general.py +0 -0
  51. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/models/transfers/results/service/query.py +0 -0
  52. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/types.py +0 -0
  53. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/utils/__init__.py +0 -0
  54. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/utils/controller.py +0 -0
  55. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/utils/exceptions.py +0 -0
  56. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/utils/formatter/__init__.py +0 -0
  57. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/utils/formatter/case.py +0 -0
  58. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/utils/logger.py +0 -0
  59. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation/utils/query.py +0 -0
  60. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation.egg-info/SOURCES.txt +0 -0
  61. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation.egg-info/dependency_links.txt +0 -0
  62. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation.egg-info/requires.txt +0 -0
  63. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/maleo_foundation.egg-info/top_level.txt +0 -0
  64. {maleo_foundation-0.0.61 → maleo_foundation-0.0.62}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.0.61
3
+ Version: 0.0.62
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -0,0 +1,41 @@
1
+ from sqlalchemy import Engine, MetaData, Column, Integer, UUID, TIMESTAMP, Enum, func
2
+ from sqlalchemy.ext.declarative import DeclarativeMeta
3
+ from sqlalchemy.orm import declarative_base, declared_attr
4
+ from uuid import uuid4
5
+ from maleo_foundation.enums import BaseEnums
6
+ from maleo_foundation.utils.formatter.case import CaseFormatter
7
+
8
+ class BaseMixin:
9
+ __abstract__ = True
10
+
11
+ @declared_attr
12
+ def __tablename__(cls) -> str:
13
+ return CaseFormatter.to_snake_case(cls.__name__)
14
+
15
+ #* ----- ----- Common columns definition ----- ----- *#
16
+
17
+ #* Identifiers
18
+ id = Column(Integer, primary_key=True)
19
+ uuid = Column(UUID, default=uuid4, unique=True, nullable=False)
20
+
21
+ #* Timestamps
22
+ created_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
23
+ updated_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), onupdate=func.now(), nullable=False)
24
+ deleted_at = Column(TIMESTAMP(timezone=True))
25
+ restored_at = Column(TIMESTAMP(timezone=True))
26
+ deactivated_at = Column(TIMESTAMP(timezone=True))
27
+ activated_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
28
+
29
+ #* Statuses
30
+ status = Column(Enum(BaseEnums.StatusType, name="statustype"), default=BaseEnums.StatusType.ACTIVE, nullable=False)
31
+
32
+ class DatabaseManager:
33
+ Base:DeclarativeMeta = declarative_base() #* Correct way to define a declarative base
34
+
35
+ #* Explicitly define the type of metadata
36
+ metadata:MetaData = Base.metadata
37
+
38
+ @classmethod
39
+ def initialize(cls, engine:Engine):
40
+ """Creates the database tables if they do not exist."""
41
+ cls.metadata.create_all(engine)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.0.61
3
+ Version: 0.0.62
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo_foundation"
7
- version = "0.0.61"
7
+ version = "0.0.62"
8
8
  description = "Foundation package for Maleo"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
@@ -1,41 +0,0 @@
1
- from sqlalchemy import Engine, MetaData, Column, Integer, UUID, TIMESTAMP, Enum, func
2
- from sqlalchemy.ext.declarative import DeclarativeMeta
3
- from sqlalchemy.orm import declarative_base, declared_attr
4
- from uuid import uuid4
5
- from maleo_foundation.enums import BaseEnums
6
- from maleo_foundation.utils.formatter.case import CaseFormatter
7
-
8
- class DatabaseManager:
9
- class BaseMixin:
10
- __abstract__ = True
11
-
12
- @declared_attr
13
- def __tablename__(cls) -> str:
14
- return CaseFormatter.to_snake_case(cls.__name__)
15
-
16
- #* ----- ----- Common columns definition ----- ----- *#
17
-
18
- #* Identifiers
19
- id = Column(Integer, primary_key=True)
20
- uuid = Column(UUID, default=uuid4, unique=True, nullable=False)
21
-
22
- #* Timestamps
23
- created_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
24
- updated_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), onupdate=func.now(), nullable=False)
25
- deleted_at = Column(TIMESTAMP(timezone=True))
26
- restored_at = Column(TIMESTAMP(timezone=True))
27
- deactivated_at = Column(TIMESTAMP(timezone=True))
28
- activated_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
29
-
30
- #* Statuses
31
- status = Column(Enum(BaseEnums.StatusType, name="statustype"), default=BaseEnums.StatusType.ACTIVE, nullable=False)
32
-
33
- Base:DeclarativeMeta = declarative_base() #* Correct way to define a declarative base
34
-
35
- #* Explicitly define the type of metadata
36
- metadata:MetaData = Base.metadata
37
-
38
- @classmethod
39
- def initialize(cls, engine:Engine):
40
- """Creates the database tables if they do not exist."""
41
- cls.metadata.create_all(engine)