Implement Comment System API Routes
Description
Create API routes for Comment model to enable payout commenting.
Implement full CRUD operations with authentication, payout relationships, and proper error handling.
Requirements
API Routes Structure
Database Operations
Authorization & Security
Components
src/app/api/(comment)/comment/ directory structure (new)
- Follow consistent error handling & response patterns
Validations
⚠️ Follow guidelines for issues, commits, and PRs. Otherwise, they will be ignored.
Implement Comment System API Routes
Description
Create API routes for Comment model to enable payout commenting.
Implement full CRUD operations with authentication, payout relationships, and proper error handling.
Requirements
API Routes Structure
src/app/api/(comment)/comment/create/route.ts→ POST for comment creationsrc/app/api/(comment)/comment/find-by-payout/[payout_id]/route.ts→ GET comments for a payoutsrc/app/api/(comment)/comment/update/[id]/route.ts→ PATCH comment editingsrc/app/api/(comment)/comment/delete/[id]/route.ts→ DELETE comment removalDatabase Operations
@/lib/prisma+ error handling patternspayout_id,user_id,created_atUserrelation for comment authorcreated_at)Authorization & Security
Components
src/app/api/(comment)/comment/directory structure (new)Validations
PayoutandUserrecords