From fc36485cf6ecf9781b39dbe17f8961e513ca2295 Mon Sep 17 00:00:00 2001 From: Juan Franco <91078895+m1lestones@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:19:07 -0400 Subject: [PATCH] fix: resolve merge conflict in api.ts and fix Prettier formatting across codebase --- BUILD_SUMMARY.md | 9 ++++++++- apps/web/src/app/login/page.tsx | 1 - apps/web/src/components/UserProvider.tsx | 1 - apps/web/src/lib/api.ts | 4 +--- apps/web/src/middleware.ts | 1 - backend/signals_dump.json | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/BUILD_SUMMARY.md b/BUILD_SUMMARY.md index 770861c..dd2c28a 100644 --- a/BUILD_SUMMARY.md +++ b/BUILD_SUMMARY.md @@ -5,6 +5,7 @@ This document lists all the features, integrations, database schemas, and workfl --- ## ๐Ÿ› ๏ธ Repository & Architecture + - **GitHub Monorepo Structure**: Set up with `pnpm` workspaces and `Turborepo` containing: - `apps/web`: Next.js 14 dashboard app. - `apps/agents`: Trigger.dev/cron scraping workers. @@ -16,6 +17,7 @@ This document lists all the features, integrations, database schemas, and workfl --- ## ๐Ÿ—„๏ธ Database (Supabase / PostgreSQL) + - **Schema & Migrations**: Designed, migrated, and verified the relational schema ([001_initial_schema.sql](file:///Users/joel-bmn/adonisagent/backend/migrations/001_initial_schema.sql)): - `hospitals`: Profiles, website URLs, and account type support. - `ae_users`: Role permissions (admin vs AEs) and Slack credentials. @@ -27,6 +29,7 @@ This document lists all the features, integrations, database schemas, and workfl --- ## โš™๏ธ Ingestion & Classification Pipeline + - **Hospital Scrapers**: Automated news scraping utilizing `serper.dev` and `NewsAPI` queries. - **Deterministic Rules Engine**: Python rules engine evaluating 8 keyword pattern rules to bypass Claude AI for deterministic high-confidence signals (CRO executive hires, epic go-lives, restructuring, vendor disputes). - **Claude AI Classifier**: Fallback classifier calling Claude 3.5 Sonnet, returning: @@ -39,6 +42,7 @@ This document lists all the features, integrations, database schemas, and workfl --- ## ๐Ÿ”Œ FastAPI Backend Server + - **Core Endpoints**: - `GET /api/v1/hospitals`: Hospital list filterable by AE territory. - `GET /api/v1/hospitals/{id}/signals`: Ordered signal feed. @@ -48,13 +52,14 @@ This document lists all the features, integrations, database schemas, and workfl - `POST /api/v1/copilot`: Scaffolds LLM chat completions for territory insights. - `GET /api/v1/export/csv`: Bulk CSV downloader for signals. - **Performance**: Added response-level TTL caching (`@ttl_cache(60.0)`) and CORS preflight caching. -- **Robustness**: +- **Robustness**: - Automated exponential backoff retry handler wrapping Claude API requests. - Global FastAPI exception handler dispatching unhandled 500 stack trace alerts to Danielle's Slack DM. --- ## ๐ŸŽจ Next.js Frontend Dashboard + - **Sidebar & Roster Layout**: Fully responsive viewport rendering: - Left panel shows hospital list, filterable by Michael, David, or Jeff's territories. - Main signal feed display with color-coded urgency badges (Urgent red, Worth Knowing blue, Low gray) and source links. @@ -66,6 +71,7 @@ This document lists all the features, integrations, database schemas, and workfl --- ## ๐Ÿ’ฌ Slack Integration & Bot + - **Weekly Digest DM**: Compiles and sends a combined weekly digest DM to AEs every Monday morning, containing account grouping and UTM-tagged URLs. - **Immediate Urgent Alerts**: Direct DMs sent to AEs in real-time when an `Urgent` signal is scraper-detected. - **Digest Send Guard**: Enforces that the Monday digest only sends once Danielle's pending review queue is completely empty. @@ -73,6 +79,7 @@ This document lists all the features, integrations, database schemas, and workfl --- ## ๐Ÿงช Testing & Verification + - Over **190 unit and integration tests** verifying: - Rules engine keyword matching and exceptions. - Route authentication and pagination. diff --git a/apps/web/src/app/login/page.tsx b/apps/web/src/app/login/page.tsx index 6ddd142..dde5612 100644 --- a/apps/web/src/app/login/page.tsx +++ b/apps/web/src/app/login/page.tsx @@ -71,4 +71,3 @@ export default async function LoginPage({ ); } - diff --git a/apps/web/src/components/UserProvider.tsx b/apps/web/src/components/UserProvider.tsx index 9c3a033..d7be89a 100644 --- a/apps/web/src/components/UserProvider.tsx +++ b/apps/web/src/components/UserProvider.tsx @@ -40,4 +40,3 @@ export default function UserProvider({ children }: { children: React.ReactNode } {children} ); } - diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts index ba38552..662eb7d 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -116,8 +116,6 @@ export const SIGNAL_TYPE_LABELS: Record = { filtered_out: 'Filtered out', }; - - async function getAuthToken() { if (typeof window !== 'undefined') { const { createClient } = await import('@/utils/supabase/client'); @@ -135,7 +133,7 @@ async function apiFetch( init?: RequestInit ): Promise { const nextConfig = init?.cache === 'no-store' ? undefined : { revalidate: 60 }; - + const token = await getAuthToken(); const headers: Record = { 'Content-Type': 'application/json', diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index e28c1b3..2f37be3 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -8,4 +8,3 @@ export async function middleware(request: NextRequest) { export const config = { matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'], }; - diff --git a/backend/signals_dump.json b/backend/signals_dump.json index d68a1b1..95d1562 100644 --- a/backend/signals_dump.json +++ b/backend/signals_dump.json @@ -503,4 +503,4 @@ "hospital_id": "a17f653f-8479-4159-9149-63e65d2d50a2", "created_at": "2026-06-20T23:25:54.951551+00:00" } -] \ No newline at end of file +]