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

104 lines
2.2 KiB
YAML

task_id: task_create_api_create_label_profile
entity_id: api_create_label_profile
generated_at: '2025-12-18T15:16:50.286319'
workflow_version: v001
target:
type: api
definition:
id: api_create_label_profile
method: POST
path: /api/labels
description: Create label profile
request_body:
label_name: string
description: string
logo_url: string
website: string
responses:
- status: 201
description: Label created
schema:
id: uuid
label_name: string
auth:
required: true
roles:
- label
depends_on_models:
- model_label
related:
models:
- id: model_label
definition: &id001
id: model_label
name: Label
table_name: labels
description: Organization profile for labels
fields:
- name: id
type: uuid
constraints:
- primary_key
- name: user_id
type: uuid
constraints:
- not_null
- foreign_key
references: users.id
- name: label_name
type: string
constraints:
- not_null
- name: description
type: text
constraints:
- nullable
- name: logo_url
type: string
constraints:
- nullable
- name: website
type: string
constraints:
- nullable
- name: created_at
type: timestamp
constraints:
- not_null
- name: updated_at
type: timestamp
constraints:
- not_null
relations:
- type: belongs_to
to: model_user
foreign_key: user_id
- type: has_many
to: model_artist
foreign_key: label_id
indexes:
- fields:
- user_id
unique: true
timestamps: true
apis: []
components: []
dependencies:
entity_ids:
- model_label
definitions:
- id: model_label
type: model
definition: *id001
files:
to_create:
- app/api/labels/route.ts
reference: []
acceptance:
- criterion: POST /api/labels returns success response
verification: curl -X POST /api/labels
- criterion: Request validation implemented
verification: Test with invalid data
- criterion: Error responses match contract
verification: Test error scenarios