project-standalo-sonic-cloud/.workflow/versions/v003/contexts/page_label_profile.yml

237 lines
5.8 KiB
YAML

task_id: task_create_page_label_profile
entity_id: page_label_profile
generated_at: '2025-12-18T17:43:33.720815'
workflow_version: v003
target:
type: page
definition:
id: page_label_profile
name: Label Profile
path: /label/[id]
layout: layout_main
data_needs:
- api_id: api_get_label
purpose: Display label info and artist roster
on_load: true
- api_id: api_get_label_stats
purpose: Display label statistics
on_load: true
components:
- component_label_header
- component_label_stats
- component_artist_roster
seo:
title: '{{label.name}} | Sonic Cloud'
description: '{{label.description}}'
auth:
required: false
roles: []
redirect: null
related:
models: []
apis:
- id: api_get_label
definition: &id001
id: api_get_label
method: GET
path: /api/labels/[id]
summary: Get label details
description: Retrieve label profile with artist roster and statistics
tags:
- labels
path_params:
- name: id
type: string
description: Label ID
responses:
- status: 200
description: Label found
schema:
type: object
properties:
- name: id
type: uuid
- name: name
type: string
- name: slug
type: string
- name: description
type: string
- name: logoUrl
type: string
- name: website
type: string
- name: artists
type: array
- name: _count
type: object
example:
id: 550e8400-e29b-41d4-a716-446655440000
name: Sonic Records
slug: sonic-records
description: Independent music label
artists: []
_count:
artists: 5
songs: 120
- status: 404
description: Label not found
schema:
type: object
properties:
- name: error
type: string
depends_on_models:
- model_label_invitation
depends_on_apis: []
auth:
required: false
roles: []
- id: api_get_label_stats
definition: &id004
id: api_get_label_stats
method: GET
path: /api/labels/[id]/stats
summary: Get label statistics
description: Get artist count, song count, album count, and total plays
tags:
- labels
- statistics
path_params:
- name: id
type: string
description: Label ID
responses:
- status: 200
description: Statistics retrieved
schema:
type: object
properties:
- name: artistCount
type: integer
- name: songCount
type: integer
- name: albumCount
type: integer
- name: totalPlays
type: integer
example:
artistCount: 5
songCount: 120
albumCount: 15
totalPlays: 45000
- status: 404
description: Label not found
depends_on_models: []
depends_on_apis: []
auth:
required: false
roles: []
components:
- id: component_label_stats
definition: &id002
id: component_label_stats
name: LabelStats
props:
- name: stats
type: LabelStats
required: true
description: Statistics object
events: []
uses_apis: []
uses_components: []
internal_state: []
variants:
- default
- compact
- id: component_label_header
definition: &id003
id: component_label_header
name: LabelHeader
props:
- name: label
type: Label
required: true
description: Label with full details
- name: isOwner
type: boolean
required: false
default: false
description: Is current user the label owner
events:
- name: onEdit
payload: void
description: Fires when edit button clicked
uses_apis: []
uses_components: []
internal_state: []
variants:
- default
- id: component_artist_roster
definition: &id005
id: component_artist_roster
name: ArtistRoster
props:
- name: artists
type: Artist[]
required: true
description: List of signed artists
- name: isOwner
type: boolean
required: false
default: false
description: Show management controls
- name: emptyMessage
type: string
required: false
default: No artists signed yet
description: Message when roster is empty
events:
- name: onRemoveArtist
payload: string
description: Fires when remove clicked, payload is artist ID
- name: onArtistClick
payload: string
description: Fires when artist clicked
uses_apis: []
uses_components: []
internal_state:
- removingArtistId
variants:
- grid
- list
dependencies:
entity_ids:
- api_get_label
- component_label_stats
- component_label_header
- api_get_label_stats
- component_artist_roster
definitions:
- id: api_get_label
type: api
definition: *id001
- id: component_label_stats
type: component
definition: *id002
- id: component_label_header
type: component
definition: *id003
- id: api_get_label_stats
type: api
definition: *id004
- id: component_artist_roster
type: component
definition: *id005
files:
to_create:
- app/label/[id]/page.tsx
reference: []
acceptance:
- criterion: Page renders at /label/[id]
verification: Navigate to /label/[id]
- criterion: Data fetching works
verification: Check network tab
- criterion: Components render correctly
verification: Visual inspection