Skip to content

feat(phase2): backend integration — Prisma schema, 15 API routes, frontend wiring#15

Merged
parva3105 merged 1 commit intomasterfrom
revamp/phase-2
Mar 21, 2026
Merged

feat(phase2): backend integration — Prisma schema, 15 API routes, frontend wiring#15
parva3105 merged 1 commit intomasterfrom
revamp/phase-2

Conversation

@parva3105
Copy link
Copy Markdown
Owner

Summary

  • Prisma schema (6 models, 6 enums) applied to Neon DB via 2 migrations
  • 15 REST API routes under app/api/v1/ with full business logic (deal pipeline, creator roster, briefs, partnerships)
  • Database seed with 4 brands, 5 creators, 8 deals (one per stage), 2 submissions, 3 briefs
  • 12 pages wired to real API — all lib/mock/ imports replaced with fetch() server-side calls
  • 19 new unit tests (lib/__tests__/) — 120 total passing
  • CI/CD fixed — removed Clerk env vars; added NEXT_PUBLIC_APP_URL=http://localhost:3001
  • Port updated — dev server and API_BASE use :3001 throughout

Key architectural decisions

  • No Clerk in Phase 2lib/auth-helpers.ts uses hardcoded test_agency_001 / test_creator_001 / test_brand_001 IDs; all functions tagged // TODO(phase3):
  • Monetary convention — DB stores cents (Decimal(10,2)), API returns dollars (÷100); creatorPayout always server-computed
  • System-controlled stagesPENDING_APPROVAL (on submission create) and LIVE (on submission approve) are auto-advanced; blocked in POST /stage

Test plan

  • npm run typecheck → 0 errors
  • npm run lint → 0 errors
  • npm run test → 120/120 passing
  • npm run build → successful (15 API routes + 18 app pages)
  • npx prisma db seed → seeds 4 brands, 5 creators, 8 deals
  • GET http://localhost:3001/api/v1/deals → returns seeded deals
  • Visit /dashboard → Kanban board populated with real data
  • POST /api/v1/deals/[id]/submissions → deal auto-advances to PENDING_APPROVAL
  • PATCH /api/v1/deals/[id]/submissions/[sid] with APPROVED → deal auto-advances to LIVE

🤖 Generated with Claude Code

…seed, frontend wiring, CI fix

- Prisma schema (6 models, 6 enums) migrated to Neon DB
- lib/db.ts, api-response.ts, stage-transitions.ts, auth-helpers.ts, api.ts, validations/*
- 15 REST API routes under app/api/v1/ with full business logic
- Database seed: 4 brands, 5 creators, 8 deals, 2 submissions, 3 briefs
- All 12 pages wired to real API (replaced lib/mock/ imports with fetch())
- 19 new unit tests (stage-transitions + api-response); 120 total passing
- CI: removed Clerk env vars, added NEXT_PUBLIC_APP_URL
- Port changed from :3000 → :3001 throughout
- Pre-existing lint errors fixed (React Compiler purity + setState-in-effect)
- All quality gates pass: typecheck ✓ lint ✓ test ✓ build ✓

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
project-alpha Ready Ready Preview, Comment Mar 21, 2026 2:56am

@parva3105 parva3105 merged commit 5f99edf into master Mar 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant