feat: Implement Event File Hosted Data Fix and API Guide Update
Address critical data visibility issues for Event Files and enhance frontend documentation.
This commit resolves the persistent problem where top-level hosted file convenience fields
(e.g., , , ) were
returning as in V3 Event File API responses, even when .
Key changes include:
- Refactored Pydantic model:
- Removed redundant definitions from top-level hosted file convenience fields,
allowing direct mapping from SQL view columns.
- Simplified to focus solely on conditionally loading the nested
object, as top-level fields are now populated directly by Pydantic
from the view.
- Added comprehensive comments to clarify data flow, Pydantic's behavior, and the
expected origin of these convenience fields from SQL views.
- Updated :
- Introduced a new section detailing how to retrieve Event File data, including the
use of to get both top-level convenience fields and a nested
object.
- Clarified all ID references as random string IDs.
- Renumbered the troubleshooting section.
- Copied updated guide to .
- Continued ID Vision compliance audit, ensuring consistent handling of random string IDs
across various core and event models (Account, Address, Contact, DataStore, Event Badge Template).
- Consolidated ID Vision E2E tests and updated related documentation.
- Minor updates to and
to support Event File data retrieval with .
This commit is contained in:
@@ -83,7 +83,15 @@ def load_event_file_obj(
|
||||
enabled = enabled,
|
||||
):
|
||||
event_file_obj.hosted_file = hosted_file_obj
|
||||
# event_file_obj.hosted_file = hosted_file_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
# Explicitly populate convenience fields from hosted_file_obj
|
||||
if hosted_file_obj.hash_sha256:
|
||||
event_file_obj.hosted_file_hash_sha256 = hosted_file_obj.hash_sha256
|
||||
if hosted_file_obj.subdirectory_path:
|
||||
event_file_obj.hosted_file_subdirectory_path = hosted_file_obj.subdirectory_path
|
||||
if hosted_file_obj.content_type:
|
||||
event_file_obj.hosted_file_content_type = hosted_file_obj.content_type
|
||||
if hosted_file_obj.size:
|
||||
event_file_obj.hosted_file_size = str(hosted_file_obj.size) # Ensure it's a string as per model definition
|
||||
else:
|
||||
event_file_obj.hosted_file = {}
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user