Dealflow, Scheduler, Offers & E-Signing
When a prospective customer submits a lead, books a meeting, views a white-label offer, and digitally signs a cooperative agreement, the request crosses 4 repositories. Use this map to jump straight to the right file.
Business Flow: Lead -> Offer -> E-Sign -> Stripe Billing π¨ Curated Flow (Pull-Protected)
Where Is It in Code?
| Stage / Symptom | Repository | Exact File / Path |
|---|---|---|
Public lead inquiry form (planovi.app) + Turnstile | planovi-webpage | contact-handler.php |
Embeddable white-label inquiry & offer viewer (dealflow.planovi.app) | planovi-microservices | dealflow/inquiry.php, dealflow/offer.php, dealflow/api/ |
Google Calendar appointment widget (scheduler.planovi.app) | planovi-microservices | scheduler/index.php, scheduler/backend/ (OAuth2 + booking API) |
Digital contract signing page (agreements.planovi.app) | planovi-microservices | agreements/sign.php, dealflow/sign.php |
| Multi-environment URL & error resolver for PHP microservices | planovi-microservices | config.php (detects localhost vs dev-* vs PROD) |
| Sales rep CRM pipeline, offer builder & templates in app | planovi-flutter-app | lib/features/{dealflow,offers,agreements,scheduler,templates,clients}/ |
| Offer & form preview generation + admin edit links | planovi-backend | supabase/functions/{submit-inquiry,generate-offer,create-form-preview,create-admin-edit-link}/ |
| Agreement generation, e-signing API & final PDF sealing | planovi-backend | supabase/functions/{generate-agreement,send-signature-request,signing-api,finalize-agreement,send-agreement-email}/ |
| Automated appointment reminders & calendar cron | planovi-backend | supabase/functions/run-scheduler/, reminder-scheduler/ |
Important Cross-Service Bridges & Gotchas
- White-Label Branding (Zone 2): Tenant embed pages in
planovi-microservicesdynamically apply each cooperativeβs--tenant-primarycolor & logo (with WCAG button text contrast). Do not hardcode Planovi green (#32CA42) over customer tenant tokens there. - Backend β Microservices Auth:
planovi-backendcallsDEALFLOW_BASE_URLandSCHEDULER_BASE_URLusingDEALFLOW_API_SECRETandSCHEDULER_API_SECRET(and_DEVvariants insupabase-edge-runtime-dev). A401/403between Edge Functions and PHP almost always means a secret mismatch between/opt/vps-stack/.envandplanovi-microservices. - Flat-File Permissions on VPS:
dealflow/data/andscheduler/data/must remain writable bywww-datainsidephp-app.
# Watch PHP microservice errors on VPSdocker logs -f --tail 100 php-app