feat(event-file): implement atomic V3 upload action for event files
- Creates api_v3_actions_event_file.py with a specialized /upload endpoint. - Handles physical storage (hosted_file), generic linking, and event association (event_file) in one request. - Implements intelligent ID resolution to prevent duplicate event associations for the same physical file. - Updates documentation in GUIDE__V3_FRONTEND_API.md.
This commit is contained in:
@@ -107,7 +107,35 @@ V3 uses specialized **"Action"** routes for binary operations to separate proces
|
||||
|
||||
---
|
||||
|
||||
## 5. Hosted File Management (Legacy)
|
||||
## 5. Event File Management (Specialized V3 Actions)
|
||||
|
||||
While `hosted_file` handles generic storage, `event_file` actions are context-aware and atomic for the Event module.
|
||||
|
||||
### A. Atomic Upload Action
|
||||
**Path**: `POST /v3/action/event_file/upload`
|
||||
**Format**: `multipart/form-data`
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `file_list` | File[] | Yes | Files to upload. |
|
||||
| `account_id`| String | Yes | Owner account. |
|
||||
| `for_type` | String | Yes | Parent object type (e.g., `event_session`). |
|
||||
| `for_id` | String | Yes | Random ID of the parent object. |
|
||||
| `event_id` | String | No | Optional event context. |
|
||||
| `title` | String | No | Display title for the file. |
|
||||
|
||||
**Features:**
|
||||
- **Atomic Creation:** Automatically creates the `hosted_file`, the `hosted_file_link`, AND the `event_file` association in one request.
|
||||
- **Intelligent Updates:** If the same file is uploaded again for the same object, it updates the metadata instead of creating a duplicate association.
|
||||
- **Enriched Return:** Returns full `event_file` objects with nested `hosted_file` data.
|
||||
|
||||
### B. Specialized Download
|
||||
**Path**: `GET /v3/action/event_file/{id}/download`
|
||||
*Semantic alias for the universal hosted_file downloader.*
|
||||
|
||||
---
|
||||
|
||||
## 6. Hosted File Management (Legacy)
|
||||
|
||||
The following endpoints are maintained for backward compatibility but should be migrated to V3 Actions.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user