feat: added logging API

This commit is contained in:
2024-10-10 16:47:15 +02:00
parent c79b5e5c5b
commit b95e40b40d
5 changed files with 130 additions and 6 deletions

View File

@@ -23,11 +23,15 @@ class LogEntry(Base):
application = Column(
UUID(as_uuid=True), ForeignKey("application.id", ondelete="CASCADE"), nullable=False
)
t_type = Column(Enum(TransactionType), nullable=False, default=TransactionType.UNDEFINED)
# type of the log entry
l_type = Column(Enum(LogType), nullable=False, default=LogType.INFO)
# type of the transaction
t_type = Column(Enum(TransactionType), nullable=False, default=TransactionType.UNDEFINED)
# a custom logmessage
message = Column(String(512), nullable=True)
# author ID i.e. auth0 user sub
author = Column(String(512), nullable=False, default="system")
# optional reference to the object (like object ID)
object_reference = Column(String(512), nullable=True)
# for irreversible operations, store the object state before the operation
previous_object = Column(JSON, nullable=True)