fix: POS gaps — geofencing, iot-smart-pos, terminal-ownership, batch settlement, leases schema#28
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>
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:
|
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
Fixes all 6 POS gaps identified in the production readiness audit to bring POS features from 8.2/10 → 10/10:
pos-geofencing — replaced hardcoded
{"in_zone": True, "alerts": []}stubs with real haversine distance computation + asyncpg PostgreSQL persistence (tables:geofences,geofence_events,terminal_locations)iot-smart-pos — added Python service with fixed FastAPI constructor (previously had unclosed paren with imports injected mid-expression preventing startup) + asyncpg connection pooling
terminal-ownership — expanded from 159-line stub to full lifecycle service (530 lines) with domain-specific status transitions (
provisioned → assigned → active → suspended → maintenance → decommissioned/lost/stolen), 4 PostgreSQL tables, audit trailposBatchSettlement — new dedicated tRPC router with 7 procedures:
createBatch,list,getById,processBatch,failBatch,reconcileBatch,stats. Aggregates POS transactions by terminal, calculates net amounts viacalculateFee(), properwriteAuditLog()integrationterminal_leases + pos_settlement_batches — two new Drizzle schema tables with FK constraints and indexes, replacing JSON storage in
platformSettingsterminalLeasing router — rewritten to use dedicated
terminalLeasestable instead ofplatformSettingsJSON. ProperwriteAuditLog({...})signature matching existing router patterns"Link to Devin session: https://app.devin.ai/sessions/3ebd42bf0430422a9a2bd85ed9f9cd4c