[Chore] : 아이콘 교체 및 홍보 포인트 조정 등 자잘한 수정 (#247)#248
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/describe |
|
/review |
|
/improve |
Review Summary by Qodo(Agentic_describe updated until commit a37a526)Adjust promotion cost to 15P and fix search input validation
WalkthroughsDescription• Reduce song promotion daily cost from 50P to 15P • Update promotion modal guidance text with new cost • Prevent number search input exceeding 5 digits • Regenerate sitemap with updated timestamps Diagramflowchart LR
A["Promotion Cost"] -->|"Reduce 50P to 15P"| B["API Routes"]
A -->|"Update guidance text"| C["SongPromotionModal"]
D["Search Input"] -->|"Limit to 5 digits"| E["HomePage"]
F["Sitemap"] -->|"Regenerate"| G["Updated timestamps"]
File Changes1. apps/web/src/app/api/songs/promotions/route.ts
|
Code Review by Qodo
Context used✅ Tickets:
🎫 아이콘 교체 및 홍보 포인트 조정 등 자잘한 수정 1. Refund recalculated with new rate
|
| const days = | ||
| differenceInCalendarDays(new Date(promotion.end_date), new Date(promotion.start_date)) + 1; | ||
| const refund = days * 50; | ||
| const refund = days * 15; |
There was a problem hiding this comment.
1. Refund recalculated with new rate 🐞 Bug ≡ Correctness
DELETE /api/user/promotions computes refunds as days * 15, so a promotion created under the old 50P/day pricing will refund too little and permanently lose user points when canceled. The creation flow doesn’t persist the charged amount (or a point-change reference), so the correct historical refund cannot be derived later.
Agent Prompt
### Issue description
Promotion cancellation refunds are recalculated from the current price (`days * 15`) rather than the amount actually paid at creation time. This breaks refunds for any promotions created before/after a price change and can cause permanent user point loss.
### Issue Context
- Creation charges points based on `days * 15` and inserts a `song_promotions` row without storing the paid amount.
- Cancellation later recomputes `refund` from dates, so it cannot know the originally-paid rate.
### Fix Focus Areas
- Add a persisted field on the promotion record (e.g. `paid_points` or `cost_per_day`/`total_cost`) and populate it at creation time.
- Refund using the persisted value, not a recalculation.
- Consider a data backfill/migration strategy for existing rows created under the old 50P/day pricing.
### Fix Focus Areas (code references)
- apps/web/src/app/api/songs/promotions/route.ts[116-158]
- apps/web/src/app/api/user/promotions/route.ts[75-118]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
📌 PR 제목
[Chore] : 아이콘 교체 및 홍보 포인트 조정 등 자잘한 수정
📌 변경 사항
songs/promotions, 환불user/promotions, 모달SongPromotionModal)HomePage)💬 추가 참고 사항