Journaling for all flights
This commit is contained in:
28
backend/app/schemas/journal.py
Normal file
28
backend/app/schemas/journal.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class JournalEntryResponse(BaseModel):
|
||||
"""Read-only schema for journal entries"""
|
||||
id: int
|
||||
entity_type: str # PPR, LOCAL_FLIGHT, ARRIVAL, DEPARTURE
|
||||
entity_id: int
|
||||
entry: str
|
||||
user: str
|
||||
ip: Optional[str]
|
||||
entry_dt: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class EntityJournalResponse(BaseModel):
|
||||
"""Response containing all journal entries for an entity"""
|
||||
entity_type: str
|
||||
entity_id: int
|
||||
entries: list[JournalEntryResponse]
|
||||
total_entries: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user