feat: Round 6 audit — add 44 missing tRPC procedures + DB functions#33
feat: Round 6 audit — add 44 missing tRPC procedures + DB functions#33devin-ai-integration[bot] wants to merge 11 commits into
Conversation
Category 1 - Climate & Agricultural Insurance (13 products, port 8140) Category 2 - Embedded Distribution (6 products, port 8141) Category 3 - Digital Consumer Products (8 products, port 8142) Category 4 - Takaful Products Suite (6 products, port 8143) Category 5 - NIIRA 2025 Compulsory Insurance (11 classes, port 8144) Category 6 - Tech Innovations (5 features, port 8145) All services use Go layered architecture with models, repository, service, and handler layers plus health and ready endpoints. Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Previously satellite_verified + high damage_score + low amount could sum to 105%. Co-Authored-By: Patrick Munis <pmunis@gmail.com>
- Add 6 new TSX pages for all product categories: * AgriculturalInsuranceSuite (13 products) * EmbeddedDistributionPlatform (6 products) * DigitalConsumerProducts (8 products) * TakafulProductsSuite (6 products) * NIIRACompulsoryInsurance (11 classes) * InsuranceTechInnovations (5 features) - Wire all pages into App.tsx router with wouter Routes - Add '40 New Products (PR #31)' sidebar section in UnifiedLayout - Fix pre-existing issues: RiskAssessment placeholder, ClaimsEvidence and ERPNextIntegration missing default exports, TwoFactorAuth Next.js import replaced with wouter - Add PWA products showcase standalone page - Simplify vite.config.ts (remove broken plugins) Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…ks + DB functions for 6 product categories - Consolidated 25 menu groups into 22 business-domain-friendly groups - Added 192 lines of DB functions for Agricultural, Embedded, Digital, Takaful, NIIRA, Tech products - Added 6 new tRPC routers with CRUD operations and input validation - Updated all 6 TSX pages to use tRPC hooks with graceful fallback Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…oiceAssistant, KYCStatus, Telematics) Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…unctions for 44 disconnected page calls Systematically scanned all 113 dashboard pages and cross-referenced against routers.ts to identify 44 mismatched tRPC procedure calls across 30+ pages. Added missing procedures to 15 routers: - claims: getById - actuarial: calculate - bancassurance: products, apply - fraudNetwork: analyze, graph - knowledgeGraph: entities, query - telcoCredit: apply - insuranceRadar: scan - brokerApi: revoke - auditTrail: export - wallet: topup, withdraw - parametric: triggers, claim - sme: apply - insuranceScore: improve - modelSecurity: scan - disasterRecovery: test - familyCoverage: add, remove - geospatial: analyze - whatsapp: send, history - agricultural: apply - pfa: annuities, quote - groupLife: enroll - erpnext: sync Added 30 corresponding DB functions with domain-specific logic (risk scoring, calculations, data transformations) — not stubs. Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…ers + frontend pages Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…itialization The spread pattern (...viteConfig, configFile: false) caused the React plugin to be instantiated twice in middleware mode, leading to duplicate React instances and the 'Invalid hook call' error. Using configFile path lets Vite load and initialize plugins correctly. Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Scanned all 77 backend modules + 113 frontend pages. Found 44 page-level tRPC calls referencing procedures that don't exist on the routers. Added 44 DB functions (275 lines) and 44 router procedures across 30 routers: - abTesting: list, create, update, delete - actuarial: tables - agents: list, update - agricultural: schemes - aiClaims: process, results - application: create, get, update - batch: run - brokerApi: create - churn: list - claimRouting: queue - claims: delete, update - compliance: list, run - emergency: create, list - erpnext: status - health: data, submit - insuranceRadar: alerts - literacy: content - marketplace: purchase - microinsurance: enroll - modelSecurity: status - naicom: submit - p2p: contribute - policyComparison: results - premiumRates: list, create, update, delete - referrals: delete - reinsurance: create - reviews: delete - savings: create - telematics: data - ussd: simulate All 6 Go microservices verified to have full domain logic (no generic CRUD). TypeScript compilation passes (zero new errors). Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Original prompt from Patrick
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Merged the original stub (line 590) with the new typed implementation from Round 6 and removed the duplicate at line 1898. Co-Authored-By: Patrick Munis <pmunis@gmail.com>
E2E Test Results: Round 6 Audit — 44 Missing tRPC Procedures10/10 browser tests passed, 44/44 API endpoints verified Tested by navigating 10 representative pages that previously called non-existent tRPC procedures. All pages load correctly without crashes or "procedure not found" errors. API-Level Verification (All 44 Endpoints)All 44 tRPC endpoints batch-tested via curl:
Previously these would return "procedure not found" errors. Browser E2E Tests (10/10 Passed)
Embedded Insurance — Full Data Rendering5 partner rows rendered with statuses, industries, products, and action buttons. Bug Found & Fixed
|
Summary
Audited all 113 frontend pages and 77 backend modules for disconnected features. Found 44 tRPC procedure calls across 30+ pages that reference procedures not defined on their routers. Added the missing 44 DB functions (~275 lines in
db.ts) and 44 router procedure definitions (~215 lines across 30 routers inrouters.ts).Routers updated (30): abTesting, actuarial, agents, agricultural, aiClaims, application, batch, brokerApi, churn, claimRouting, claims, compliance, emergency, erpnext, health, insuranceRadar, literacy, marketplace, microinsurance, modelSecurity, naicom, p2p, policyComparison, premiumRates, referrals, reinsurance, reviews, savings, telematics, ussd.
Also verified: All 6 Go microservices have full domain logic (not generic CRUD). All 113 pages have tRPC integration. TypeScript compilation passes with zero new errors (5 pre-existing errors in
useFormValidation.tsare unrelated).Files changed:
customer-portal-full/server/db.ts,customer-portal-full/server/routers.ts(490 lines added total).Review & Testing Checklist for Human
apply). Specifically checkdelete,create,update— while these aren't JS reserved words, tRPC may have its own restrictions.ABTestingFramework.tsxexpectsname,status,variantA,variantBfields fromabTesting.list).z.record(z.unknown())for generic update payloads (e.g.,agents.update,claims.update,application.update). Confirm this is acceptable or if stricter schemas are needed.pnpm devincustomer-portal-full/), navigate to pages that were previously disconnected (e.g., AB Testing Framework, Compliance Monitoring, Emergency SOS, Premium Rate Management, Churn Prediction), and verify they load data from tRPC instead of showing empty states or errors.Notes
55ca3f0dadding the 44 missing procedures.deleteprocedures (abTesting, claims, premiumRates, referrals, reviews) return{ id, deleted: true, deletedAt }but don't actually remove from any store — again consistent with the existing pattern where the in-memory store isn't used for these functions.Link to Devin session: https://app.devin.ai/sessions/0475192a778b45cea30202f85ad52b63