123 lines
2.8 KiB
YAML
123 lines
2.8 KiB
YAML
task_id: task_create_component_upload_form
|
|
entity_id: component_upload_form
|
|
generated_at: '2025-12-18T15:16:50.315310'
|
|
workflow_version: v001
|
|
target:
|
|
type: component
|
|
definition:
|
|
id: component_upload_form
|
|
name: UploadForm
|
|
description: Song upload form with file input
|
|
props:
|
|
- name: albums
|
|
type: array[Album]
|
|
required: true
|
|
- name: genres
|
|
type: array[Genre]
|
|
required: true
|
|
state:
|
|
- name: file
|
|
type: File
|
|
- name: title
|
|
type: string
|
|
- name: selectedAlbum
|
|
type: string
|
|
- name: selectedGenres
|
|
type: array[string]
|
|
- name: uploadProgress
|
|
type: number
|
|
events:
|
|
- name: onUpload
|
|
payload:
|
|
file: File
|
|
metadata: object
|
|
- name: onCancel
|
|
payload: null
|
|
uses_apis:
|
|
- api_upload_song
|
|
uses_components:
|
|
- component_waveform_display
|
|
related:
|
|
models: []
|
|
apis:
|
|
- id: api_upload_song
|
|
definition: &id002
|
|
id: api_upload_song
|
|
method: POST
|
|
path: /api/songs/upload
|
|
description: Upload new song (musicians only)
|
|
request_body:
|
|
file: binary
|
|
title: string
|
|
album_id: uuid
|
|
genre_ids: array[uuid]
|
|
release_date: string
|
|
track_number: integer
|
|
responses:
|
|
- status: 201
|
|
description: Song uploaded successfully
|
|
schema:
|
|
id: uuid
|
|
title: string
|
|
file_url: string
|
|
duration: integer
|
|
- status: 400
|
|
description: Invalid file format or size
|
|
schema:
|
|
error: string
|
|
- status: 403
|
|
description: User is not a musician
|
|
schema:
|
|
error: string
|
|
auth:
|
|
required: true
|
|
roles:
|
|
- musician
|
|
depends_on_models:
|
|
- model_song
|
|
- model_artist
|
|
components:
|
|
- id: component_waveform_display
|
|
definition: &id001
|
|
id: component_waveform_display
|
|
name: WaveformDisplay
|
|
description: Audio waveform visualization
|
|
props:
|
|
- name: audioUrl
|
|
type: string
|
|
required: true
|
|
- name: waveformData
|
|
type: array[number]
|
|
required: false
|
|
- name: currentTime
|
|
type: number
|
|
required: false
|
|
events:
|
|
- name: onSeek
|
|
payload:
|
|
time: number
|
|
uses_apis: []
|
|
uses_components: []
|
|
dependencies:
|
|
entity_ids:
|
|
- component_waveform_display
|
|
- api_upload_song
|
|
definitions:
|
|
- id: component_waveform_display
|
|
type: component
|
|
definition: *id001
|
|
- id: api_upload_song
|
|
type: api
|
|
definition: *id002
|
|
files:
|
|
to_create:
|
|
- app/components/UploadForm.tsx
|
|
reference: []
|
|
acceptance:
|
|
- criterion: Component renders without errors
|
|
verification: Import and render in test
|
|
- criterion: Props are typed correctly
|
|
verification: TypeScript compilation
|
|
- criterion: Events fire correctly
|
|
verification: Test event handlers
|