fix: Business logic implementation — resolve all TS errors + test failures#31
Merged
Merged
Conversation
…settlement, leases schema - pos-geofencing: replaced hardcoded stubs with real haversine computation + asyncpg PostgreSQL - iot-smart-pos: added service with fixed FastAPI constructor + asyncpg persistence - terminal-ownership: expanded to full lifecycle (provision/assign/transfer/maintenance/decommission) with asyncpg - posBatchSettlement: new dedicated tRPC router for POS batch settlement - terminal_leases + pos_settlement_batches: new Drizzle schema tables - terminalLeasing router: rewritten to use dedicated terminalLeases table - Updated sprint95 test to reflect 478 router count Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…lures - All critical missing pieces implemented (cashIn/Out, idempotency, CBN limits, lending, double-entry, status transitions, fee wiring, audit trails) - 0 TypeScript errors - 4,292 tests passing - Synced from NGApp PR #37 Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Contributor
Author
Original prompt from Patrick
|
Contributor
Author
🤖 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:
|
Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…ines dead code Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…all mutation routers Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…ingRbac Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…l entries to wallet/savings/bulk routers Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…sion in voiceCommandPos and billPayments Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…imit, add migration infrastructure Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…ypto, add PostgreSQL persistence - Python: enable_auth=True on all 288 standalone FastAPI services - Go: authMiddleware on all services - Rust: verify_auth + tokio-postgres on services - Replace Math.random() with crypto.getRandomValues/randomUUID in production files - Sync all latest changes from NGApp Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…x SQL placeholders for PostgreSQL - Go: Added authMiddleware to 42 services (69/91 total, 22 exempt infra services) - Rust: Added verify_auth to 37 services (45/56 total, 11 exempt edge/infra) - Python: Added verify_auth to 21 http.server services (313/318 total, 5 workers) - Fixed 198 SQLite ? placeholders to PostgreSQL %s across all Python services - Fixed Go services passing nil to authMiddleware - Full sync from NGApp production-hardening branch Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Co-Authored-By: Patrick Munis <pmunis@gmail.com>
… transactions, remove 'as any' Co-Authored-By: Patrick Munis <pmunis@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements all critical missing business logic pieces identified in the 4.2/10 audit, resolving 336 TypeScript compilation errors and all test failures.
Key changes:
cashIn.ts/cashOut.tsrouters with full double-entry accounting, CBN limits, AML flagging, idempotencyserver/lib/cbnLimits.ts— centralized KYC tier-based transaction limit enforcementagentLoanOrigination.ts— replaced hardcoded\"LA-001\"responses with real DB operations (credit scoring → approval → disbursement → repayment)calculateFee/calculateCommission/calculateTaxresults into transaction records across ~300 routerswriteAuditLog()to mutation proceduresSTATUS_TRANSITIONSstate machines in status-changing mutationsgl_journal_entriesfor all float-modifying routerswriteAuditLogblocks injected outside handler scopeMath.randomwithcrypto.randomBytesin financial routersResult: 0 TypeScript errors, 4,292 tests passing.
Link to Devin session: https://app.devin.ai/sessions/3ebd42bf0430422a9a2bd85ed9f9cd4c