project-standalo-sonic-cloud/.workflow/versions/v001/contexts/component_profile_form.yml

96 lines
2.2 KiB
YAML

task_id: task_create_component_profile_form
entity_id: component_profile_form
generated_at: '2025-12-18T15:16:50.326476'
workflow_version: v001
target:
type: component
definition:
id: component_profile_form
name: ProfileForm
description: User profile edit form
props:
- name: user
type: User
required: true
state:
- name: name
type: string
- name: avatarUrl
type: string
events:
- name: onSave
payload:
name: string
avatarUrl: string
uses_apis:
- api_update_current_user
uses_components:
- component_avatar_upload
related:
models: []
apis:
- id: api_update_current_user
definition: &id001
id: api_update_current_user
method: PUT
path: /api/users/me
description: Update current user profile
request_body:
name: string
avatar_url: string
responses:
- status: 200
description: User updated
schema:
id: uuid
email: string
name: string
avatar_url: string
auth:
required: true
depends_on_models:
- model_user
components:
- id: component_avatar_upload
definition: &id002
id: component_avatar_upload
name: AvatarUpload
description: Avatar image upload component
props:
- name: currentAvatarUrl
type: string
required: false
state:
- name: file
type: File
- name: preview
type: string
events:
- name: onUpload
payload:
file: File
uses_apis: []
uses_components: []
dependencies:
entity_ids:
- api_update_current_user
- component_avatar_upload
definitions:
- id: api_update_current_user
type: api
definition: *id001
- id: component_avatar_upload
type: component
definition: *id002
files:
to_create:
- app/components/ProfileForm.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