project-standalo-note-to-app/.workflow/versions/v001/contexts/component_register_form.yml

139 lines
3.4 KiB
YAML

task_id: task_create_component_register_form
entity_id: component_register_form
generated_at: '2025-12-19T06:08:12.191625'
workflow_version: v001
target:
type: component
definition:
id: component_register_form
name: RegisterForm
props: []
events:
- name: onSuccess
payload: User
description: Fired when registration successful
- name: onError
payload: string
description: Fired when registration fails
uses_apis:
- api_register_user
uses_components: []
internal_state:
- email
- name
- password
- confirmPassword
- isLoading
- error
variants:
- default
related:
models: []
apis:
- id: api_register_user
definition: &id001
id: api_register_user
method: POST
path: /api/auth/register
summary: Register a new user
description: Create a new user account with email and password
tags:
- auth
path_params: []
query_params: []
request_body:
content_type: application/json
schema:
type: object
properties:
- name: email
type: string
required: true
validations:
- email
description: User email address
- name: name
type: string
required: true
validations:
- min:1
- max:100
description: User display name
- name: password
type: string
required: true
validations:
- min:8
description: Password (min 8 characters)
example:
email: user@example.com
name: John Doe
password: securepass123
responses:
- status: 201
description: User created successfully
schema:
type: object
properties:
- name: id
type: uuid
- name: email
type: string
- name: name
type: string
- name: created_at
type: datetime
example:
id: 550e8400-e29b-41d4-a716-446655440000
email: user@example.com
name: John Doe
created_at: '2024-12-19T06:00:00Z'
- status: 400
description: Validation error
schema:
type: object
properties:
- name: error
type: string
example:
error: Invalid email or password too short
- status: 409
description: Email already exists
schema:
type: object
properties:
- name: error
type: string
example:
error: Email already registered
depends_on_models:
- model_user
depends_on_apis: []
auth:
required: false
roles: []
rate_limit:
requests: 10
window: 1h
external: false
components: []
dependencies:
entity_ids:
- api_register_user
definitions:
- id: api_register_user
type: api
definition: *id001
external: false
files:
to_create:
- app/components/RegisterForm.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