task_id: task_create_api_update_current_user entity_id: api_update_current_user generated_at: '2025-12-18T15:16:50.233456' workflow_version: v001 target: type: api definition: 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 related: models: - id: model_user definition: &id001 id: model_user name: User table_name: users description: Base user entity with authentication fields: - name: id type: uuid constraints: - primary_key - name: email type: string constraints: - unique - not_null - name: password_hash type: string constraints: - not_null - name: name type: string constraints: - not_null - name: role type: enum values: - musician - listener - label constraints: - not_null - name: email_verified type: boolean default: false - name: avatar_url type: string constraints: - nullable - name: created_at type: timestamp constraints: - not_null - name: updated_at type: timestamp constraints: - not_null relations: - type: has_one to: model_artist foreign_key: user_id condition: role = 'musician' - type: has_one to: model_label foreign_key: user_id condition: role = 'label' - type: has_many to: model_playlist foreign_key: user_id indexes: - fields: - email unique: true - fields: - role timestamps: true apis: [] components: [] dependencies: entity_ids: - model_user definitions: - id: model_user type: model definition: *id001 files: to_create: - app/api/users/me/route.ts reference: [] acceptance: - criterion: PUT /api/users/me returns success response verification: curl -X PUT /api/users/me - criterion: Request validation implemented verification: Test with invalid data - criterion: Error responses match contract verification: Test error scenarios