| 03-agent-portal-shell |
01 |
database |
| drizzle |
| postgres |
| pgEnum |
| next-auth |
| middleware |
| routing |
|
| phase |
provides |
| 01-foundation |
Drizzle schema.ts with users table, auth.config.ts authorized callback, middleware.ts with /agent matcher |
|
|
| clients and documents tables in PostgreSQL with document_status enum |
| Drizzle migration 0001_watery_blindfold.sql |
| /portal/:path* protected via middleware matcher and auth.config.ts authorized callback |
| Post-login redirect lands on /portal/dashboard |
| /agent/dashboard silently forwards to /portal/dashboard |
|
| 03-02 |
| 03-03 |
| 03-04 |
| all Phase 3 plans — clients/documents tables and /portal routing are foundations |
|
| added |
patterns |
| pgEnum from drizzle-orm/pg-core |
|
| pgEnum defined before referencing table |
| documentStatusEnum as named export |
| portal route protection mirrors agent route pattern in authorized callback |
|
|
| created |
modified |
| teressa-copeland-homes/drizzle/0001_watery_blindfold.sql |
| teressa-copeland-homes/drizzle/meta/0001_snapshot.json |
|
| teressa-copeland-homes/src/lib/db/schema.ts |
| teressa-copeland-homes/middleware.ts |
| teressa-copeland-homes/src/lib/auth.config.ts |
| teressa-copeland-homes/src/app/agent/(protected)/dashboard/page.tsx |
|
|
| documentStatusEnum exported before documents table — pgEnum must be declared before the table that references it or drizzle-kit may omit the CREATE TYPE statement |
| portal route protection mirrors existing /agent pattern in authorized callback — isPortalRoute check added alongside isAgentRoute, both redirect unauthenticated to /agent/login |
| Post-login redirect changed from /agent/dashboard to /portal/dashboard — agent portal lives at /portal prefix going forward |
| DATABASE_URL not loaded from .env.local by drizzle-kit (uses dotenv/config which reads .env) — migration run with explicit env var; .env.local is sufficient for Next.js dev server |
|
| pgEnum: export enum constant before the table that uses it in schema.ts |
| Route protection: add new route prefix to both middleware.ts matcher array AND auth.config.ts authorized callback isPortalRoute check |
|
| CLIENT-01 |
| CLIENT-02 |
| CLIENT-03 |
| DASH-01 |
| DASH-02 |
|
3min |
2026-03-19 |