The card-terminal integration only ever worked when the API could reach the terminal's IP directly — impossible for the cloud deployment, where the terminal sits on the café LAN (the same wall the Print Agent already climbs for printers). And the terminal IP had to be typed by hand. Both fixed by reusing the agent. Cloud→LAN relay: - PrintAgentRegistry.SendPaymentAsync sends a PaymentRequest to the café's online agent and awaits its ack (PaymentResult on the hub); 95s window for the customer. - PosDeviceService now prefers an online agent (branch-matched, else any café agent) to relay POST /pay over the LAN, and falls back to the direct HTTP call only when no agent is connected (on-prem). Agent errors map back to POS_DEVICE_*. - Agent (Program.cs + PosTerminal.cs) handles PaymentRequest → POSTs the amount to the terminal's local http://ip:port/pay and reports approval/decline/timeout. Auto-detect: - Registry.ScanAsync + hub ReportScan; POST /print-agents/scan asks online agents to scan their /24 for given ports and merges the hosts found. - Agent NetworkScanner scans the LAN (:9100 printers, :8088 terminals) with a short per-host TCP probe. - Dashboard: a "تشخیص خودکار" (auto-detect) button on the POS-device, receipt and kitchen IP fields scans via the agent and fills the IP:port from a found host. Backend + agent build clean; dashboard tsc clean. NOTE: the agent app is not in CI — it must be rebuilt and redeployed on the café PC to gain these handlers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Meezi — Day 1 Quick Start
Step 1 — Copy these 4 files to your project root
.cursorrules ← AI rules for Cursor MEEZI_CURSOR_GUIDE.md ← Full development guide docker-compose.yml ← Local DB + Redis README.md ← This file
Step 2 — Start local services
docker-compose up -d
Step 3 — Create project structure
mkdir meezi && cd meezi git init
mkdir src web mobile cd src dotnet new sln -n Meezi dotnet new webapi -n Meezi.API --use-controllers dotnet new classlib -n Meezi.Core dotnet new classlib -n Meezi.Infrastructure dotnet new classlib -n Meezi.Shared dotnet sln add Meezi.API Meezi.Core Meezi.Infrastructure Meezi.Shared
cd ../web npx create-next-app@latest dashboard --typescript --tailwind --app
cd ../mobile flutter create meezi_app --org ir.meezi
Step 4 — Open in Cursor
cursor . (from the meezi/ root folder)
Step 5 — Paste this FIRST prompt in Cursor chat (Cmd+L)
Read .cursorrules and MEEZI_CURSOR_GUIDE.md completely. Then do Sprint 1 Week 1:
- Set up the .NET solution with proper references between projects
- Add all NuGet packages listed in the guide to each project
- Create the complete EF Core entity schema from the guide
- Set up AppDbContext with all DbSets
- Create TenantMiddleware and ITenantContext
- Set up Program.cs with full middleware pipeline
Cursor Chat Tips
Ask one sprint at a time
"Do Sprint 2: build the POS order APIs (menu, tables, orders)"
Reference specific sections
"Build the CRM endpoint from Step 10 of MEEZI_CURSOR_GUIDE.md"
Debug with context
"The order API returns 403. Check if TenantMiddleware is injecting CafeId correctly"
Generate Flutter screens
"Build the Flutter POS screen from Sprint 2 in the guide. RTL, Farsi, Riverpod state"
Useful Cursor Keyboard Shortcuts
Cmd+L → Open AI chat Cmd+K → Inline AI edit (select code first) Cmd+I → Composer (multi-file edits) Cmd+. → Quick fix / suggestion Tab → Accept autocomplete
Local URLs when running
Backend API: https://localhost:7001 API Swagger: https://localhost:7001/swagger Dashboard: http://localhost:3000 Hangfire UI: https://localhost:7001/hangfire Flutter web: http://localhost:8080