diff --git a/libreforms_fastapi/utils/sqlalchemy_models.py b/libreforms_fastapi/utils/sqlalchemy_models.py index 594fedc..774fd4f 100644 --- a/libreforms_fastapi/utils/sqlalchemy_models.py +++ b/libreforms_fastapi/utils/sqlalchemy_models.py @@ -9,6 +9,7 @@ Integer, String, DateTime, + JSON, ) from sqlalchemy.orm import relationship, declarative_base @@ -68,6 +69,14 @@ class Group(Base): name = Column(String(1000), unique=True) permissions = Column(JSON) +# Allow custom approval chains to be defined here +class ApprovalChains(Base): + __tablename__ = 'approval_chains' + id = Column(Integer, primary_key=True) + form_name = Column(String(1000)) + apply_to_single_group = Column(String(100), nullable=True) # Maybe we allow admins to route approvals based on the group of the sender... + send_to_users_manager = Column(Boolean) # I think that this is probably going to be difficult to implement ... + # Create a custom Signing class from sqlalchemy_signing Signing = create_signing_class(Base, tz_aware_datetime) \ No newline at end of file