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

332 lines
8.4 KiB
YAML

task_id: task_create_page_label_dashboard
entity_id: page_label_dashboard
generated_at: '2025-12-18T17:43:33.723638'
workflow_version: v003
target:
type: page
definition:
id: page_label_dashboard
name: Label Dashboard
path: /label/dashboard
layout: layout_main
data_needs:
- api_id: api_get_label
purpose: Display label info
on_load: true
- api_id: api_get_label_stats
purpose: Display statistics
on_load: true
- api_id: api_list_label_invitations
purpose: Show pending invitations
on_load: true
components:
- component_label_stats
- component_artist_roster
- component_invitation_card
- component_invite_artist_modal
seo:
title: Label Dashboard | Sonic Cloud
description: Manage your label
auth:
required: true
roles:
- label
redirect: /login
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_list_label_invitations
definition: &id004
id: api_list_label_invitations
method: GET
path: /api/labels/[id]/invitations
summary: List label invitations
description: Get all invitations sent by this label
tags:
- labels
- invitations
path_params:
- name: id
type: string
description: Label ID
query_params:
- name: status
type: string
required: false
description: Filter by status (pending, accepted, declined, expired)
responses:
- status: 200
description: Invitations list
schema:
type: array
properties:
- name: id
type: uuid
- name: artist
type: object
- name: status
type: string
- name: message
type: string
- name: expiresAt
type: datetime
- status: 401
description: Unauthorized
- status: 403
description: Not label owner
depends_on_models:
- model_label_invitation
depends_on_apis: []
auth:
required: true
roles:
- label
- id: api_get_label_stats
definition: &id006
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_invitation_card
definition: &id002
id: component_invitation_card
name: InvitationCard
props:
- name: invitation
type: LabelInvitation
required: true
description: Invitation object
- name: viewType
type: string
required: true
description: Are we viewing as label or artist (label/artist)
events:
- name: onAccept
payload: string
description: Fires when accept clicked (artist view)
- name: onDecline
payload: string
description: Fires when decline clicked (artist view)
- name: onCancel
payload: string
description: Fires when cancel clicked (label view)
uses_apis: []
uses_components: []
internal_state:
- isProcessing
variants:
- default
- id: component_label_stats
definition: &id003
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_invite_artist_modal
definition: &id005
id: component_invite_artist_modal
name: InviteArtistModal
props:
- name: isOpen
type: boolean
required: true
description: Whether modal is open
- name: labelId
type: string
required: true
description: Label ID sending invitation
events:
- name: onClose
payload: void
description: Fires when modal should close
- name: onInviteSent
payload: LabelInvitation
description: Fires when invitation successfully sent
uses_apis:
- api_create_label_invitation
uses_components: []
internal_state:
- searchQuery
- selectedArtist
- message
- isSubmitting
variants:
- default
- id: component_artist_roster
definition: &id007
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_invitation_card
- component_label_stats
- api_list_label_invitations
- component_invite_artist_modal
- api_get_label_stats
- component_artist_roster
definitions:
- id: api_get_label
type: api
definition: *id001
- id: component_invitation_card
type: component
definition: *id002
- id: component_label_stats
type: component
definition: *id003
- id: api_list_label_invitations
type: api
definition: *id004
- id: component_invite_artist_modal
type: component
definition: *id005
- id: api_get_label_stats
type: api
definition: *id006
- id: component_artist_roster
type: component
definition: *id007
files:
to_create:
- app/label/dashboard/page.tsx
reference: []
acceptance:
- criterion: Page renders at /label/dashboard
verification: Navigate to /label/dashboard
- criterion: Data fetching works
verification: Check network tab
- criterion: Components render correctly
verification: Visual inspection