Removed redundant size_field in webhook_requests

This commit is contained in:
Jonas Linter
2025-11-25 20:20:06 +01:00
parent 7b010ce65e
commit 556eef529a
2 changed files with 7 additions and 5 deletions

View File

@@ -4,6 +4,8 @@ import os
from collections.abc import AsyncGenerator, Callable
from typing import TypeVar
from .const import WebhookStatus
from sqlalchemy import (
JSON,
Boolean,
@@ -751,8 +753,8 @@ class WebhookRequest(Base):
hotel_id = Column(String(50), ForeignKey("hotels.hotel_id"), nullable=True, index=True)
# Processing tracking
status = Column(String(20), nullable=False, default='pending', index=True)
# Status values: 'pending', 'processing', 'completed', 'failed'
status = Column(String(20), nullable=False, default=WebhookStatus.PENDING.value, index=True)
# Status values: 'pending', 'processing', 'completed', 'failed' set by Enum WebhookStatus
processing_started_at = Column(DateTime(timezone=True), nullable=True)
processing_completed_at = Column(DateTime(timezone=True), nullable=True)
@@ -763,7 +765,6 @@ class WebhookRequest(Base):
# Payload storage
payload_json = Column(JSON, nullable=True) # NULL after purge, kept for retries
payload_size_bytes = Column(Integer, nullable=True) # Track original size
purged_at = Column(DateTime(timezone=True), nullable=True) # When JSON was purged
# Metadata