Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 4.26 KB

File metadata and controls

67 lines (46 loc) · 4.26 KB

Tasks: P2P Payment Request

Input: Design documents from /specs/[###-feature-name]/ Prerequisites: plan.md (required), spec.md (required for user stories), data-model.md

Organization: Re-ordered to prioritize foundational infrastructure, authentication, domain scaffolding, and an iterative testing sequence.

Phase 1: Setup & Foundational

Purpose: Core infrastructure that MUST be complete before UI logic begins.

  • T001 Initialize Next.js 16 project with TypeScript in root directory .
  • T002 Install Tailwind CSS, shadcn/ui components, Prisma ORM, Supabase client
  • T003 Setup Playwright testing structure and video recording config
  • T004 Copy data-model.md Prisma schema to prisma/schema.prisma natively
  • T005 Implement Supabase client connections and initialization
  • T006 Create demo seeding script prisma/seed.ts (ensuring Alice, Bob, Charlie IDs map exactly)
  • T007 Run initial database migration against Supabase locally and seed data

Phase 2: Auth Validation & Domain Scaffolding

Purpose: Securing routes early and building the domain foundation that views will rely upon.

  • T008 [US9] Implement mock/demo user login UI with "Alice", "Bob" presets in src/app/(auth)/login/page.tsx
  • T009 [US9] Implement route protection via src/middleware.ts to force login for /dashboard and /request
  • T010 Scaffold src/lib/domain/utils.ts (amount formatting, viewer-role resolver, text searching helpers)
  • T011 Scaffold centralized state machine base in src/lib/domain/request-actions.ts to prepare for atomic logic

Phase 3: Core MVP (Dashboard, Create, Detail, Pay)

Purpose: Build the primary success path visually and functionally.

  • T012 [US2] Create data fetchers in src/lib/domain/queries.ts for outgoing/incoming lists
  • T013 [US1] Create form UI component with Zod validation in src/app/request/page.tsx
  • T014 [US1] Implement Server Action in src/lib/domain/request-actions.ts to validate & create PaymentRequest. MUST enforce lowercase email matching, nullable recipientId, leaving phone requests unlinked.
  • T015 [US2] Implement Dashboard UI in src/app/dashboard/page.tsx. MUST include explicit query-driven search inputs for recipient/requester, status tabs/filters, and empty states.
  • T016 [US6/US8] Implement Detail page UI in src/app/r/[shareToken]/page.tsx. MUST handle data loading, viewer role derivation, URL-based read-only parsing, and expiration countdown rendering.
  • T017 [US3] Implement strict server action for Pay transition (with 2-3s delay). Centralized in request-actions.ts to ensure only PENDING translates atomically.
  • T018 [US3] Create UI components for Pay button and loading state overlay in request view.
  • T019 Write and execute Playwright tests for Core MVP (Login, Dashboard, Create, Pay flows).

Phase 4: Remaining Actions & Constraints

Purpose: Fulfilling the state machine bounds and ensuring correct rejection behavior.

  • T020 [US4] Implement atomic server action for Decline transition in src/lib/domain/request-actions.ts and wire UI.
  • T021 [US5] Implement server action for Cancel transition restricting actor to requester only in src/lib/domain/request-actions.ts and wire UI.
  • T022 [US7] Overhaul dynamic expiration logic: queries and actions detect now > expiresAt, persist EXPIRED status immediately, and forcibly reject subsequent action attempts.
  • T023 Write and execute Playwright tests for Remaining Flows (Cancel, Decline, Expiration lockouts, Access control).

Final Phase: Polish, Documentation, & Deployment

Purpose: Addressing the specific delivery requirements for submission.

  • T024 Polish UI states ensuring graceful handling of 0 incoming/outgoing requests and 0 search results.
  • T025 Setup Vercel deployment variables and instructions.
  • T026 Compile comprehensive project README.md including setup instructions, architectural decisions, trade-offs, and demo credentials.
  • T027 Document AI workflow: compile prompts, challenges, and agent collaboration steps into docs/ai-workflow.md (or detailed section of README).
  • T028 Audit project: Verify screen recordings for Playwright populate in test-results/ and the prototype meets all FR constraints.