89 lines
1.9 KiB
YAML
89 lines
1.9 KiB
YAML
task_id: task_create_api_get_genres
|
|
entity_id: api_get_genres
|
|
generated_at: '2025-12-18T15:16:50.279777'
|
|
workflow_version: v001
|
|
target:
|
|
type: api
|
|
definition:
|
|
id: api_get_genres
|
|
method: GET
|
|
path: /api/discover/genres
|
|
description: Get all genres
|
|
responses:
|
|
- status: 200
|
|
description: List of genres
|
|
schema:
|
|
genres:
|
|
- id: uuid
|
|
name: string
|
|
slug: string
|
|
auth:
|
|
required: false
|
|
depends_on_models:
|
|
- model_genre
|
|
related:
|
|
models:
|
|
- id: model_genre
|
|
definition: &id001
|
|
id: model_genre
|
|
name: Genre
|
|
table_name: genres
|
|
description: Music category for discovery
|
|
fields:
|
|
- name: id
|
|
type: uuid
|
|
constraints:
|
|
- primary_key
|
|
- name: name
|
|
type: string
|
|
constraints:
|
|
- unique
|
|
- not_null
|
|
- name: slug
|
|
type: string
|
|
constraints:
|
|
- unique
|
|
- not_null
|
|
- name: description
|
|
type: text
|
|
constraints:
|
|
- nullable
|
|
- name: created_at
|
|
type: timestamp
|
|
constraints:
|
|
- not_null
|
|
- name: updated_at
|
|
type: timestamp
|
|
constraints:
|
|
- not_null
|
|
relations:
|
|
- type: has_many
|
|
to: model_song
|
|
through: song_genres
|
|
foreign_key: genre_id
|
|
indexes:
|
|
- fields:
|
|
- slug
|
|
unique: true
|
|
timestamps: true
|
|
apis: []
|
|
components: []
|
|
dependencies:
|
|
entity_ids:
|
|
- model_genre
|
|
definitions:
|
|
- id: model_genre
|
|
type: model
|
|
definition: *id001
|
|
files:
|
|
to_create:
|
|
- app/api/discover/genres/route.ts
|
|
reference: []
|
|
acceptance:
|
|
- criterion: GET /api/discover/genres returns success response
|
|
verification: curl -X GET /api/discover/genres
|
|
- criterion: Request validation implemented
|
|
verification: Test with invalid data
|
|
- criterion: Error responses match contract
|
|
verification: Test error scenarios
|