23 lines
945 B
Python
23 lines
945 B
Python
def serialize_history(row, actor_name=None, organizer_email=None, attendee_emails=None) -> dict:
|
|
return {
|
|
"id": str(row.id),
|
|
"user_id": str(row.user_id) if row.user_id else None,
|
|
"inbox_id": row.inbox_id,
|
|
"manual_upload_candidate_id": (
|
|
str(row.manual_upload_candidate_id) if row.manual_upload_candidate_id else None
|
|
),
|
|
"event_type": row.event_type,
|
|
"entity_type": row.entity_type,
|
|
"entity_id": row.entity_id,
|
|
"from_value": row.from_value,
|
|
"to_value": row.to_value,
|
|
"description": row.description,
|
|
"actor_id": str(row.actor_id) if row.actor_id else None,
|
|
"actor_name": actor_name,
|
|
"actor_kind": row.actor_kind,
|
|
"meta": row.meta,
|
|
"organizer_email": organizer_email,
|
|
"attendee_emails": attendee_emails or None,
|
|
"created_at": row.created_at.isoformat() if row.created_at else None,
|
|
}
|