drop-sprint1-implementation-plan

Plan: Drop Sprint 1 Implementation

Date: 2026-02-26 Author: John (AI Director) MC Task: #2110+ Status: PENDING APPROVAL Sprint Duration: 5 weeks (UI prototype with mock integrations)

Research Summary

Existing Codebase (MUCH more than expected)

Key Insight

This is NOT a greenfield build. It's a refactor to align with architecture decisions + add missing infrastructure + extend with new FRs. The existing code is functional but pre-dates the architecture review.


Objective

Refactor existing Drop codebase to align with all 16 ADRs, add missing database tables and infrastructure (Redis, BullMQ, Drizzle), implement BankID-only auth, and bring UI in line with Figma Make export designs. All external integrations (BankID, ZTL, FX, compliance) remain mocked.


Team Orchestration

Team Members

ID Name Role Agent Type Model
B1 db-builder Database: PostgreSQL-only + Drizzle + 12 new tables builder sonnet
V1 db-validator Validate database migration + schema validator sonnet
B2 auth-builder BankID-only auth refactor + AES-256-GCM builder sonnet
V2 auth-validator Validate auth + security validator sonnet
B3 infra-builder Docker, Redis, BullMQ, graceful shutdown builder sonnet
V3 infra-validator Validate infrastructure validator sonnet
B4 api-builder New API routes for FR-073 through FR-077 builder sonnet
V4 api-validator Validate API routes validator sonnet
B5 ui-builder Align UI with Figma Make + admin portal builder sonnet
V5 ui-validator Validate UI against Figma Make validator sonnet

Step-by-Step Tasks

Phase 1: Foundation (Week 1) — Database + Infrastructure

Task 1: PostgreSQL-only db.ts refactor

Task 2: Drizzle schema for all 25 tables

Task 3: Validate database migration

Task 4: Redis + BullMQ infrastructure

Task 5: Validate infrastructure


Phase 2: Auth + Security (Week 2)

Task 6: BankID-only authentication

Task 7: Validate auth + security


Phase 3: API Routes (Week 2-3)

Task 8: Webhook handling API (FR-076)

Task 9: Reconciliation API (FR-073)

Task 10: Circuit breaker service (FR-075)

Task 11: Dispute/refund API (FR-077)

Task 12: Validate API routes


Phase 4: UI Alignment (Week 3-4)

Task 13: Align existing screens with Figma Make export

Task 14: Admin portal UI (EP-09)

Task 15: Validate UI


Phase 5: Integration + Testing (Week 4-5)

Task 16: Mock services for all external integrations

Task 17: End-to-end test suite

Task 18: Final validation


Validation Commands

# Database
docker compose up -d
npx drizzle-kit push
psql -h localhost -U drop -d drop -c "\dt" | wc -l  # Should show 25 tables

# Auth
grep -r "better-sqlite3\|bcrypt\|password.*login\|pin.*login" src/ # Should be zero
grep -r "national_id_hash" src/ # Should be zero
curl http://localhost:3000/api/auth/login # Should 404

# Infrastructure
docker compose ps # PostgreSQL + Redis + app all healthy
curl http://localhost:3000/api/health # Should include redis: ok, db: ok

# Tests
npm test
npx playwright test

# QA Gate
node ~/system/tools/qa-19.js check <task-id>

Risk Mitigation

Risk Mitigation
db.ts refactor breaks all 46 API routes Task 1 creates adapter layer first, then migrates route-by-route
BankID mock breaks existing flow Keep BANKID_MOCK=true env var, test before removing legacy paths
Drizzle migration incompatible with existing data Fresh PostgreSQL for Sprint 1 (no production data yet)
UI alignment takes longer than expected Prioritize 5 core screens (Login, Dashboard, Send, Scan, Transactions), defer rest

Summary

Phase Duration Tasks Builders Validators
1: Foundation Week 1 5 B1, B3 V1, V3
2: Auth + Security Week 2 2 B2 V2
3: API Routes Week 2-3 5 B4 V4
4: UI Alignment Week 3-4 3 B5 V5
5: Integration + Testing Week 4-5 3 B4 All
Total 5 weeks 18 tasks 5 builders 5 validators

Approve plan? Then run /build-plan to execute.


Revision #3
Created 2026-02-26 22:34:46 UTC by John
Updated 2026-05-25 07:24:55 UTC by John