115 lines
2.7 KiB
YAML
115 lines
2.7 KiB
YAML
task_id: task_create_component_login_form
|
|
entity_id: component_login_form
|
|
generated_at: '2025-12-19T06:08:12.190206'
|
|
workflow_version: v001
|
|
target:
|
|
type: component
|
|
definition:
|
|
id: component_login_form
|
|
name: LoginForm
|
|
props: []
|
|
events:
|
|
- name: onSuccess
|
|
payload: User
|
|
description: Fired when login successful
|
|
- name: onError
|
|
payload: string
|
|
description: Fired when login fails
|
|
uses_apis:
|
|
- api_login_user
|
|
uses_components: []
|
|
internal_state:
|
|
- email
|
|
- password
|
|
- isLoading
|
|
- error
|
|
variants:
|
|
- default
|
|
related:
|
|
models: []
|
|
apis:
|
|
- id: api_login_user
|
|
definition: &id001
|
|
id: api_login_user
|
|
method: POST
|
|
path: /api/auth/login
|
|
summary: Login user
|
|
description: Authenticate user with email and password, return session token
|
|
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
|
|
- name: password
|
|
type: string
|
|
required: true
|
|
description: User password
|
|
example:
|
|
email: user@example.com
|
|
password: securepass123
|
|
responses:
|
|
- status: 200
|
|
description: Login successful
|
|
schema:
|
|
type: object
|
|
properties:
|
|
- name: user
|
|
type: object
|
|
- name: token
|
|
type: string
|
|
example:
|
|
user:
|
|
id: 550e8400-e29b-41d4-a716-446655440000
|
|
email: user@example.com
|
|
name: John Doe
|
|
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
|
- status: 401
|
|
description: Invalid credentials
|
|
schema:
|
|
type: object
|
|
properties:
|
|
- name: error
|
|
type: string
|
|
example:
|
|
error: Invalid email or password
|
|
depends_on_models:
|
|
- model_user
|
|
depends_on_apis: []
|
|
auth:
|
|
required: false
|
|
roles: []
|
|
rate_limit:
|
|
requests: 20
|
|
window: 1h
|
|
external: false
|
|
components: []
|
|
dependencies:
|
|
entity_ids:
|
|
- api_login_user
|
|
definitions:
|
|
- id: api_login_user
|
|
type: api
|
|
definition: *id001
|
|
external: false
|
|
files:
|
|
to_create:
|
|
- app/components/LoginForm.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
|