143 lines
3.2 KiB
YAML
143 lines
3.2 KiB
YAML
task_id: task_create_component_auth_form
|
|
entity_id: component_auth_form
|
|
generated_at: '2025-12-18T15:16:50.321537'
|
|
workflow_version: v001
|
|
target:
|
|
type: component
|
|
definition:
|
|
id: component_auth_form
|
|
name: AuthForm
|
|
description: Reusable authentication form
|
|
props:
|
|
- name: mode
|
|
type: enum[login, register, forgot]
|
|
required: true
|
|
state:
|
|
- name: email
|
|
type: string
|
|
- name: password
|
|
type: string
|
|
- name: name
|
|
type: string
|
|
- name: role
|
|
type: string
|
|
events:
|
|
- name: onSubmit
|
|
payload: object
|
|
uses_apis:
|
|
- api_login
|
|
- api_register
|
|
- api_forgot_password
|
|
uses_components: []
|
|
related:
|
|
models: []
|
|
apis:
|
|
- id: api_forgot_password
|
|
definition: &id001
|
|
id: api_forgot_password
|
|
method: POST
|
|
path: /api/auth/forgot-password
|
|
description: Request password reset email
|
|
request_body:
|
|
email: string
|
|
responses:
|
|
- status: 200
|
|
description: Reset email sent
|
|
schema:
|
|
message: string
|
|
- status: 404
|
|
description: Email not found
|
|
schema:
|
|
error: string
|
|
auth:
|
|
required: false
|
|
depends_on_models:
|
|
- model_user
|
|
- id: api_register
|
|
definition: &id002
|
|
id: api_register
|
|
method: POST
|
|
path: /api/auth/register
|
|
description: Register new user account
|
|
request_body:
|
|
email: string
|
|
password: string
|
|
name: string
|
|
role: enum[musician, listener, label]
|
|
responses:
|
|
- status: 201
|
|
description: User created successfully
|
|
schema:
|
|
user:
|
|
id: uuid
|
|
email: string
|
|
name: string
|
|
role: string
|
|
token: string
|
|
- status: 400
|
|
description: Validation error
|
|
schema:
|
|
error: string
|
|
- status: 409
|
|
description: Email already exists
|
|
schema:
|
|
error: string
|
|
auth:
|
|
required: false
|
|
depends_on_models:
|
|
- model_user
|
|
- id: api_login
|
|
definition: &id003
|
|
id: api_login
|
|
method: POST
|
|
path: /api/auth/login
|
|
description: Login with email and password
|
|
request_body:
|
|
email: string
|
|
password: string
|
|
responses:
|
|
- status: 200
|
|
description: Login successful
|
|
schema:
|
|
user:
|
|
id: uuid
|
|
email: string
|
|
name: string
|
|
role: string
|
|
token: string
|
|
- status: 401
|
|
description: Invalid credentials
|
|
schema:
|
|
error: string
|
|
auth:
|
|
required: false
|
|
depends_on_models:
|
|
- model_user
|
|
components: []
|
|
dependencies:
|
|
entity_ids:
|
|
- api_forgot_password
|
|
- api_register
|
|
- api_login
|
|
definitions:
|
|
- id: api_forgot_password
|
|
type: api
|
|
definition: *id001
|
|
- id: api_register
|
|
type: api
|
|
definition: *id002
|
|
- id: api_login
|
|
type: api
|
|
definition: *id003
|
|
files:
|
|
to_create:
|
|
- app/components/AuthForm.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
|