mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 16:11:13 -05:00
Add ReviewEvent model and ReviewSubmissionService for review management
- Created a new ReviewEvent model to track review events with fields for content, rating, moderation status, and timestamps. - Added ForeignKey relationships to connect ReviewEvent with ContentSubmission, User, and Review. - Implemented ReviewSubmissionService to handle review submissions, including creation, updates, and moderation workflows. - Introduced atomic transactions to ensure data integrity during review submissions and updates. - Added logging for review submission and moderation actions for better traceability. - Implemented validation to prevent duplicate reviews and ensure only the review owner can update their review.
This commit is contained in:
@@ -467,58 +467,6 @@ class SubmissionListOut(BaseModel):
|
||||
total_pages: int
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Versioning Schemas
|
||||
# ============================================================================
|
||||
|
||||
class EntityVersionSchema(TimestampSchema):
|
||||
"""Schema for entity version output."""
|
||||
id: UUID
|
||||
entity_type: str
|
||||
entity_id: UUID
|
||||
entity_name: str
|
||||
version_number: int
|
||||
change_type: str
|
||||
snapshot: dict
|
||||
changed_fields: dict
|
||||
changed_by_id: Optional[UUID] = None
|
||||
changed_by_email: Optional[str] = None
|
||||
submission_id: Optional[UUID] = None
|
||||
comment: Optional[str] = None
|
||||
diff_summary: str
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class VersionHistoryResponseSchema(BaseModel):
|
||||
"""Response schema for version history."""
|
||||
entity_id: str
|
||||
entity_type: str
|
||||
entity_name: str
|
||||
total_versions: int
|
||||
versions: List[EntityVersionSchema]
|
||||
|
||||
|
||||
class VersionDiffSchema(BaseModel):
|
||||
"""Schema for version diff response."""
|
||||
entity_id: str
|
||||
entity_type: str
|
||||
entity_name: str
|
||||
version_number: int
|
||||
version_date: datetime
|
||||
differences: dict
|
||||
changed_field_count: int
|
||||
|
||||
|
||||
class VersionComparisonSchema(BaseModel):
|
||||
"""Schema for comparing two versions."""
|
||||
version1: EntityVersionSchema
|
||||
version2: EntityVersionSchema
|
||||
differences: dict
|
||||
changed_field_count: int
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Generic Utility Schemas
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user