diff --git a/docs/superpowers/specs/2026-07-09-phase3b-music-video-order-design.md b/docs/superpowers/specs/2026-07-09-phase3b-music-video-order-design.md new file mode 100644 index 0000000..7683845 --- /dev/null +++ b/docs/superpowers/specs/2026-07-09-phase3b-music-video-order-design.md @@ -0,0 +1,104 @@ +# Phase 3b 음악 영상화 유료 발주 설계 + +- 날짜: 2026-07-09 +- 선행: Phase 3a(음악 공개화·스토리→음악) main 머지 완료(677012a), /music 카피 정리(6a67a9d) +- 배경: 음악 서비스 2번째 축 = "영상화"(유료). 회원이 저장한 음악 트랙을 계좌이체 발주하면 관리자가 수동 제작·납품. 자동 영상 생성은 범위 밖. + +## 결정 사항 (CEO 확정, 2026-07-09) + +| 결정 | 내용 | +|------|------| +| 영상화 방식 | **계좌이체 발주 + 관리자 수동 제작·납품** (Phase 3 스코핑서 확정) | +| 가격 | **고정가 ₩30,000** — `music_video` products 1행, admin/products에서 조정 가능 | +| 주문 모델 | **기존 orders 재사용** + `metadata.music_track_id` 트랙 참조. music_tracks에 video 상태 추가 | +| 납품 | **`music_tracks.video_url`** — 관리자가 admin/orders에서 완성 영상 URL 직접 입력(별도 업로더 없음) | +| 진입점 | **마이페이지 AI기록 음악 카드**의 "영상화 신청" 버튼 | + +## 확인된 기존 구조 + +- `products`: `{ id, name, price, is_active, ... }` (`lib/supabase/product-files.ts` ProductRow, `getProductById(admin, id)`) +- `POST /api/orders`: 인증→rate-limit→productId/depositorName 검증→`getProductById`(active)→**중복 pending 가드**(user+product)→insert `{user_id, product_id, amount:product.price, status:'pending', metadata:{method:'bank_transfer', depositor_name}}`→접수 메일 +- `admin/orders PATCH`: body `{id, status∈pending|paid|cancelled}` → update; paid 전환 시 `sendOrderPaidEmail` +- `BankTransferModal({ product, isOpen, onClose })`: POST `{ productId: product.id, depositorName }` +- `music_tracks`(Phase 3a): `{ id, user_id, title, story, lyrics, style, audio_url, task_id, created_at }`, RLS `music_select_own` +- 마이페이지 AI기록 탭: 사주·타로·음악 병합, `MusicAiCard`(제목·스토리·`